Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > EditColumn Events methods

Reply
Thread Tools

EditColumn Events methods

 
 
kuljitsingh@hotmail.com
Guest
Posts: n/a
 
      04-07-2005
Why e.Item.DataItem("datafield") does not works in EditCommand,
CancelCommand, and UpdateCommand whereas e.Item.Cells(12).Text works?
Is there a way to retreive datafields of a datagrid by their fieldnames
in these event methds???

Scorpius

Examnple -
Private Sub DataGrid123_EditCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs ) Handles
DataGrid123.EditCommand

e.Item.Cells(12).Text 'WORKS
e.Item.DataItem("datafield") ' DOES NOT WORKS

 
Reply With Quote
 
 
 
 
Elton Wang
Guest
Posts: n/a
 
      04-08-2005
Hi kuljitsingh,

e.Item.DataItem is from the datagrid's underlying data
source, whereas e.Item.Cells(index) is a cell of datagrid
itself. When postback datagrid's underlying data source is
gone (unless you save it in Session and retrieve it from
Session).

HTH

Elton Wang
http://www.velocityreviews.com/forums/(E-Mail Removed)


>-----Original Message-----
>Why e.Item.DataItem("datafield") does not works in

EditCommand,
>CancelCommand, and UpdateCommand whereas e.Item.Cells

(12).Text works?
>Is there a way to retreive datafields of a datagrid by

their fieldnames
>in these event methds???
>
>Scorpius
>
>Examnple -
>Private Sub DataGrid123_EditCommand(ByVal source As

Object, ByVal e As
>System.Web.UI.WebControls.DataGridCommandEventArg s)

Handles
>DataGrid123.EditCommand
>
> e.Item.Cells(12).Text 'WORKS
> e.Item.DataItem("datafield") ' DOES NOT WORKS
>
>.
>

 
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
Is there a way to find the class methods of a class, just like'methods' finds the instance methods? Kenneth McDonald Ruby 5 09-26-2008 03:09 PM
Events Events Events Please Help Chris ASP .Net Web Controls 0 08-30-2005 08:21 PM
EditColumn Jim Heavey ASP .Net 1 11-18-2003 08:41 AM
CSS in EditColumn and EditItem Thiago Temple ASP .Net Datagrid Control 0 09-15-2003 11:50 AM
CSS in EditColumn and EditItem Thiago Temple ASP .Net Datagrid Control 0 09-12-2003 04:04 PM



Advertisments