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

[Solved] Force column width

1 Answer 177 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Antony
Top achievements
Rank 1
Antony asked on 31 Mar 2009, 03:54 PM
Hi Everyone,

I have been at this all day and would really appreciate some help.

I have a grid that I create dynamically in the Page_Init which has between 3 and 5 columns, there is always a "Total" column added as the last column. The "Total" column I would like to remain a set size regardless of how many columns are in the grid.

The other columns I have set a width of 100px which should be the minimum width of these columns.
The idea being that up to 3 columns + my "Total" column should fit in the grid without scrolling, if the user adds any further columns then the grid will scroll, if the grid contains less than 4 columns then I want all the columns to autosize to fill the grid width while the "Total" column remains a fixed size.

Is there anyway to accomplish this?

I have tried setting the "Total" column width in CSS with the !Important attribute but it still expands beyond the 60px width.
By the way the "Total" column is a ItemTemplate column that contains a RadNumericTextbox which I have successfully set the width of to 50px.

Any help would be appreciated.

Thanks
Antony


1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 01 Apr 2009, 07:46 AM
Hello Antony,

Try setting the TableLayout property for the MasterTableView as Fixed as shown below and see if it helps persist the column width regardless of columns being added:

aspx:
 <telerik:radgrid id="RadGrid1" DataSourceID="SqlDataSource1" runat="server"
      <MasterTableView TableLayout="Fixed" DataSourceID="SqlDataSource1" > 

Thanks
Princy.
Tags
Grid
Asked by
Antony
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or