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

Radgrid Columns....

3 Answers 110 Views
Grid
This is a migrated thread and some comments may be shown as answers.
raaj
Top achievements
Rank 1
raaj asked on 27 Apr 2010, 11:21 AM
In my application am using Telerik Radgrid & RadTabStrip

In RadTabStrip1 I've to show Column1, Column2, Column3, Column4, Column5 in the RadGrid

In RadTabStrip2 I've to show Column1 & Column2 in the RadGrid

In RadTabStrip3 I've to show Column1, Column2, Column4, Column5 in the RadGrid

Each columns are of different width.

I just want to find out what are the columns loaded in each RadTabStrips with Column width.

Is it possible? Pls let me know with sample code.



3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 27 Apr 2010, 01:45 PM

Hello Rajesh,

You can access the columns those are shown in grid by uisng following code snippet.

CS:

 
    foreach (GridColumn column in RadGrid1.MasterTableView.Columns)  
    {  
        if (column.Visible)  
        {  
            Response.Write(column.UniqueName);  
            Response.Write(column.HeaderStyle.Width.Value); // retrieves the width if width is set  
        }  
    } 

-Shinu.

0
raaj
Top achievements
Rank 1
answered on 27 Apr 2010, 02:54 PM
Hi Shinu,

Thanks for your prompt answer. My situation is am not setting the Column width explicitly. It'll be created dynamically.

Based on the Radgrid width I need to set the Panel width.
 
Further, dont mistake me, In which event I've to write the following loop.

Thanks
Rajesh N.
0
Dimo
Telerik team
answered on 27 Apr 2010, 03:23 PM
Hello Rajesh,

There is no way to know how wide a RadGrid will be on the server, unless you set its column widths explicitly.

In your case you can set some pixel width to RadGrid and enable scrolling. In this way there will be enough space for all columns and the control will occupy the same amount of space, regardless of the number of its columns.


Dimo
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
raaj
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
raaj
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or