Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
750
How to make columns Visible/invisible
posted

I am binding my Data Grid at runtime. I want to know how to hide some columns at rumtime according to some conditions.

Here is my sample code:

Thats 

 

 void .ReportDetailsDataSource(List<ManagementReport> data)

        {

            ManagementDetailsUltraWebGrid.DataSource = data;

            ManagementDetailsUltraWebGrid.DataBind();

        }

Here I am binding my list of objects to grid.

Now I want to hide some columns. I tried to use Display layout property and able to hide by index of column.

ManagementDetailsUltraWebGrid.DisplayLayout.Bands[0].

Columns[1].Hidden = isHidden;

But I  know the columns name instead of columns index.

Is there any way to hide columns by there Names also.

Thanks

 

 

 

Parents
No Data
Reply Children