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

RadGrid - Group Panel

1 Answer 151 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 07 Nov 2012, 11:52 AM
Hi,
I am trying to use the show group panel, allowing a user to drag the column names into it, however it keeps throwing an error:

"Error: Sys.WebForms.PageRequestManagerServerErrorException: Invalid group by expression: 'Group By' clause missing"

However if I define an item in the configuration manager it works, properly, So why can't I drag and Drop? :(
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowPaging="True"
            AllowSorting="True" AutoGenerateColumns="False" EnableAJAX="True" GridLines="None"
            OnRowDataBound="NamesGridView_RowDataBound" PageSize="14"
            DataKeyNames="OrderId" ShowGroupPanel="True" CellSpacing="0">
            <GroupingSettings ShowUnGroupButton="True" />
            <ClientSettings AllowDragToGroup="True" AllowColumnsReorder="True"
                ReorderColumnsOnClient="True">
<Selecting AllowRowSelect="True"></Selecting>
 
                <ClientEvents OnRowMouseOver="RowMouseOver"></ClientEvents>
            </ClientSettings>
            <MasterTableView CommandItemDisplay="Top" ClientDataKeyNames="OrderID, Text" DataKeyNames="OrderID">
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
                <RowIndicatorColumn Visible="False">
                    <HeaderStyle Width="20px" />
                </RowIndicatorColumn>
                <ExpandCollapseColumn Resizable="False" Visible="False">
                    <HeaderStyle Width="20px" />
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridTemplateColumn AllowFiltering="false" UniqueName="TemplateEditColumn">
                        <ItemTemplate>
                            <asp:HyperLink ID="EditLink" runat="server" Text="Edit"></asp:HyperLink>
                        </ItemTemplate>
                        <FooterStyle Width="32px" />
                        <HeaderStyle Width="32px" />
                        <ItemStyle Width="32px" />
                    </telerik:GridTemplateColumn>
                    <telerik:GridBoundColumn DataField="OrderId" GroupByExpression="OrderID" HeaderText="Order Ref"
                        SortExpression="OrderId" UniqueName="OrderId" Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="OrderNum" GroupByExpression="OrderNum" HeaderText="Order Number"
                        SortExpression="OrderNum" UniqueName="OrderNum" Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="ProjectRef" HeaderText="Project" UniqueName="ProjectRef"
                        SortExpression="ProjectRef" GroupByExpression="ProjectRef">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Location" HeaderText="Location" UniqueName="Location"
                        SortExpression="Location" GroupByExpression="Location">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="CostCentre" HeaderText="Cost Centre" UniqueName="CostCentre"
                        SortExpression="CostCentre" GroupByExpression="CostCentre">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="AccountCode" HeaderText="Account Code" UniqueName="AccountCode"
                        SortExpression="AccountCode" GroupByExpression="AccountCode">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="activityRef" HeaderText="Order Activity" UniqueName="activityRef"
                        SortExpression="activityRef" GroupByExpression="activityRef">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="CategoryRef" HeaderText="Type of Work" UniqueName="CategoryRef"
                        SortExpression="CategoryRef" GroupByExpression="CategoryRef">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Order Date" HeaderText="Order Date" UniqueName="OrderDate"
                        SortExpression="Order Date" GroupByExpression="Order Date">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Plan Date" HeaderText="Target Complete" UniqueName="TargetComplete"
                        SortExpression="Plan Date" GroupByExpression="Plan Date">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Actual Date" HeaderText="Actual Complete" UniqueName="ActualComplete"
                        SortExpression="Actual Date" GroupByExpression="Actual Date">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Amount" HeaderText="Estimated Cost" UniqueName="EstimatedCost"
                        SortExpression="Amount" GroupByExpression="Amount">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="ServiceProvider" HeaderText="Service Provider"
                        UniqueName="ServiceProvider" SortExpression="ServiceProvider" GroupByExpression="ServiceProvider"
                        Visible="false">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Text" HeaderText="Text" UniqueName="Text" Display="false">
                    </telerik:GridBoundColumn>
                </Columns>
 
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
                <CommandItemTemplate>
                    <table style="width: 100%;">
                        <tr>
                            <td style="width: 50%;">
                                <a href="#" onclick="return ShowInsertForm();">
                                    <img alt="Insert" border="0" height="20" src="App_Images/AddRecord.gif" width="20" />
                                    Add New Record</a>
                            </td>
                            <td align="right" style="width: 50%">
                                <asp:CheckBox ID="chkArchived" runat="server" AutoPostBack="True" OnCheckedChanged="chkShowArchived_CheckChanged"
                                    Text="Show Archived" Width="163px" />
                            </td>
                            <td align="right" style="width: 50%">
                                <asp:CheckBox ID="chkComplete" runat="server" AutoPostBack="True" OnCheckedChanged="chkShowComplete_CheckChanged"
                                    Text="Show Completed" Width="163px" />
                            </td>
                        </tr>
                    </table>
                </CommandItemTemplate>
            </MasterTableView>
            <GroupPanel Visible="True">
            </GroupPanel>
                        <ClientSettings AllowDragToGroup="True" Selecting-AllowRowSelect="true">
            </ClientSettings>
            <PagerStyle Mode="NextPrevNumericAndAdvanced" />
 
<FilterMenu EnableImageSprites="False"></FilterMenu>
        </telerik:RadGrid>
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Animation="None"
            Behaviors="Default" InitialBehaviors="None" Left="" Top="" ReloadOnShow="True"
            VisibleStatusbar="false">
        </telerik:RadWindowManager>
    </div>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadSlider1" />
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    </form>
</body>
</html>

I can't see any errors myself and it all works fine on the page except this group panel,
Many thanks for your help
Ryan

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 08 Nov 2012, 03:42 AM
Hi Ryan,

Try removing the GroupByExpression property from the GridBoundColumns.If GroupByExpression is not set explicitly, RadGrid will generate a group expression based on the DataField of the column (if available), using the GridColumn.GetDefaultGroupByExpression method.
 
Thanks,
Shinu.
Tags
Grid
Asked by
Ryan
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or