Too many spaces in field definition

3 posts, 1 answers
  1. digitall
    digitall avatar
    169 posts
    Member since:
    Jun 2006

    Posted 28 Oct 2011 Link to this post

    I am using the latest version of RadControls (2011.2.712.40) and am running into a confusing issue. I have a grid defined with a GroupByExpression like so:
    <GroupByExpressions>
        <telerik:GridGroupByExpression>
            <GroupByFields>
                <telerik:GridGroupByField FieldAlias="Status" FieldName="RealStatus" SortOrder="Descending" />
            </GroupByFields>
            <SelectFields>
                <telerik:GridGroupByField FieldAlias="Status" FieldName="RealStatus" />
            </SelectFields>
        </telerik:GridGroupByExpression>
    </GroupByExpressions>

    When the page loads the grid looks exactly how I want it to, however when I hit the "Add" link (auto-generated in the Command header along with a Refresh link) I get "Too many spaces in field definition: ' RealStatus Status DESC'."

    Since the page initially loads fine and only postbacks cause it to die I have no clue what could cause this. If I don't have the SortOrder specified postbacks function as expected (albeit in the wrong order) which is even more confusing.

    Any ideas?
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 28 Oct 2011 Link to this post

    Hello,

    The GroupBYExpressions should be as follows. Only the GroupByFields declaration can contain SortOrder. Respectively, only for the SelectFields should be set Alias.
    aspx:
    <GroupByExpressions>
        <telerik:GridGroupByExpression>
            <GroupByFields>
                <telerik:GridGroupByField  FieldName="RealStatus" SortOrder="Descending" />
            </GroupByFields>
            <SelectFields>
                <telerik:GridGroupByField FieldAlias="Status" FieldName="RealStatus" />
            </SelectFields>
        </telerik:GridGroupByExpression>
    </GroupByExpressions>

    Also check the following documentation which contains the information about the group by expression syntax.
    Declarative Definition.

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. digitall
    digitall avatar
    169 posts
    Member since:
    Jun 2006

    Posted 28 Oct 2011 Link to this post

    I always get it confused as to what can/can't be where with the GroupByExpression's. Thanks for the help!
Back to Top