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

Multiple Sorting of Hierarchy rad grid

4 Answers 98 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mugdha Aditya
Top achievements
Rank 1
Mugdha Aditya asked on 12 Apr 2010, 05:32 PM
Hello,

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

Sort by
0
Mugdha Aditya
Top achievements
Rank 1
answered on 13 Apr 2010, 08:06 AM
Hello... actually i have done wt single sorting but its not working for multiple sorting of column.
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();

}

}

 

0
Iana Tsolova
Telerik team
answered on 15 Apr 2010, 03:12 PM
Hello Mugdha,

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.
0
Mugdha Aditya
Top achievements
Rank 1
answered on 16 Apr 2010, 07:06 AM
yes sir i have already did that
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.
0
Iana Tsolova
Telerik team
answered on 19 Apr 2010, 01:24 PM
Hi Mugdha,

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.
Tags
Grid
Asked by
Mugdha Aditya
Top achievements
Rank 1
Answers by
Mugdha Aditya
Top achievements
Rank 1
Iana Tsolova
Telerik team
Share this question
or