i have Hierarchy rad grid in my application. as telerik site have eg for the same in demo. (Grid / Hierarchy with Templates ).
on click of expand image it will open another Hierarchy grid... i want to do multiple sorting for the same.
how i will do multiple sorting for nested grid. actually i am not aable to get grid id to bind it in NeedDataSource event.
how i will do the sorting for the same.
please let me knw.
4 Answers, 1 is accepted
it sorts only single colum so whts going wrong ??
my code is
protected void RDGridEstimate_SortCommand(object source, GridSortCommandEventArgs e)
{
RadGrid RDGridEstimate = (RadGrid)((Telerik.Web.UI.RadGrid)(source));
switch (e.OldSortOrder)
{
case GridSortOrder.None:
sortExprEstim.FieldName = e.SortExpression;
sortExprEstim.SortOrder =
GridSortOrder.Ascending;
e.Item.OwnerTableView.SortExpressions.AllowMultiColumnSorting =
true;
e.Item.OwnerTableView.SortExpressions.AddSortExpression(sortExprEstim);
break;
case GridSortOrder.Ascending:
sortExprEstim.FieldName = e.SortExpression;
sortExprEstim.SortOrder =
GridSortOrder.Descending;
e.Item.OwnerTableView.SortExpressions.AllowMultiColumnSorting =
true;
e.Item.OwnerTableView.SortExpressions.AddSortExpression(sortExprEstim);
break;
case GridSortOrder.Descending:
sortExprEstim.FieldName = e.SortExpression;
sortExprEstim.SortOrder =
GridSortOrder.Ascending;
e.Item.OwnerTableView.SortExpressions.AllowMultiColumnSorting =
true;
e.Item.OwnerTableView.SortExpressions.AddSortExpression(sortExprEstim);
break;
}
e.Canceled =
true;
RDGridEstimate.Rebind();
}
protected void RDGridEstimate_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
{
try
{
iInvcoID = (
Int32)ViewState["InvcoID"];
dsEstimate = moAnalystSummaryBL.GetEstimateDetails(iInvcoID);
RadGrid RDGridEstimate = (RadGrid)((Telerik.Web.UI.RadGrid)(source));
if (dsEstimate.Tables[0] != null && dsEstimate.Tables[0].Rows.Count > 0)
{
RDGridEstimate.DataSource = dsEstimate.Tables[0];
}
}
catch (Exception ex)
{
moErrorLog.sErrorMsg = ex.ToString();
moErrorLog.WriteErrorLog();
}
}
Could you please confirm that you set the AllowMultiColumnSorting property of the of the MasterTableView of the inner RadGrid to true?
Best wishes,
Iana
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.
still its not working
actually it shows icon on another column to if click on that but sorting is not done..only soring image appears.
Can you post the grid declaration as well, or send us a sanmple illustrating your scenario and the described issue, so I can debug it locally and see what could have gone wrong there?
Looking forward your reply,
Iana
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.