473,406 Members | 2,894 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Text in dataGrid cell

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

Nov 19 '05 #1
3 1441
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" <si*********@stud-moderna.si> wrote in message
news:uN**************@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
Nov 19 '05 #2
The column is:

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

"S.M. Altaf [MVP]" <sm*****@PLEASEDONTSPAMMEmsn.com> wrote in message
news:%2****************@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" <si*********@stud-moderna.si> wrote in message
news:uN**************@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

Nov 19 '05 #3
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]" <sm*****@PLEASEDONTSPAMMEmsn.com> wrote in message
news:%2****************@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" <si*********@stud-moderna.si> wrote in message
news:uN**************@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


Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Eddie B. | last post by:
How do you get the text value of a DataGrid in a WebForm? I am doing all of my DataBinding @ runtime.
3
by: Randy | last post by:
Hello, How would this be done? I've looked at the datagrid itself and also the tableStyle and can't find out how to make text wrap in a cell. Thanks
0
by: Frnak McKenney | last post by:
One of the reasons given for the Allied victory in WWI is that the Nazi armament industry invested so much effort in creating new weapons (e.g. the jet plane) it wasn't able to develop any of them...
2
by: martin | last post by:
Hi, I am iterating through the dataitems in a datagrid and producing and xml document, If a particular cell in the datagrid has a textbox control or a datagrid control in it then I have no...
5
by: Brian Henry | last post by:
I have a messaging application that has a data grid with information like an email list would have (from, subject, time sent, size) but the subject could be very long in theory, and then it would...
3
by: Craig G | last post by:
what way do you code it? i tried the following but it wouldnt display it lblAdd_info is a hidden field in the cell itself that contains the data i want to display in the tooltip text. i added the...
1
by: Tracey | last post by:
Hi, there My application requires to display multiline text in the cell of datagrid. I set the preferredheight of datagrid's tablsstyle, however, it is fixed. For text longer than that, the rest...
2
by: niceguy | last post by:
Hi I was wondering if its possible to get the exact displayed text from a cell in a datagrid. I need to get the displayed text and not any 'real' database value or anything that the cell...
1
by: jeguillo | last post by:
I am trying to retrieve the text within each cell in a datagrid in order to change the color of each cell, depending on the value within that cell. This works fine on the cells that are bound...
1
by: serge calderara | last post by:
Dear all, I have a datagrid which is bind to a databse table. One field of that table contains a filename. What I ma trying to do is to display the content of a cell to be an icon when the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.