D
Dmitry Korolyov [MVP]
ASP.NET 1.1 c# project
Situation: some code handling with datagrid control. DataGrid1.EditItemIndex != -1 (i.e. I have some row of data selected). I'm using template columns for generation of custom edit controls (drop-downlists instead of textboxes). I've managed to dynamically bind the dropdownlist from some datasource, and now I need to set dropdownlist "selected" value to the current value of the data. That's the problem - can't seem to get the current value!
I'm trying to do so using DataBinder.Eval() method, DataBinder.Eval(DataGrid1.Items[DataGrid1.EditItemIndex].DataItem, "myColumnNama"), but it returns null. Trace shows DataGrid1.Items[DataGrid1.EditItemIndex].DataItem as "<undefined value>", and that seems to be the problem. DataGrid1.EditItemIndex != -1, as I mentioned before, and I can't seem to get why the dataitem is undefined. Any ideas?
Situation: some code handling with datagrid control. DataGrid1.EditItemIndex != -1 (i.e. I have some row of data selected). I'm using template columns for generation of custom edit controls (drop-downlists instead of textboxes). I've managed to dynamically bind the dropdownlist from some datasource, and now I need to set dropdownlist "selected" value to the current value of the data. That's the problem - can't seem to get the current value!
I'm trying to do so using DataBinder.Eval() method, DataBinder.Eval(DataGrid1.Items[DataGrid1.EditItemIndex].DataItem, "myColumnNama"), but it returns null. Trace shows DataGrid1.Items[DataGrid1.EditItemIndex].DataItem as "<undefined value>", and that seems to be the problem. DataGrid1.EditItemIndex != -1, as I mentioned before, and I can't seem to get why the dataitem is undefined. Any ideas?