473,395 Members | 1,629 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

EditColumn Events methods

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

Nov 19 '05 #1
1 1053
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
el********@hotmail.com

-----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 fieldnamesin these event methds???

Scorpius

Examnple -
Private Sub DataGrid123_EditCommand(ByVal source As Object, ByVal e AsSystem.Web.UI.WebControls.DataGridCommandEventArg s) HandlesDataGrid123.EditCommand

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

.

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ryan Taylor | last post by:
Hopefully a quick question. I remember seeing a guideline on Microsofts site that stated the recommended order for declaring members, properties, events and orders. As I am really trying to...
14
by: JPRoot | last post by:
Hi I use the following syntax to have events inherited from base to child classes which works nicely (virtual and override keyword on events). But I am wondering if it is a "supported" way of using...
8
by: Waleed Seada | last post by:
Hi all What need to be done to get the MDI parent call his MDI children Events, methods Thanks in advance /WS
6
by: fshawish | last post by:
Hello all, I have a C# Class Lib that exposes a public events, methods and properties. I am referencing this ClassLib from an MFC DIalog app that is compiled with /CLR. I use gcroot<T> to...
1
by: Tina | last post by:
I'm a VB.Net developer learning C# so this is another newbie question.... (using 1.1) I posted a question about how to paste definitions for events in C# because in VB we use the vs.net left...
1
by: Valentin Kotelnitski | last post by:
Hello! I have got an application (some part of which is written by me). There is a control on which events are blocked (not processed) (do not work OnPaint, OnMouseDown, OnMouseOver and other...
3
by: phocis | last post by:
I wrote a pair of functions to enable scoped or referenced setTimeout calls. I did this because I have an object factory that creates multiple objects and those objects need to delay a few calls on...
5
by: Andy B | last post by:
I am trying to figure out how to make an object instance available for all methods of a class. I tried to do something like this: public class test { TheObject Instance = new TheObject();...
5
by: puzzlecracker | last post by:
I am sort of confused here. Jon Skeet allegedly claims that evens are like properties. To me, on the contrary, they look more like instances of delegates. What's the deal here? Thanks
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.