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,SHi,
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
"simon" <simon.zupan@.stud-moderna.si> wrote in message
news:uN2os$T4FHA.3844@.TK2MSFTNGP10.phx.gbl...
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
The column is:
<asp:TemplateColumn HeaderText="Description">
<ItemTemplate>
<%# Container.DataItem( "pie_description" ) %>
</ItemTemplate>
</asp:TemplateColumn
regards,Simon
"S.M. Altaf [MVP]" <smaltaf@.PLEASEDONTSPAMMEmsn.com> wrote in message
news:%238OKEXU4FHA.2532@.TK2MSFTNGP09.phx.gbl...
> 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
>
> "simon" <simon.zupan@.stud-moderna.si> wrote in message
> news:uN2os$T4FHA.3844@.TK2MSFTNGP10.phx.gbl...
> 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
try this
CType(e.Item.Cells(4).Controls(0), DataBoundLiteralControl).Text
"simon" wrote:
> The column is:
> <asp:TemplateColumn HeaderText="Description">
> <ItemTemplate>
> <%# Container.DataItem( "pie_description" ) %>
> </ItemTemplate>
> </asp:TemplateColumn>
>
> regards,Simon
> "S.M. Altaf [MVP]" <smaltaf@.PLEASEDONTSPAMMEmsn.com> wrote in message
> news:%238OKEXU4FHA.2532@.TK2MSFTNGP09.phx.gbl...
> > 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
> > "simon" <simon.zupan@.stud-moderna.si> wrote in message
> > news:uN2os$T4FHA.3844@.TK2MSFTNGP10.phx.gbl...
> > 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
>
0 comments:
Post a Comment