Hi all,
I have bound my combobox to database using Dataset. as:
DataSet ds=new DataSet();
ds=data.ReturnAll(sqlstr);
cboCategory.DataSource=ds.Tables[0];
cboCategory.ValueMember="CategoryID";
cboCategory.DisplayMember="Category";
It is filling the combox Okay.
When i am trying to get an item i do as follow:
Object selectedItem = cboCategory.SelectedItem;
MessageBox.Show(selectedItem.ToString());
It returns System.Data.RowView ??? I don't know why? My questions:
1-How can i get the text of the combox?
2-How can i get the index of the item bound in the combox?
regards
I have bound my combobox to database using Dataset. as:
DataSet ds=new DataSet();
ds=data.ReturnAll(sqlstr);
cboCategory.DataSource=ds.Tables[0];
cboCategory.ValueMember="CategoryID";
cboCategory.DisplayMember="Category";
It is filling the combox Okay.
When i am trying to get an item i do as follow:
Object selectedItem = cboCategory.SelectedItem;
MessageBox.Show(selectedItem.ToString());
It returns System.Data.RowView ??? I don't know why? My questions:
1-How can i get the text of the combox?
2-How can i get the index of the item bound in the combox?
regards