I wanna access value of first column of selected row. I used SqlDataSource as a source, and ModelFields in Store. I got datas for GridPanel directly from sql database. I am accessing row number of selected rows by using ;
RowSelectionModel rsm = grid1.SelectionModel.Primary as RowSelectionModel;
rsm.SelectedIndex.ToString();
and record id returns something that i did not implement;
rsm.SelectedRecordID; //returns ext-33-0 or ext-33-1 depends on row number
How can I access the first (or any) column of selected row? Thank you.
Related scripts;
<asp:SqlDataSource
ID="SqlDataSource1"
runat="server"
ConnectionString="<%$ ConnectionStrings:Database %>"
/>
<ext:Store ID="sqlStore" runat="server" DataSourceID="SqlDataSource1" >
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name = "billNo" Unique="true" />
<ext:ModelField Name = "senderVKN" />
<ext:ModelField Name = "receiverVKN" />
<ext:ModelField Name = "Date" Type="Date" />
<ext:ModelField Name = "Amount" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
<ext:GridPanel ID="grid1" runat="server"
AnchorHorizontal="100%"
AnchorVertical="20%"
ColumnLines ="true"
StoreID ="sqlStore">
<ColumnModel runat="server">
<Columns>
<ext:Column ID="billColumn" runat="server" Text="Bill No" DataIndex="billNo" ></ext:Column>
...
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel1" runat="server" Mode="Single" />
</SelectionModel>
</ext:GridPanel>
First of all I changed some parts of my code;
then I used RowSelectionModel;
Model field names must be same with your SqlDataSource's command value names.