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

[Solved] Show/Hide DetailTables via CheckBoxList

1 Answer 142 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Stas
Top achievements
Rank 2
Stas asked on 17 Mar 2008, 05:15 AM

Hi

I have a Hierarchical grid.

Master
-detail1
--detail12
-detail2
-detail3
-detail4
--detail41

How I can bind a CheckBoxList to the fist level of the detail tables (detail1, detail2, detail3, detail4) and then show/hide the detail tables via Postback depending on the selected Items of the CheckBoxList.

I need something simular that I have done for the Columns in MasterTable (please see code below), but unfortunatly I can not make that for the details tables.

Thank you for your product and support.

protected void RadGridStudent_PreRender(object sender, EventArgs e)
    {
        CheckBoxListColumns1.Items.Clear();
        for (int i = 3; i < RadGridStudent.MasterTableView.Columns.Count; i++)
        {
            ListItem myItem = new ListItem();
            if (!String.IsNullOrEmpty(RadGridStudent.MasterTableView.Columns[i].HeaderText))
            {
                myItem.Selected = RadGridStudent.MasterTableView.Columns[i].Display;
                myItem.Text = RadGridStudent.MasterTableView.Columns[i].HeaderText;
                myItem.Value = i.ToString();
                CheckBoxListColumns1.Items.Add(myItem);
            }
        }
    }

 Search words: GridNestedViewItem , DetailTables, Visible

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 18 Mar 2008, 09:42 AM
Hi Stas,

To see more information on the requested functionality, refer to the following topic.
It contains additional information on how to reference the nested child tables, and hence have a chance to hide it accordingly.

Sincerely yours,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
Stas
Top achievements
Rank 2
Answers by
Yavor
Telerik team
Share this question
or