ASP.NET DataGrid DropDownList edit problem
-
I use DropDownList edit DataGrid data, There have 4 columns using DropDownList for edit data. Generally I only want to change one column data. But when I enter editing mode, the all DropDownList’s index change to zero, only I want to change one column! How I set all DropDownList Index default to right value.
-
I use DropDownList edit DataGrid data, There have 4 columns using DropDownList for edit data. Generally I only want to change one column data. But when I enter editing mode, the all DropDownList’s index change to zero, only I want to change one column! How I set all DropDownList Index default to right value.
-
I am not sure whether i have understood the problem correctly but if you want to set some value of the dropdownlist control as selected then this you can do in OnItemDataBound event of the datagrid.
Best Regards, Apurva Kaushal
-
Thanks for your help. I just want to set a default dropdownlist selectedindex,not use the default zero. I tried in OnItemDataBound event at edit mode ,but I can't get dropdownlist control.Could you give me more tips? thank you
-
In that event first you have to check for the edit mode and then you have to find the control by the ID you have given and once you find the control you can set the selected item in that. Hope this makes things a bit clear.
Best Regards, Apurva Kaushal