ContextMenu does not include sort options

6 posts, 0 answers
  1. toddhd
    toddhd avatar
    21 posts
    Member since:
    Aug 2006

    Posted 10 Nov 2010 Link to this post

    I added context menu to a page on my website, and added EnableHeaderContextMenu="true" to my parameters. But when I right click on the grid, the menu does not show any sorting options. I have this same MasterTableView on another page in the site, and it works fine. The two look the same.

    <MasterTableView Width="100%" TableLayout="Auto" NoMasterRecordsText="No Items Found"
        AllowAutomaticInserts="false" AllowMultiColumnSorting="false" AutoGenerateColumns="false" EnableHeaderContextMenu="true"
        AllowPaging="true" PageSize="20" AllowSorting="true" DataKeyNames="OrderID"
        CommandItemSettings-RefreshText="Refresh List" CommandItemDisplay="Top" PagerStyle-Position="TopAndBottom"
        CommandItemSettings-ShowAddNewRecordButton="false">

    The only functional difference on this page is that the grid is not initially loaded with data. It is a search page. However, even once a search is performed and data is in the grid, there are no sort options.

    Any ideas?
  2. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 11 Nov 2010 Link to this post

    Hello Todd,

    This behavior is not expected. Could you paste your entire aspx and code behind. Thanks in advance.

    Greetings,
    Tsvetoslav
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. toddhd
    toddhd avatar
    21 posts
    Member since:
    Aug 2006

    Posted 11 Nov 2010 Link to this post

    I'm not opposed to sending you sample of the code, but this is proprietary information and I can't post it on a public board like this. Please let me know how I can send it to you personally.
  4. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 12 Nov 2010 Link to this post

    Hi Todd,

    You can open up a formal support ticket and send your files as an attachment.

    Greetings,
    Tsvetoslav
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Rayne
    Rayne avatar
    261 posts
    Member since:
    Sep 2010

    Posted 08 Mar Link to this post

    This is an old thread, but I am now having the same problem. Sort options do not appear in the HeaderContextMenu. I'm using the latest version .

    Here is my grid markup:

    <telerik:RadGrid runat="server" ID="gridRequests" AutoGenerateColumns="False" FilterType="HeaderContext" OnItemCommand="gridRequests_OnItemCommand" AllowSorting="True">
                    <MasterTableView ItemType="demnbr.Data.Request" SelectMethod="GetRequests" DataKeyNames="RequestId" EnableHeaderContextMenu="True" EnableHeaderContextFilterMenu="True"
                        AllowSorting="True" AllowNaturalSort="True" PageSize="20" AllowPaging="True" IsFilterItemExpanded="False" AllowFilteringByColumn="True">
                        <ItemStyle Wrap="True"></ItemStyle>
                        <PagerStyle AlwaysVisible="True"></PagerStyle>
                        <SortExpressions>
                            <telerik:GridSortExpression FieldName="DateRequested" SortOrder="Descending"/>
                        </SortExpressions>
                        <Columns>
                            <telerik:GridButtonColumn ButtonType="LinkButton" CommandName="EditRequest" Text="" ButtonCssClass="glyphicon glyphicon-pencil" UniqueName="EditRequestButton" EnableHeaderContextMenu="False" />
                            <telerik:GridBoundColumn DataField="RequestId" AllowFiltering="False" Display="False"/>
                            <telerik:GridBoundColumn DataField="DateRequested" DataFormatString="{0:MM/dd/yyyy HH:mm tt}" HeaderText="Date Requested" />
                            <telerik:GridBoundColumn DataField="Requestor.FullName" HeaderText="Requested By" ItemStyle-Wrap="False"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Description" HeaderText="Description" HeaderStyle-Width="300px"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="EstimatedAmount" DataFormatString="{0:C}" HeaderText="Estimated $"/>
                            <telerik:GridBoundColumn DataField="FundCode" HeaderText="Fund Code"/>
                            <telerik:GridBoundColumn DataField="VendorName" HeaderText="Vendor Name"/>
                            <telerik:GridBoundColumn DataField="VendorID" HeaderText="Vendor Tax ID" Display="False"/>
                            <telerik:GridBoundColumn DataField="Status" HeaderText="Status"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="DemNumber" HeaderText="DEM #" ItemStyle-Wrap="False"/>
                            <telerik:GridBoundColumn DataField="Approver.FullName" HeaderText="Approver" Display="False"/>
                            <telerik:GridBoundColumn DataField="DateApproved" HeaderText="Decision Date" DataFormatString="{0:MM/dd/yyyy}" Display="False"/>
                            <telerik:GridBoundColumn DataField="Comments" HeaderText="Notes" Display="False"/>
                            <telerik:GridBoundColumn DataField="TotalPaid" DataFormatString="{0:C}" HeaderText="Total Paid" Display="False"/>
                            <telerik:GridBoundColumn DataField="DatePaid" HeaderText="Date Paid" DataFormatString="{0:MM/dd/yyyy}" Display="False"/>
                        </Columns>
                    </MasterTableView>
                </telerik:RadGrid>

    Even when I remove the sortExpression, it still does not show up. I have verified this in both IE11 and Chrome in Windows 7

  6. Rayne
    Rayne avatar
    261 posts
    Member since:
    Sep 2010

    Posted 08 Mar in reply to Rayne Link to this post

    OK. Apparently it requires AllowSorting="True" to be on the Grid, not just on the MasterTableView. I added that to my code before I posted it above, but didn't realize that was the key to making it work.

    So what is the difference between the Grid and the MasterTableView and when are we supposed to add which properties where?

Back to Top