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

fixing the grid width

3 Answers 108 Views
Grid
This is a migrated thread and some comments may be shown as answers.
mww
Top achievements
Rank 1
mww asked on 17 May 2009, 12:52 PM
I have a grid inside a containing div, the div is a fixed width of 650px.  Ive set the width of the grid to 100% so it should stay within the boundaries of the containing div.   The grid contains many columns, some of which have fairly long header text
eg 
'Artist Genre Search Narrative'

because of this, the grid exceeds the width ive set the containing div and 'hangs outside' and off the screen, making it necesssary to scroll the page, a behaviour that I dont want.

How can I force the header text to wrap, the cell contents do it automatically, but the header doesnt.
Ive even fixed the width but it makes no difference

<

 

telerik:GridBoundColumn

 

 

DataField="GenreSearchNarrative"

 

 

HeaderText="Artist Genre Search Narrative"

 

 

ReadOnly="True"

 

 

SortExpression="GenreSearchNarrative"

 

 

UniqueName="GenreSearchNarrative" Visible="true">

 

 

<HeaderStyle Width="112px" />  ------ this makes no diffrence no matter what value i set it to

 

 

</telerik:GridBoundColumn>

 

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 18 May 2009, 11:19 AM
Hi MWW,

Try setting the Wrap property for the Header and see whether it helps. Also set the TableLayout property of the Grid to Fixed.

ASPX:
 
  <HeaderStyle  Wrap="true" /> 


Shinu
0
mww
Top achievements
Rank 1
answered on 18 May 2009, 02:44 PM
Ive tried your suggestion and it makes no difference, the grid still pushes out beyound the width of its containing div
Ive modified the databound column settings as below and set the header wrap property for the entire grid, nothing makes a difference

<telerik:GridBoundColumn   
                                        DataField="TypeSearchNarrative"   
                                        HeaderText="Artist Type Search Narrative" 
                                        ReadOnly="True"   
                                        SortExpression="TypeSearchNarrative"   
                                        UniqueName="TypeSearchNarrative"  Visible="true">  
                                        <HeaderStyle  Wrap="true" width="55px"/>   
                                        </telerik:GridBoundColumn> 
0
Dimo
Telerik team
answered on 20 May 2009, 11:18 AM
Hi Mark,

Are you using RadGrid scrolling? Is there a table inside that <div>, which contains RadGrid?

RadGrid wraps its content by default, so there must be something, which prevents it from doing so. Please provide a more comprehensive example, so that we can test locally. Thank you.

Greetings,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
mww
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
mww
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or