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

Hiding grids not in use

2 Answers 74 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Elliott
Top achievements
Rank 2
Elliott asked on 15 Sep 2011, 08:14 PM
i am writing a page with 3 Telerik grids
only one of them should be visible at any time, depending on the value of a radio button
do I make the other 2 grids Visible=false or do I set the data source to a null dataset and rebind - or both
looking for best practices here
thanks

2 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 16 Sep 2011, 01:02 PM
Hello,

Please check below code snippet.

If this is not your case then elaborate your scenario.

protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (RadioButtonList1.SelectedValue == "A")
        {
            RadGridA.Visible = true;
            RadGridB.Visible = false;
            RadGridC.Visible = false;
            RadGridA.Rebind(); // write this line if you bind data based on conditionally
        }
        else if (RadioButtonList1.SelectedValue == "B")
        {
            RadGridA.Visible = false;
            RadGridB.Visible = true;
            RadGridC.Visible = false;
            RadGridB.Rebind();// write this line if you bind data based on conditionally
        }
        else if (RadioButtonList1.SelectedValue == "C")
        {
            RadGridA.Visible = false;
            RadGridB.Visible = false;
            RadGridC.Visible = true;
            RadGridC.Rebind();// write this line if you bind data based on conditionally
        }
    }

the best way is set visibility of other grids.


Thanks,
Jayesh Goyani
0
Elliott
Top achievements
Rank 2
answered on 19 Sep 2011, 07:50 PM
thanks Jayesh
I used RADButtons so I had 3 event handlers but got the general idea
most importantly, page stop crashing
Tags
Grid
Asked by
Elliott
Top achievements
Rank 2
Answers by
Jayesh Goyani
Top achievements
Rank 2
Elliott
Top achievements
Rank 2
Share this question
or