Hi,
I have a radgrid, and set it as :
QuotationLines.MasterTableView.GroupLoadMode = GridGroupLoadMode.Client
It performance better than GridGroupLoadMode.Server, it is good.
And now I want to let the interface can remenber the status of group. (It means remember which group is in expanding, which is in Collaping).
Then I set two client event to add or remove the group id from hidden filed. So that server side will know the group status from the hidden field.
My question is how to get group id from sender or eventArgs. (I've reader the help doc from telerik, but didn't find the answer...)
Aspx:
| <telerik:RadScriptBlock> |
| function OnGroupExpanding(sender, eventArgs) { |
| //How to put the current group code into hidden filed |
| } |
| function OnGroupCollapsing(sender, eventArgs) { |
| //How to remove the current group code from hidden field |
| } |
| </telerik:RadScriptBlock> |
| <asp:HiddenField ID="hidExpandGroupKeys" runat="server" /> |
| <telerik:RadGrid runat="server" ID="ItemsList"> |
| <MasterTableView DataKeyNames="code"> |
| <GroupByExpressions> |
| <telerik:GridGroupByExpression> |
| <GroupByFields> |
| <telerik:GridGroupByField FieldName="SubGroupCode"></telerik:GridGroupByField> |
| </GroupByFields> |
| </telerik:GridGroupByExpression> |
| </GroupByExpressions> |
| <Columns> |
| <telerik:GridBoundColumn DataField="code"> </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="SubGroupCode"> </telerik:GridBoundColumn> |
| </Columns> |
| </MasterTableView> |
| <ClientSettings> |
| <ClientEvents OnGroupCollapsing="OnGroupCollapsing" OnGroupExpanding="OnGroupExpanding" /> |
| </ClientSettings> |
| </telerik:RadGrid> |
May be my question is not very clear...
Hope the telerik support can help me, many thanks in advance.
In the code-behind in the grid_ItemDataBound event I have this code to hide a particular GridGroupHeaderItem. Now I want to show it later in the client-side based on some condition. I can't figure out how to do this please help.
if
(e.Item is GridGroupHeaderItem)
{
GridGroupHeaderItem groupHeaderItem = (GridGroupHeaderItem)e.Item;
DataRowView groupDataRow = (DataRowView)e.Item.DataItem;
if (String.IsNullOrEmpty(groupDataRow["TRCategoryLabel"].ToString()))
{
groupHeaderItem.Display =
false;
}
else
{
if (groupDataRow["TRCategoryLabel"].ToString() == "OnCall Time Worked")
groupHeaderItem.Display =
false;
else
groupHeaderItem.DataCell.Text =
"<b>" + groupDataRow["TRCategoryLabel"].ToString() + "</b>";
}
Thanks,
Bernard