Please Help- only have half a day
-
I have two questions I hope you can help with. How can I display my combobox display default to blank when I have a bound data source. (I need it that way). I have tried combobox.selectedIndex = -1 but doesn't work. Have also added the column of blank manually like this DataRow newemployeesRow = dataSet1.Tables["employees"].NewRow(); newemployeesRow["Fullname"] = ""; newemployeesRow["Fullname"] = -1; dataSet1.Tables["employees"].Rows.Add(newemployeesRow); It shows a column of -1 in my combobox but it is not set to the default though. the user has to select it. If I remove the combobox.selectedIndex = -1 it displays blank which I want, but it's still not the default. Can someone please help.:wtf:
-
I have two questions I hope you can help with. How can I display my combobox display default to blank when I have a bound data source. (I need it that way). I have tried combobox.selectedIndex = -1 but doesn't work. Have also added the column of blank manually like this DataRow newemployeesRow = dataSet1.Tables["employees"].NewRow(); newemployeesRow["Fullname"] = ""; newemployeesRow["Fullname"] = -1; dataSet1.Tables["employees"].Rows.Add(newemployeesRow); It shows a column of -1 in my combobox but it is not set to the default though. the user has to select it. If I remove the combobox.selectedIndex = -1 it displays blank which I want, but it's still not the default. Can someone please help.:wtf:
newemployeesRow["Fullname"] = ""; newemployeesRow["Fullname"] = -1; dataSet1.Tables["employees"].Rows.Add(newemployeesRow); after this try by using this code. dataSet1.AcceptChanges();
VanithaVasu
-
newemployeesRow["Fullname"] = ""; newemployeesRow["Fullname"] = -1; dataSet1.Tables["employees"].Rows.Add(newemployeesRow); after this try by using this code. dataSet1.AcceptChanges();
VanithaVasu
-
I have two questions I hope you can help with. How can I display my combobox display default to blank when I have a bound data source. (I need it that way). I have tried combobox.selectedIndex = -1 but doesn't work. Have also added the column of blank manually like this DataRow newemployeesRow = dataSet1.Tables["employees"].NewRow(); newemployeesRow["Fullname"] = ""; newemployeesRow["Fullname"] = -1; dataSet1.Tables["employees"].Rows.Add(newemployeesRow); It shows a column of -1 in my combobox but it is not set to the default though. the user has to select it. If I remove the combobox.selectedIndex = -1 it displays blank which I want, but it's still not the default. Can someone please help.:wtf:
-
hii at starting u asked that u wanna have blank in the combox fro default. whaen u remove combobox.selectedIndex=-1 from code u get that then what do u mean by it's not default! please clear the point Thanks Avinob Roy