fetching data from currently edited row

Discussion in 'ASP .Net Datagrid Control' started by Dmitry Korolyov [MVP], Oct 20, 2003.

  1. 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?

    --
    Dmitry Korolyov []
    MVP: Windows Server - Active Directory
    Dmitry Korolyov [MVP], Oct 20, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. SergioT

    DataGrid edited row and jScript

    SergioT, Feb 28, 2005, in forum: ASP .Net
    Replies:
    10
    Views:
    615
  2. =?Utf-8?B?UCBL?=

    DataGridView - Determine if a row has been edited

    =?Utf-8?B?UCBL?=, Apr 20, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    869
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    Apr 20, 2006
  3. Highlight Just Edited Row

    , Mar 14, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    350
  4. Radu
    Replies:
    0
    Views:
    641
  5. Mark B
    Replies:
    1
    Views:
    366
    Mark B
    Aug 27, 2008
Loading...

Share This Page