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

Not order grouping

1 Answer 161 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Frederico Fernandes
Top achievements
Rank 1
Frederico Fernandes asked on 20 Apr 2011, 12:37 PM
Hi,
i have a gouping in radgrid and i don“t want the order he put, its possible to put the same order that came from DB?

this is my code

<telerik:RadGrid ID="gridAreasAndTopic" runat="server" EnableTheming="false" 
OnNeedDataSource="gridAreasAndTopics_NeedDataSource"
 Skin="WebBlue" AutoGenerateColumns="False" ShowFooter="true">
    <MasterTableView AutoGenerateColumns="false" EditMode="InPlace" ShowFooter="True"
                      TableLayout="Auto" GroupLoadMode="Client">
                      <GroupByExpressions>
                           <telerik:GridGroupByExpression>
                                   <SelectFields>
                                        <telerik:GridGroupByField FieldName="areaName" FieldAlias="Area" />
                                  </SelectFields>
                                  <GroupByFields>
                                     <telerik:GridGroupByField FieldName="areaName"></telerik:GridGroupByField>
                                  </GroupByFields>
                             </telerik:GridGroupByExpression>
                       </GroupByExpressions>
              <PagerStyle Mode="NextPrevAndNumeric" />
              <Columns>
             <telerik:GridBoundColumn DataField="idArea" HeaderText="idArea" Visible="false" ItemStyle-Width="0%">
             </telerik:GridBoundColumn>
             <telerik:GridBoundColumn DataField="idTopic" HeaderText="idTopic"  Visible="false" ItemStyle-Width="0%">
             </telerik:GridBoundColumn>
             <telerik:GridBoundColumn DataField="TopicName" Aggregate="Count" HeaderText="TopicName"   ItemStyle-Width="100%">
              </telerik:GridBoundColumn>
              <telerik:GridTemplateColumn>
               <ItemTemplate>
              <asp:ImageButton ImageUrl="~/App_Themes/InsticcLayout/images/box/error.png" runat="server"
                                                                                                        ID="lnkDeleteAreaTopic" Text="Add" OnClick="lnkDeleteAreaTopic_Click" CausesValidation="false">
               </asp:ImageButton>
             </ItemTemplate>
           </telerik:GridTemplateColumn>
</Columns>
<HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Left" />
<FilterItemStyle HorizontalAlign="Center" />
<GroupHeaderItemStyle HorizontalAlign="Left" />
</MasterTableView>
 <ClientSettings AllowGroupExpandCollapse="True">
</ClientSettings>
</telerik:RadGrid>

1 Answer, 1 is accepted

Sort by
0
Accepted
Mira
Telerik team
answered on 25 Apr 2011, 09:43 AM
Hello Frederico,

The resolved data source of the RadGrid is a DataTable. All group by expressions you add to the grid are translated to SQL queries applied to it. The SQL GROUP BY clause always returns the data sorted. That is why the SortOrder property of the GridGroupByField  can be "Ascending" or "Descending" only.

I hope this helps.

Kind regards,
Mira
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
Frederico Fernandes
Top achievements
Rank 1
Answers by
Mira
Telerik team
Share this question
or