Hi Telerik,
I have a RadGrid, that I have set up to allow me to select rows by clicking on them
From here I would like to retrieve the uniqueID by using the allowrowselect feature
How would i retrieve the data in the uniqueID column, on my selected row. I'm working in VB, however an answer in c# is fine.
Your help is greatly appreciated!
Ryan
Also when i use
I get an argument out of range exception
Saying my index was out of range. must be non-negative and less than the size of the collection
I have a RadGrid, that I have set up to allow me to select rows by clicking on them
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateSelectColumn="True" CellSpacing="0" GridLines="Horizontal" AutoGenerateColumns="False" OnClientClick="RadGrid1_SelectedIndexChanged"> <ClientSettings EnablePostBackOnRowClick="true"> <Selecting AllowRowSelect="true" /> </ClientSettings><MasterTableView><Columns> <telerik:GridTemplateColumn AllowFiltering="false" UniqueName="TemplateEditColumn"> <ItemTemplate> <asp:HyperLink ID="EditLink" runat="server" Text="Edit"></asp:HyperLink> </ItemTemplate> <FooterStyle Width="32px" /> <HeaderStyle Width="32px" /> <ItemStyle Width="32px" /> </telerik:GridTemplateColumn> <telerik:GridBoundColumn DataField="UniqueID" HeaderText="Unique ID" UniqueName="UniqueID" FooterStyle-Width="1px" HeaderStyle-Width="1px" ItemStyle-Width="1px" Visible="false"/> <telerik:GridBoundColumn DataField="Telephone" HeaderText="Telephone" UniqueName="Telephone" FooterStyle-Width="1px" HeaderStyle-Width="1px" ItemStyle-Width="1px" Visible="false"/> <telerik:GridBoundColumn DataField="StatusID" HeaderText="StatusID" UniqueName="StatusID" FooterStyle-Width="1px" HeaderStyle-Width="1px" ItemStyle-Width="1px" Visible="false"/> <telerik:GridBoundColumn DataField="Customer" HeaderText="Customer" UniqueName="Customer" FooterStyle-Width="1px" HeaderStyle-Width="1px" ItemStyle-Width="1px" /> <telerik:GridBoundColumn DataField="From" HeaderText="From" UniqueName="From" FooterStyle-Width="100px" HeaderStyle-Width="100px" ItemStyle-Width="100px" Visible="false"/> <telerik:GridBoundColumn DataField="Subject" HeaderText="Subject" UniqueName="Subject" FooterStyle-Width="100px" HeaderStyle-Width="100px" ItemStyle-Width="100px" /> <telerik:GridBoundColumn DataField="Name" HeaderText="Taken By" UniqueName="Name" FooterStyle-Width="100px" HeaderStyle-Width="100px" ItemStyle-Width="100px" /> <telerik:GridBoundColumn DataField="TakenOn" HeaderText="Taken On" UniqueName="TakenOn" FooterStyle-Width="100px" HeaderStyle-Width="100px" ItemStyle-Width="100px" /> <telerik:GridBoundColumn DataField="Urgent" HeaderText="Urgent" UniqueName="Urgent" FooterStyle-Width="1px" HeaderStyle-Width="1px" ItemStyle-Width="1px" /> <telerik:GridBoundColumn DataField="StatusNew" HeaderText="Status" UniqueName="StatusNew" FooterStyle-Width="100px" HeaderStyle-Width="100px" ItemStyle-Width="100px" /></Columns><CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings><RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column"><HeaderStyle Width="5px"></HeaderStyle></RowIndicatorColumn><ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"><HeaderStyle Width="5px"></HeaderStyle></ExpandCollapseColumn><EditFormSettings><EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn></EditFormSettings></MasterTableView><FilterMenu EnableImageSprites="False"></FilterMenu> </telerik:RadGrid>From here I would like to retrieve the uniqueID by using the allowrowselect feature
How would i retrieve the data in the uniqueID column, on my selected row. I'm working in VB, however an answer in c# is fine.
Your help is greatly appreciated!
Ryan
Also when i use
Dim item As GridDataItem = TryCast(RadGrid1.SelectedItems(0), GridDataItem)I get an argument out of range exception
Saying my index was out of range. must be non-negative and less than the size of the collection