Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Accessing DataRow Items by Name in Edit/Update/Delete Event

Reply
Thread Tools

Accessing DataRow Items by Name in Edit/Update/Delete Event

 
 
Marc Eggenberger
Guest
Posts: n/a
 
      01-31-2005
Hi there.

I have a small problem with DataGrid in ASP.NET & C#.

In the ItemDataBound Event I can use the following code

DataRowView drvSE = (DataRowView)e.Item.DataItem;

and then I can use
drvSE["ColumnName"].ToString();
to get the acutal data.

But in the Edit/Update/Delete Events this does not work.
The upper event has a DataGridItemEventArgs and the 3 commands where
it's not working have a DataGridCommandEventArgs.
They also have a e.Item.DataItem but its always null.

How should I do this here?

accessing the data with
e.Item.Cells[2].Text
works, but I dont want to hardcode the Columns position. How should I do
it?

--
mfg
Marc Eggenberger
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
get dataRow value from false column name orenl ASP .Net 1 12-04-2006 01:12 PM
Accessing the current DataRow of the DataSource from ItemDataBound Nathan Sokalski ASP .Net 5 09-25-2005 02:10 PM
Accessing the current DataRow of the DataSource from ItemDataBound Nathan Sokalski ASP .Net Web Controls 5 09-25-2005 02:10 PM
Accessing the current DataRow of the DataSource from ItemDataBound Nathan Sokalski ASP .Net Datagrid Control 5 09-25-2005 02:10 PM
Event OnClick on datarow in datagrid in ASP.NET ASP .Net 1 02-23-2005 03:45 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57