I have a grid set up like so:
<radG:RadGrid ID="RadGrid1" runat="server" Skin="UCITGrid" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" EnableAJAX="True" GridLines="None" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" OnItemCommand="RadGrid1_OnItemCommand" PageSize="20">
<MasterTableView DataSourceID="SqlDataSource1" CommandItemDisplay="Top" CommandItemSettings-AddNewRecordImageUrl="../../RadControls/Grid/Skins/UCITGrid/AddRecord.png" EditMode="InPlace">
<CommandItemTemplate>
<asp:LinkButton ID="LinkButton2" runat="server" CommandName="InitInsert" Visible="true"><img style="border:0px" alt="" src="../../RadControls/Grid/Skins/UCITGrid/AddRecord.png" /> Add a New Program</asp:LinkButton>
</CommandItemTemplate>
<SortExpressions>
<radG:GridSortExpression FieldName="fldArchive" SortOrder="Ascending" />
</SortExpressions>
<Columns>
<radG:GridBoundColumn DataField="fldID" UniqueName="IDColumn" Display="False">
</radG:GridBoundColumn>
<radG:GridBoundColumn DataField="fldName" HeaderText="Name" UniqueName="NameColumn">
<ItemStyle width="70%"/>
</radG:GridBoundColumn>
<radG:GridCheckBoxColumn DataField="fldArchive" HeaderText="Archive" UniqueName="ArchiveColumn">
<ItemStyle width="15%"/>
</radG:GridCheckBoxColumn>
<radG:GridEditCommandColumn ButtonType="ImageButton" UpdateImageUrl="../../RadControls/Grid/Skins/UCITGrid/Update3.png" EditImageUrl="../../RadControls/Grid/Skins/UCITGrid/Edit2.png" CancelImageUrl="../../RadControls/Grid/Skins/UCITGrid/Cancel3.png" InsertImageUrl="../../RadControls/Grid/Skins/UCITGrid/Update3.png" InsertText="Save" HeaderText="Options" UniqueName="EditCommandColumn">
<ItemStyle width="15%"/>
</radG:GridEditCommandColumn>
</Columns>
</MasterTableView>
</radG:RadGrid>
I have this in my code behind:
Protected Sub RadGrid1_OnItemCommand(ByVal source As Object, ByVal e As GridCommandEventArgs)
If e.CommandName = "Update" Then
Dim dataItem As GridDataItem = CType(e.Item, GridDataItem)
Dim name As String = dataItem("NameColumn").Text
Response.Write(name)
End If
End Sub
For some reason, the name string contains an empty string, when in reality, there is a value assigned to it. Is there something here that I'm missing?
Please let me know. Thank you!