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

Grouping with OnNeedDatasource and space in column names error

1 Answer 61 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Yeroon
Top achievements
Rank 2
Yeroon asked on 01 Sep 2010, 10:22 AM
Hello,

Using the 3.5 assemblie Q2 2010.

When I have a grid who gets its data from the onneeddatasource event and any of my columns has space in the name the grouping won't work.

When I try to group on the column: Leading Country,  the error message will be:

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Field Leading not found in the source table. Please check the expression syntax.

I don't really want to replace spaces with underscores to solve this. Is there anything I am missing here?

Below my code:

ASPX:
<telerik:RadAjaxPanel ID="rap" runat="server" Width="90%">
    <telerik:RadGrid ID="rg" runat="server" AllowAutomaticInserts="false" Skin="Office2007"
        AllowFilteringByColumn="True" GroupingEnabled="true" EnableViewState="true" AllowPaging="True"
        AllowSorting="True" AutoGenerateColumns="True" GridLines="None" ShowStatusBar="True"
        OnNeedDataSource="rg_NeedDataSource" EnableLinqExpressions="true" PageSize="20"
        Width="97%" ShowGroupPanel="true" OnColumnCreated="rg_ColCreated">
        <MasterTableView EnableNoRecordsTemplate="true" CellSpacing="-1" CommandItemDisplay="None"
            AllowMultiColumnSorting="true" PagerStyle-Position="Bottom" PagerStyle-Mode="NextPrevAndNumeric"
            ClientDataKeyNames="oid" DataKeyNames="oid">
            <NoRecordsTemplate>
                <div>
                    Geen items gevonden.</div>
            </NoRecordsTemplate>
            <Columns>
            </Columns>
        </MasterTableView>
        <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True" ReorderColumnsOnClient="True">
            <Selecting AllowRowSelect="True" />
            <Scrolling AllowScroll="True" UseStaticHeaders="True" />
        </ClientSettings>
    </telerik:RadGrid>
</telerik:RadAjaxPanel>




1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 01 Sep 2010, 11:23 AM
Hi Yeroon,

RadGrid grouping works only with unique column names without space. Please check out the following Forum link which discusses the same issue.
http://www.telerik.com/community/forums/aspnet/grid/why-can-t-i-group-by-fields-with-a-space-in-the-field-name.aspx

Best wishes,
Pavlina
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
Tags
Grid
Asked by
Yeroon
Top achievements
Rank 2
Answers by
Pavlina
Telerik team
Share this question
or