Jun 28, 2013, 8:40 AM
GridPanel RecordID returns -1 when JsonReader IDProperty set to GUID?
Good morning,
a quick question (I am sure there is an easy answer ...). In the following code, the store's IDProperty is set to "ProviderUserKey" which correctly contains the GUID but gridpanel's RowSelectionModel1.SelectedRow.RecordID is always "-1" instead of the GUID value. Why, what am I missing?
a quick question (I am sure there is an easy answer ...). In the following code, the store's IDProperty is set to "ProviderUserKey" which correctly contains the GUID but gridpanel's RowSelectionModel1.SelectedRow.RecordID is always "-1" instead of the GUID value. Why, what am I missing?
<ext:Store
ID="Store1"
runat="server"
OnRefreshData="Store1_RefreshData">
<Proxy>
<ext:PageProxy />
</Proxy>
<Reader>
<ext:JsonReader IDProperty="ProviderUserKey">
<Fields>
<ext:RecordField Name="UserName" />
<ext:RecordField Name="LastLoginDate" Type="Date" />
<ext:RecordField Name="CreationDate" Type="Date" />
<ext:RecordField Name="IsApproved" Type="Boolean" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
<ext:GridPanel
ID="GridPanel1"
runat="server"
Height="400"
AutoWidth="true"
StoreID="Store1"
AutoExpandColumn="UserName">
<ColumnModel>
<Columns>
<ext:Column Header="Όνομα Χρήστη" Width="50" DataIndex="UserName" />
<ext:DateColumn Header="Δημιουργήθηκε" Width="150" DataIndex="CreationDate" Format="dd/MM/yyyy HH:mm" />
<ext:DateColumn Header="Τελευτ. Είσοδος" Width="150" DataIndex="LastLoginDate" Format="dd/MM/yyyy HH:mm" />
<ext:CheckColumn Header="Ενεργός" Align="Center" Width="80" DataIndex="IsApproved" Editable="true" />
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true">
<DirectEvents>
<RowSelect OnEvent="GridPanel1_RowSelect">
</RowSelect>
</DirectEvents>
</ext:RowSelectionModel>
</SelectionModel>
</ext:GridPanel>
Code behind: protected void Store1_RefreshData(object sender, StoreRefreshDataEventArgs e)
{
this.Store1.DataSource = Membership.GetAllUsers(); // returns ASP.NET's MemberhipUserCollection
this.Store1.DataBind();
}
protected void GridPanel1_RowSelect(object sender, DirectEventArgs e)
{
Guid guid = new Guid(RowSelectionModel1.SelectedRow.RecordID); // FAILS
}
Thank you