Item Cell Text in grid

  • Thread starter Thread starter dsoltesz
  • Start date Start date
D

dsoltesz

I have a grid that has a couple columns all are bound
columns except one..which is a button column. I use the
code

TableCell IDColumn = e.Item.Cells[1];
FileName = IDColumn.Text;

if I set the cell index to any of the bound columns I get
the text out of the cell...if I set the cell index to the
button column I don't get the value even though there is
data in the field?
 
Hi,
e.Item.Cells[1]; return the cell. If you want other items IN the cell
use findControl.

If the button name/ID id MyID it should be:
e.Item.Cells[1].FindControl("MyID").Text;


Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
 
I had a similar problem. How can access a TextBox's value in the column
footer when a button outside the DataGrid (that means I don't have e as
DataGridItemEventArgs) is clicked...

Serdar KALAYCI

dsoltesz said:
Thanks
-----Original Message-----
I have a grid that has a couple columns all are bound
columns except one..which is a button column. I use the
code

TableCell IDColumn = e.Item.Cells[1];
FileName = IDColumn.Text;

if I set the cell index to any of the bound columns I get
the text out of the cell...if I set the cell index to the
button column I don't get the value even though there is
data in the field?

.
 
Back
Top