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

RadGRid - How to apply fixed column width to some columns

3 Answers 143 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tushar
Top achievements
Rank 1
Tushar asked on 07 Jul 2014, 10:48 AM
Hi,
One of RadGrids in my application is having large number of columns. TableLayout of MasterTableView is "Fixed".
I have explicitly set width for each column so that when all columns are made visible, they all are displayed correctly.
But by default only few columns are visible and they are automatically expanded to cover whole width of the grid.
I do not want some columns like checkbox columns to expand. I want them to be always of fixed width.
How can I achieve this??

I know this can be achieved by not specifying width of one of the columns, but then that column width reduces to 0 when more number of columns become visible.

Thanks
Tushar

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 07 Jul 2014, 01:01 PM
Hi Tushar,

In order to set a column width fixed you can set TableLayout="Fixed" for the MasterTableView and widths to the column, according to your preference. If you donot want to resize the column you can set the property of the column Resizable="false".

Thanks,
Princy
0
Tushar
Top achievements
Rank 1
answered on 08 Jul 2014, 08:20 AM
Hi Princy,
Thanks for your reply. I tried Resizable="false". But it does not work when column width is specified for all columns.
Not sure if this is bug in latest release of ASP.NET AJAX controls.
0
Princy
Top achievements
Rank 1
answered on 09 Jul 2014, 07:23 AM
Hi Tushar,

I'm afraid this is the default behavior of the Grid. When hiding the columns, the columns located on each side column, will be automatically resized to equal portions of the grid to occupy the empty space.  As a suggestion you can set an initial width for the Radgrid and adjust the width of the RadGrid according to the number of columns visible, this may help in retaining the column width.

Thanks,
Princy
Tags
Grid
Asked by
Tushar
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Tushar
Top achievements
Rank 1
Share this question
or