problem editing in DataGrid

G

Guest

Hi,

I am trying to edit item in a datagrid. On clicking the edit button, the
column I want to enable editing is changed into a text box, which is fine.

But I can not retrieve the value of cell[0]. Which in my case is the rowid
in the table. I can see the value, but when I try this in the onEditItem
function...

e.Item.Cells[0].Text
it comes out blank.

But the same line 'e.Item.Cells[0].Text' returns a correct value on a
'ItemDataBound' function.

What am I doing wrong? Please help.

Thnx
 
G

Guest

when you click on the edit item it renders into text box control. so you need
to do

e.Item.Cells[0].Controls[0].Text
 
G

Guest

Thanks.

Sridhar said:
when you click on the edit item it renders into text box control. so you need
to do

e.Item.Cells[0].Controls[0].Text


dotnettester said:
Hi,

I am trying to edit item in a datagrid. On clicking the edit button, the
column I want to enable editing is changed into a text box, which is fine.

But I can not retrieve the value of cell[0]. Which in my case is the rowid
in the table. I can see the value, but when I try this in the onEditItem
function...

e.Item.Cells[0].Text
it comes out blank.

But the same line 'e.Item.Cells[0].Text' returns a correct value on a
'ItemDataBound' function.

What am I doing wrong? Please help.

Thnx
 

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
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top