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

Find visible column

2 Answers 22 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Anto (DLL Version : 2008.3.1314.35)
Top achievements
Rank 2
Anto (DLL Version : 2008.3.1314.35) asked on 06 Oct 2010, 04:28 AM
Hi EveryBody, 
                         I have a RadGrid with ten Template columns in that only one column is visible at a time.
                         I want find which column is visible in the grid in another User Defined Function(not in any grid events).
                         Any one please give an idea on this.

Thank You
Anto-

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 1
answered on 06 Oct 2010, 05:55 AM
Hello Anto,

One way to accomplish this is iterating through the GridColumn collection and checking for the Visible property as shown below.

C#:
protected void Button3_Click(object sender, EventArgs e)
{
    foreach( GridColumn col in RadGrid1.MasterTableView.Columns )
    {
        if (col.Visible)
        {
            Response.Write(col.UniqueName.ToString()); // Get the Visible column UniqueName
        }
    }
}


-Shinu.
0
Anto (DLL Version : 2008.3.1314.35)
Top achievements
Rank 2
answered on 06 Oct 2010, 06:46 AM
Hi Shinu,
             Thank you for the Reply.
              Its Working Fine.
Thank You
-Anto-
Tags
Grid
Asked by
Anto (DLL Version : 2008.3.1314.35)
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 1
Anto (DLL Version : 2008.3.1314.35)
Top achievements
Rank 2
Share this question
or