I've still got a kind of a similar problem:
when using this commandbutton in the datagrid i want to get the name in the
third column...
but this gives an empty string
When using cells(2) there is no problem at all, but there i'm using a
boundcolumn...
Public Sub ShowInfo(ByVal objSender As System.Object, ByVal objArgs As
DataGridCommandEventArgs) ' Handles DataGrid1.ItemCommand
If objArgs.CommandSource.commandname = "Info" Then
Dim myName As string = objArgs.Item.Cells(3).Text
Response.Redirect("./webForm1.aspx?myMovie=" & myName)
End If
End Sub
my cell(3):
<asp:TemplateColumn HeaderText="Titel">
<ItemTemplate>
<asp:Label ID="lblmovieName"
Text='<%#DataBinder.Eval(Container.DataItem, "movieName") %>' Runat="server"/>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtmovieName" Width="300" Text='<%#
DataBinder.Eval(Container.DataItem, "movieName") %>' Runat="server"/>
</EditItemTemplate>
</asp:TemplateColumn>