I'm having some difficulties implemention a grid regroup based on user's selection in a dropdown control.
Basically, I'll like my users to select "group by Agency" or "by client" based on the selection the make in a dropdown box.
in my dropdown event handler, I'll like to change the grouping. the default group is by Agency.
below is my grid structure.
/*************************************/
<telerik:radgrid id="gridWorks"
DataSourceID="getWorks"
runat="server"
ShowStatusBar="true"
gridlines="Horizontal"
skin="WebBlue"
AllowSorting="true"
ShowGroupPanel="false"
AutoGenerateColumns="false"
OnUpdateCommand="gridWorks_UpdateCommand"
OnDeleteCommand="gridWorks_DeleteCommand"
OnInsertCommand="gridWorks_InsertCommand"
PageSize="50" AllowAutomaticDeletes="True" OnItemCommand="gridWorks_ItemCommand" >
<MasterTableView GroupLoadMode="Client" CommandItemDisplay="TopAndBottom" DataKeyNames="workID,Title" AllowPaging="True" AllowSorting="False" DataSourceID="getWorks">
<Columns>
<telerik:GridBoundColumn DataField="Title" HeaderText="Title" ReadOnly="True" SortExpression="Agency" UniqueName="Title"/>
<telerik:GridBoundColumn DataField="Client" HeaderText="Client" ReadOnly="True" SortExpression="client" UniqueName="Client"/>
<telerik:GridBoundColumn DataField="SiteStatus" HeaderText="Site Status" ReadOnly="True" UniqueName="SiteStatus"/>
<telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Update" ImageUrl="../Images/ICEdit.gif" HeaderText="Edit" UniqueName="column" />
<telerik:GridButtonColumn ConfirmText="Are you sure you want to delete this Work?\n Items are none recoverable once deleted!" HeaderText="Delete" CommandName="Delete" ButtonType="ImageButton" ImageUrl="../Images/ICTrash.gif" Text="Delete" UniqueName="Delete"/>
<telerik:GridBoundColumn DataField="Modified" HeaderText="Last Modified" ReadOnly="True" UniqueName="Last Modified"/>
</Columns>
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<GroupByExpressions>
<telerik:GridGroupByExpression>
<SelectFields>
<telerik:GridGroupByField FieldName="Agency" FieldAlias="Agency" />
</SelectFields>
<GroupByFields>
<telerik:GridGroupByField FieldName="Agency" FieldAlias="Agency"/>
</GroupByFields>
</telerik:GridGroupByExpression>
</GroupByExpressions>
/********************/
your help is much appreciated.
-roland