Groups | Blog | Home
all groups > asp.net datagrid control > december 2004 >

asp.net datagrid control : Retreive values from invisible cell


Patrice COTE via .NET 247
12/22/2004 3:53:03 PM
Hi !

I'm trying to update a table with an editable DataGrid (Edit,=
Update, Cancel button)=2E In the Update event of the item, I can=
retreive every value by using the TableCell object=
(DataGridCommandEventArgs=2EItem)=2E The only value I can' retreive=
is the one that I stored in an invisible cell=2E

Here's a sample code :

protected void ItemsGrid_Update(object sender,=
DataGridCommandEventArgs e)
{
//We have to look for the inner control (TextBox) because=
we're in
//edit mode and every cell is filled with a TextBox
string strNumLigne =3D e=2Eitem=2ECells[0]=2EControls[0]=2EText;
}

If the Cell is Visible, it works fine, but if it's not, I always=
get ""=2E Does anybody knows how could I get the value of this=
invisible cell ?


--------------------------------
From: Patrice COTE

-----------------------
Posted by a user from =2ENET 247 (http://www=2Edotnet247=2Ecom/)

R. Thomas, aka Xtreme.Net
12/23/2004 11:29:02 PM
Well, whenever I do that kinda stuff i get the text easily, but according to
you, you don't.
So I tried again and I can confirm here that
e.Item.Cells(8).Text
works perfectly for me.
Maybe you can skip looking in the control in the cell...
Hth...
AddThis Social Bookmark Button