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

Too many spaces in field definition

2 Answers 125 Views
Grid
This is a migrated thread and some comments may be shown as answers.
digitall
Top achievements
Rank 1
digitall asked on 28 Oct 2011, 05:21 AM
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 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 28 Oct 2011, 05:49 AM
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.
0
digitall
Top achievements
Rank 1
answered on 28 Oct 2011, 05:55 AM
I always get it confused as to what can/can't be where with the GroupByExpression's. Thanks for the help!
Tags
Grid
Asked by
digitall
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
digitall
Top achievements
Rank 1
Share this question
or