Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Text in dataGrid cell

Reply
Thread Tools

Text in dataGrid cell

 
 
simon
Guest
Posts: n/a
 
      11-04-2005
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

 
Reply With Quote
 
 
 
 
S.M. Altaf [MVP]
Guest
Posts: n/a
 
      11-04-2005
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" <> wrote in message
news:uN2os$...
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


 
Reply With Quote
 
 
 
 
simon
Guest
Posts: n/a
 
      11-04-2005
The column is:

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


regards,Simon

"S.M. Altaf [MVP]" <> wrote in message
news:%...
> 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" <> wrote in message
> news:uN2os$...
> 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
>
>



 
Reply With Quote
 
=?Utf-8?B?bmV0ZHVkZQ==?=
Guest
Posts: n/a
 
      11-04-2005
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]" <> wrote in message
> news:%...
> > 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" <> wrote in message
> > news:uN2os$...
> > 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
> >
> >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set cell background based on cell value when datagrid is displayed RJ ASP .Net Datagrid Control 1 02-17-2005 09:37 PM
How to set and highlight text in JTable cell on selection and/or invoke cell editor directly. news.rcn.com Java 1 07-12-2004 10:22 PM
RadioButtonList In A DataGrid Cell - Can I find the selected button without editing the cell? Empire City ASP .Net Datagrid Control 3 04-30-2004 12:19 AM
Get text from datagrid cell MS Newsgroups ASP .Net 1 01-21-2004 06:49 PM
datagrid: can't get read text from a cell programmatically David ASP .Net 1 07-03-2003 12:43 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57