fetching data from currently edited row

  • Thread starter Dmitry Korolyov [MVP]
  • Start date
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,037
Latest member
MozzGuardBugs

Latest Threads

Top