Hello!
I am hoping for whatever column header i click to then be sorted (Asc,Des,None)
Currently this works on the first header click, but then after selecting a different column, the wrong header is sorted!
Here is my click order:
Click Col 1, Col 1 sorts.
Click Col 2, Col 3 sorts.
Click Col 2, Col 2 sorts.
Click Col 3, Col 4 sorts.
Click Col 3, Col 3 sorts.
Click Col 1, Col 1 sorts!
Any tips on what might be happening would be great! I have a feeling it may be related to my binding causing a loss of header order?
C#:
ASPX:
I am hoping for whatever column header i click to then be sorted (Asc,Des,None)
Currently this works on the first header click, but then after selecting a different column, the wrong header is sorted!
Here is my click order:
Click Col 1, Col 1 sorts.
Click Col 2, Col 3 sorts.
Click Col 2, Col 2 sorts.
Click Col 3, Col 4 sorts.
Click Col 3, Col 3 sorts.
Click Col 1, Col 1 sorts!
Any tips on what might be happening would be great! I have a feeling it may be related to my binding causing a loss of header order?
C#:
protected void Page_Init(object sender, EventArgs e) { if (IsPostBack) { pogrid.DataSource = null; pogrid.Rebind(); } else { //... set filteredPOList pogrid.DataSource = null; pogrid.Rebind();public void Selection_Changed(object sender, EventArgs e) { //... } protected void Grid_NeedDataSource(object source, GridNeedDataSourceEventArgs e) { pogrid.DataSource = filteredPOList; }ASPX:
<telerik:RadGrid ID="pogrid" runat="server" EnableViewState="true" AutoGenerateColumns="False" OnNeedDataSource="Grid_NeedDataSource" AllowFilteringByColumn="True" AllowSorting="True"ViewStateMode="Enabled" CellSpacing="0" OnSelectedIndexChanged="Selection_Changed" GridLines="None" > <GroupingSettings CaseSensitive="false" /> <ClientSettings EnableRowHoverStyle="True"> <Selecting AllowRowSelect="True" ></Selecting> <Scrolling UseStaticHeaders="True" AllowScroll="True" SaveScrollPosition="True" ScrollHeight="300px"> </Scrolling> <Resizing AllowColumnResize="True"></Resizing> </ClientSettings> <MasterTableView DataKeyNames="poId"> <Columns> <telerik:GridBoundColumn HeaderStyle-Width="20%" HeaderStyle-Font-Bold="true" HeaderText="Promotion Number" UniqueName="PromotionNumber" DataField="PromotionNumber" SortExpression="PromotionNumber" FilterDelay="2000" CurrentFilterFunction="StartsWith" FilterControlWidth="80%" ></telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderStyle-Width="40%" HeaderStyle-Font-Bold="true" HeaderText="Promotion Name" UniqueName="PromotionName" DataField="PromotionName" SortExpression="PromotionName" FilterDelay="2000" CurrentFilterFunction="Contains" FilterControlWidth="80%" ></telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderStyle-Width="20%" HeaderStyle-Font-Bold="true" HeaderText="Pep Contact" UniqueName="PepContact" DataField="PepContact" SortExpression="PepContact" FilterDelay="2000" CurrentFilterFunction="Contains" FilterControlWidth="80%" ></telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderStyle-Width="20%" HeaderStyle-Font-Bold="true" HeaderText="PO Name" UniqueName="POName" DataField="POName" SortExpression="POName" FilterDelay="2000" CurrentFilterFunction="Contains" FilterControlWidth="80%" ></telerik:GridBoundColumn> </Columns> </MasterTableView> </telerik:RadGrid>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<ajaxsettings>
<telerik:AjaxSetting AjaxControlID="pogrid">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="pogrid" LoadingPanelID="RadAjaxLoadingPanel1">
</telerik:AjaxUpdatedControl>
</UpdatedControls>
</telerik:AjaxSetting>
</ajaxsettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
</telerik:RadAjaxLoadingPanel>