This is a migrated thread and some comments may be shown as answers.

Sort not working with xml dataset

0 Answers 55 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chris @ Intrinsic
Top achievements
Rank 1
Chris @ Intrinsic asked on 14 Oct 2010, 07:55 PM
I am using an xml datasource to populate the grid
and I was wondering if that could be the problem at all?  It is just for testing purposes, but I'd like to be able to demo the grid pages, etc.
 
In the RadGrid1_NeedDataSource() method,  I use

dt = info.GetData(); //dt is a DataTable.

 

RadGrid1.DataSource = dt; (where dt is a datatable created from an xml file.)

 
Grid aspx is here:
 
<div id="grid">
<telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="true"
AutoGenerateColumns="False" AllowPaging="True"
OnNeedDataSource="RadGrid1_NeedDataSource" GridLines="None">

<MasterTableView AllowCustomSorting="true" DataKeyNames="BFNumber">
<CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
<Columns>
<telerik:GridBoundColumn SortExpression="Number" HeaderText="Number" DataField="Number" UniqueName="Number"></telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression="Type" HeaderText="Type" DataField="Type" UniqueName="Type"></telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression="Status" HeaderText="Status" DataField="Status"></telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression="Description" HeaderText="Description" DataField="Description"></telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression="CreatedDate" HeaderText="Created Date" DataField="CreatedDate"></telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression="ClosedDate" HeaderText="Closed Date" DataField="ClosedDate"></telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression="AssignedDate" HeaderText="Assigned Date" DataField="AssignedDate"></telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression="AssignedTo" HeaderText="AssignedTo" DataField="AssignedTo"></telerik:GridBoundColumn>
</Columns>
</MasterTableView>
<PagerStyle Mode="NumericPages" />
</telerik:RadGrid>
</div>
 
But no column ever gets sorted (the down arrow and up arrow gets displayed, so it is supposedly setup to sort), so I must have done something wrong.  I tried just creating a new telerik project, and used an MS Access database as the datasource, and sorting was working fine.  

 
Thanks.

 

 

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Chris @ Intrinsic
Top achievements
Rank 1
Share this question
or