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

Apply Group By at startup.

4 Answers 116 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Niraj
Top achievements
Rank 1
Niraj asked on 06 Jan 2011, 12:02 PM
Hi,
Is it possible to apply group by at start up using code behind.?
I also would like to hide the column from the mastertableview if it is used for grouping.
Can anyone help me out with this...?
I am not creating RadGrid dynamically(AutoGenerateColumns=false) . I want to group by the columns that are in my mastertable. Basically i want
to bring the desired group by view on startup , without client requiring to drag the columns at runtime.
Thanks and Regards,
Niraj Khose

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 06 Jan 2011, 12:28 PM
Hello Niraj,

Please go through the following documentation which shows how to set Group by Expression from code behind.
Programmatic definition

And you can hide the column from code behind using its ColumnUniqueName.
C#:
RadGrid1.MasterTableView.GetColumn("Columnname").Visible = false;

Thanks,
Princy.
0
Niraj
Top achievements
Rank 1
answered on 07 Jan 2011, 04:13 AM
Princy,
I had seen that example. But I have my columns already on the grid. Basically I want to reduce the client effort of dragging certain grouping columns(which might be very frequent), and just on startup itself show the grouping on these columns.
Regards,
Niraj Khose
0
Accepted
Princy
Top achievements
Rank 2
answered on 07 Jan 2011, 07:32 AM
Hello Niraj,

Please take a look at the following documentation in which it set the Group By expression at startup.
Declarative definition
You can also do it from code behind like in this documentation.
Programmatic definition

Thanks,
Princy.
0
Niraj
Top achievements
Rank 1
answered on 07 Jan 2011, 10:21 AM
Hi Princy,

Thanks a lot. It worked just fine. I dont know why did'nt the code behind approach worked for me. But the ASP worked. 

Regards,
Niraj Khose
Tags
Grid
Asked by
Niraj
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Niraj
Top achievements
Rank 1
Share this question
or