Item Cell Text in grid

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?
 
N

Natty Gur

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
 
S

Serdar Kalayci

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?

.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,077
Messages
2,570,567
Members
47,203
Latest member
EmmaSwank1

Latest Threads

Top