5 posts, 0 answers
  1. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 07 Mar 2012 Link to this post

    I'm persisting the GroupBy expressions for a grid. The grouping is set by the end-user.

    I have a problem in that I have a column like this...
    <telerik:GridTemplateColumn HeaderText="Template"

    Now, when I save the GroupBy expression, I save the value returned by the GroupByExpression's .Expression property.

    When I try adding that that as a new GroupByExpression when the user revisits the page, the GroupBy header displays "Name" rather than the column's defined HeadterText of "Template".

    Now, I did try serializing the whole of the GroupByExpression, but when I tried deserializing it to recreate the object, it complained that Only Field object can be in the Frieds collection, or something like that.

    So, to the question. How can I serialize the GroupByExpression so that I can recreate the grouping with a) the correct field and b) the correct header text for the item in the GroupBy area of the grid?

  2. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 09 Mar 2012 Link to this post

    The more I think about this, more more convinced I am that the underlying problem is that there's a bug, so I've raised a support ticket.

  3. Pavlina
    Pavlina avatar
    6162 posts

    Posted 12 Mar 2012 Link to this post

    Hello, Stuart

    i already answered your support ticket with the same question and to avoid duplicate posts I will ask you to continue our communication there. Thank you for your understanding in advance.

    All the best,
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  4. rajat
    rajat avatar
    2 posts
    Member since:
    Apr 2014

    Posted 16 May 2014 Link to this post

    Is there a way to set some "PageSize" property according the number of "Groups" in a RadGrid with grouping?  

    we are using <GroupByExpressions> 

    For example : Please check the attachment , in this we have 3 parents and now we set the page size to 2 then we need 2 pages and bottom right corner of the pager should display "Items 1 to 2 of 3"


    <telerik:RadGrid ID="RadGrid1"  runat="server"  
            AllowSorting="True" AllowMultiRowSelection="true" AllowPaging="true" ShowGroupPanel="false"  HorizontalAlign="Left"
            AutoGenerateColumns="False" GridLines="None">
             <PagerStyle Mode="NextPrevAndNumeric"   PagerTextFormat="Change page: {4} Items {2} to {3} of {5}" 
                                                                        AlwaysVisible="true" />
            <MasterTableView AllowMultiColumnSorting="true"  GroupHeaderItemStyle-HorizontalAlign="Left">
            <HeaderStyle CssClass ="rgHeader" /> 
                    <telerik:GridBoundColumn SortExpression="FieldName" HeaderText="Field Name" ItemStyle-HorizontalAlign="left" 
                        HeaderButtonType="TextButton" DataField="FieldName">
                    <telerik:GridBoundColumn SortExpression="From" HeaderText="From" ItemStyle-HorizontalAlign="Left"
                        HeaderButtonType="TextButton" DataField="From">
                    <telerik:GridBoundColumn SortExpression="To" HeaderText="To" ItemStyle-HorizontalAlign="Left"
                        HeaderButtonType="TextButton" DataField="To">
                            <telerik:GridGroupByField  HeaderText="Change" FieldName="ParentHeader" HeaderValueSeparator=" Date: "></telerik:GridGroupByField>
                            <telerik:GridGroupByField FieldName="datefind"   SortOrder="Descending"></telerik:GridGroupByField>
            <ClientSettings   ReorderColumnsOnClient="false" AllowDragToGroup="false" AllowColumnsReorder="false">
                <Selecting   AllowRowSelect="false"></Selecting>
                <Resizing   AllowRowResize="true"  AllowColumnResize="true" EnableRealTimeResize="false"
            <GroupingSettings     ShowUnGroupButton="false"  CaseSensitive="false" ></GroupingSettings>

    Please help as this is critical.
  5. Pavlina
    Pavlina avatar
    6162 posts

    Posted 21 May 2014 Link to this post

    Hello Rajat,

    In general you can set RadGrid PageSize to whatever value you need. However in current page RadGrid will show only page size GridDataItems regardless whether grouping is applied or not. You can check following example Grid Grouping . If you need to set PageSize to the number of the groups you should manually calculate the groups that will be formed.


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top