Click here to Skip to main content
15,913,722 members
Home / Discussions / C#
   

C#

 
QuestionAdd Item In Combobox Pin
jigneshDPatel23-Jan-09 18:39
jigneshDPatel23-Jan-09 18:39 
AnswerRe: Add Item In Combobox Pin
Wendelius23-Jan-09 21:33
mentorWendelius23-Jan-09 21:33 
GeneralRe: Add Item In Combobox Pin
jigneshDPatel23-Jan-09 22:23
jigneshDPatel23-Jan-09 22:23 
GeneralRe: Add Item In Combobox Pin
Wendelius23-Jan-09 22:58
mentorWendelius23-Jan-09 22:58 
GeneralRe: Add Item In Combobox Pin
jigneshDPatel23-Jan-09 23:15
jigneshDPatel23-Jan-09 23:15 
GeneralRe: Add Item In Combobox Pin
Wendelius24-Jan-09 0:09
mentorWendelius24-Jan-09 0:09 
GeneralRe: Add Item In Combobox Pin
jigneshDPatel24-Jan-09 0:44
jigneshDPatel24-Jan-09 0:44 
GeneralRe: Add Item In Combobox Pin
Wendelius24-Jan-09 0:58
mentorWendelius24-Jan-09 0:58 
aajignesh wrote:
In That the Data Will come is proper but Sir that Are Duplicate in to the combobox


Maybe a dumb question, but do you clear the combobox at any time? If not, you should add Clear to the FillCombo. Also you you may want to clear bindings. Like:
public void FillCombo()
{
   <code>this.cmbParentLevel.DataSource = null;</code>
   DataTable dt;
   strinf sql = "select Level_Id, Level_Name from UserLevel"
              + " where Level_Name = 'Sales'";
   dt = qry.FillDataSet(sql).Tables[0];
   if (dt.Rows.Count > 1)
   {
      MessageBox.Show("Problem: More than one row");
   }
   AddChildCombo((int)dt.Rows[0]["Level_Id"], ref dt);
   <code>this.cmbParentLevel.Items.Clear(); </code>
   this.cmbParentLevel.DataSource = dt;
   this.cmbParentLevel.DisplayMember = "Level_Name";
   this.cmbParentLevel.ValueMember = "Level_Id";
}


aajignesh wrote:
My one Friend Sid that that's to fillcombo with use Recursion is not give Proper Result and also say that that it is not proper way.


Recursion is just a technique to handle data which is in tree format. It can be used for many situations, like filling a combo. There's no reason why filling a combo with a recursion wouldn't work. The problem is in the implementation.

aajignesh wrote:
So if U know to the Other Way to Fill Combo so Please Tell Me That's Request Please


This depends where the data is coming from. Are you querying for example SQL Server database?

The need to optimize rises from a bad design.My articles[^]

GeneralRe: Add Item In Combobox Pin
jigneshDPatel24-Jan-09 1:22
jigneshDPatel24-Jan-09 1:22 
GeneralRe: Add Item In Combobox Pin
Wendelius24-Jan-09 1:49
mentorWendelius24-Jan-09 1:49 
GeneralRe: Add Item In Combobox Pin
jigneshDPatel27-Jan-09 17:34
jigneshDPatel27-Jan-09 17:34 
GeneralRe: Add Item In Combobox Pin
Wendelius27-Jan-09 19:45
mentorWendelius27-Jan-09 19:45 
QuestionConfig Files Pin
CodingYoshi23-Jan-09 10:59
CodingYoshi23-Jan-09 10:59 
AnswerRe: Config Files Pin
Wendelius23-Jan-09 11:03
mentorWendelius23-Jan-09 11:03 
GeneralRe: Config Files Pin
CodingYoshi23-Jan-09 11:23
CodingYoshi23-Jan-09 11:23 
GeneralRe: Config Files Pin
Not Active23-Jan-09 11:29
mentorNot Active23-Jan-09 11:29 
QuestionActing on an indeterminate checkbox checkstate Pin
Lodeclaw23-Jan-09 10:34
Lodeclaw23-Jan-09 10:34 
AnswerRe: Acting on an indeterminate checkbox checkstate Pin
DaveyM6923-Jan-09 10:38
professionalDaveyM6923-Jan-09 10:38 
GeneralRe: Acting on an indeterminate checkbox checkstate Pin
Lodeclaw23-Jan-09 10:41
Lodeclaw23-Jan-09 10:41 
GeneralRe: Acting on an indeterminate checkbox checkstate Pin
DaveyM6923-Jan-09 10:57
professionalDaveyM6923-Jan-09 10:57 
GeneralRe: Acting on an indeterminate checkbox checkstate Pin
Lodeclaw23-Jan-09 11:01
Lodeclaw23-Jan-09 11:01 
GeneralRe: Acting on an indeterminate checkbox checkstate Pin
DaveyM6923-Jan-09 11:14
professionalDaveyM6923-Jan-09 11:14 
Questioncreate propertie list&lt;&gt; [modified] Pin
khaled_basher23-Jan-09 10:17
khaled_basher23-Jan-09 10:17 
AnswerRe: create propertie list&lt;&gt; Pin
DaveyM6923-Jan-09 10:20
professionalDaveyM6923-Jan-09 10:20 
GeneralRe: create propertie list&lt;&gt; Pin
khaled_basher23-Jan-09 10:35
khaled_basher23-Jan-09 10:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.