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

Sorting Issue

3 Answers 68 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Itl
Top achievements
Rank 1
Itl asked on 21 Apr 2011, 05:07 PM
Hi all,

I have very strange issue, can some one enlighten me what can be the reason?
Here is brief description of what going on:
  1. RadGrid binded to List<WorkstationInfo> where Workstation is simple class
  2. binding happen in NeedDataSource event
  3. In SortCommand, I perform custom sorting.

 var sortExpr = new GridSortExpression();
                switch (e.OldSortOrder)
                {
                    case GridSortOrder.None:
                        sortExpr.FieldName = e.SortExpression;
                        sortExpr.SortOrder = GridSortOrder.Descending;


                        e.Item.OwnerTableView.SortExpressions.AddSortExpression( sortExpr );
                        break;
                    case GridSortOrder.Ascending:
                        sortExpr.FieldName = e.SortExpression;
                        sortExpr.SortOrder = gridWorkstationStatus.MasterTableView.AllowNaturalSort ? GridSortOrder.None : GridSortOrder.Descending;
                        e.Item.OwnerTableView.SortExpressions.AddSortExpression( sortExpr );
                        break;
                    case GridSortOrder.Descending:
                        sortExpr.FieldName = e.SortExpression;
                        sortExpr.SortOrder = GridSortOrder.Ascending;


                        e.Item.OwnerTableView.SortExpressions.AddSortExpression( sortExpr );
                        break;
                }


                e.Canceled = true;
                gridWorkstationStatus.Rebind();

All works fine first to clicks on any columns, then it stop working. To continue sort, the mouse should be clicked on logo or on already existed sort image button, but when other column is clicked, nothing happen - the post-back event not fired and no events called on server.

It's work fine on chrome, but on IE 8,9 it is have this issue.

Here is aspx page code:
<%@ Page Title="" Language="C#" MasterPageFile="~/TreePartMaster.Master" AutoEventWireup="true"
    Async="true" CodeBehind="LabInfo.aspx.cs" Inherits="Intel.Diamond.Web.Views.Monitor.SegmentView" %>


<asp:Content ID="Header" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Body" ContentPlaceHolderID="MainContent" runat="server">
    <telerik:RadGrid ID="gridWorkstationStatus" runat="server" AutoGenerateColumns="False"
        GridLines="None" AllowSorting="True" 
        GroupingEnabled="False" 
            onneeddatasource="gridWorkstationStatus_NeedDataSource" 
            onsortcommand="gridWorkstationStatus_SortCommand">
        <MasterTableView PageSize="30">
            <CommandItemSettings ExportToPdfText="Export to Pdf" 
                ShowAddNewRecordButton="False"></CommandItemSettings>
            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                <HeaderStyle Width="20px"></HeaderStyle>
            </RowIndicatorColumn>
            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                <HeaderStyle Width="20px"></HeaderStyle>
            </ExpandCollapseColumn>
            <Columns>
                <telerik:GridBoundColumn DataField="SegmentId" DataType="System.Int32" FilterControlAltText="Filter SegmentId column"
                    HeaderText="SegmentId" SortExpression="SegmentId" UniqueName="SegmentId" 
                    Visible="False">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="WorkstationTypeId" DataType="System.Int32" FilterControlAltText="Filter WorkstationTypeId column"
                    HeaderText="WorkstationTypeId" SortExpression="WorkstationTypeId" 
                    UniqueName="WorkstationTypeId" Visible="False">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="WorkStationStatus" FilterControlAltText="Filter WorkStationStatus column"
                    HeaderText="Workstation Status" SortExpression="WorkStationStatus" 
                    UniqueName="WorkStationStatus">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="WorkStationName" FilterControlAltText="Filter WorkStationName column"
                    HeaderText="Workstation" SortExpression="WorkStationName" 
                    UniqueName="WorkStationName">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="WorkstationType" FilterControlAltText="Filter WorkstationType column"
                    HeaderText="Workstation Type" SortExpression="WorkstationType" 
                    UniqueName="WorkstationType">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="HITManagerVersion" FilterControlAltText="Filter HITManagerVersion column"
                    HeaderText="HIT Version" SortExpression="HITManagerVersion" 
                    UniqueName="HITManagerVersion">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="IMVersion" FilterControlAltText="Filter IMVersion column"
                    HeaderText="IM Version" SortExpression="IMVersion" UniqueName="IMVersion">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="DriverVersion" FilterControlAltText="Filter DriverVersion column"
                    HeaderText="Driver Version" SortExpression="DriverVersion" 
                    UniqueName="DriverVersion">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="CableLossLastUpdated" FilterControlAltText="Filter CableLossLastUpdated column"
                    HeaderText="CableLoss Modified" SortExpression="CableLossLastUpdated" 
                    UniqueName="CableLossLastUpdated">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="HitManagerStatus" FilterControlAltText="Filter HitManagerStatus column"
                    HeaderText="HIT Status" SortExpression="HitManagerStatus" 
                    UniqueName="HitManagerStatus">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="LastUpdated" FilterControlAltText="Filter LastUpdated column"
                    HeaderText="Last Updated" SortExpression="LastUpdated" 
                    UniqueName="LastUpdated">
                </telerik:GridBoundColumn>
            </Columns>
            <EditFormSettings>
                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                </EditColumn>
            </EditFormSettings>
            <HeaderStyle Wrap="False" />
        </MasterTableView>
        <HeaderStyle Wrap="False" />
        <FilterMenu EnableImageSprites="False">
        </FilterMenu>
        <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
        </HeaderContextMenu>
    </telerik:RadGrid>
    <telerik:RadAjaxManagerProxy ID="LabMonitorAjaxManagerProxy" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="gridWorkstationStatus">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="gridWorkstationStatus" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
</asp:Content>



3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 27 Apr 2011, 10:23 AM
Hello George,

It would be hard to guess the problem by examining your code. This is why I created a simple demo based on your code-snippet. Please test it locally and let me know whether it works as expected.

Regards,
Daniel
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Itl
Top achievements
Rank 1
answered on 27 Apr 2011, 11:48 AM
Hi,

I still checking this issue, but it look like I understand the reason. When using IE 9 while IE running using Document Mode: IE8 standards this behaviour occurs, but when it setted up correctly, it works fine.

Thanks
  George S.
0
Daniel
Telerik team
answered on 03 May 2011, 01:12 PM
Hello George,

Still, this seems strange to me. I would gladly help you sort that issue out if you can isolate it in a simple, runnable project.

Regards,
Daniel
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
Itl
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Itl
Top achievements
Rank 1
Share this question
or