Text in dataGrid cell

S

simon

I would like to read the text from my dataGrid cell.

Private Sub dgdPie_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dgdPie.ItemCommand

If e.CommandName = "PieName" Then 'user clicks on link button
cellText=e.Item.Cells(4).text
end if

end sub



CellText is always '', no matter which cell I read.

I don't know why? I have text in all cells.

Regards,S
 
S

S.M. Altaf [MVP]

Hi,

Is that a template column, or a databound column you're trying to access?



--------------------------------------------------------------------------------
All that glitters has a high refractive index.
www.mendhak.com


I would like to read the text from my dataGrid cell.

Private Sub dgdPie_ItemCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs) Handles
dgdPie.ItemCommand

If e.CommandName = "PieName" Then 'user clicks on link button
cellText=e.Item.Cells(4).text
end if

end sub



CellText is always '', no matter which cell I read.

I don't know why? I have text in all cells.

Regards,S
 
S

simon

The column is:

<asp:TemplateColumn HeaderText="Description">
<ItemTemplate>
<%# Container.DataItem( "pie_description" ) %>
</ItemTemplate>
</asp:TemplateColumn>


regards,Simon
 

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

No members online now.

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,805
Latest member
ClydeHeld1

Latest Threads

Top