Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
Sathyaish #1
Getting the text of the ButtonColumn
How do you get the text of a ButtonColumn control column in a datagrid?
As an example, I tried this little snippet on a test project, but it
returns a null string.
Private Sub dg_ItemCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs ) Handles
dg.ItemCommand
If Not e.Item Is Nothing Then
lblMessage.Text = "You clicked " & e.Item.Cells(1).Text &
"."
End If
End Sub
where the column clicked is of type ButtonColumn and it is the second
column (index 1) in the row.
<asp:ButtonColumn DataTextField="Full Name" HeaderText="Full
Name"></asp:ButtonColumn>
I also tried:
Dim lbl As HyperLink = CType(e.Item.Cells(1).Controls(0), HyperLink)
lblMessage.Text = "You clicked " & lbl.Text & "."
but it said that the specified cast is not valid.
Sathyaish Guest
-
ButtonColumn info
Hello, I have a datagrid dgGrid and want add column depending of a context. I am usin this following code : .... while (Clcpt<7) {... -
buttoncolumn or hyperlinkcolumn
Thanks Scott! I'm a new fan of your site. I started reading the Extensive look at the Datgrid article you wrote there. I also plan on buying your... -
Retrieve ButtonColumn Text
The first column on my grid is a ButtonColumn type. I want to be able to get the Text value from withing the ItemCommand event. I know that... -
Problem accessing Text property of asp:ButtonColumn column
Hi, I have a datagrid where the first column has the following structure <Columns> <asp:ButtonColumn HeaderText="Select Item" ButtonType=... -
buttonColumn
Hi, Can someone please help? Currently I have in my datagrid a itemtemplate colume with a href that is working. However, instead of using...



Reply With Quote

