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

Width of the Grid

4 Answers 45 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andy Ho
Top achievements
Rank 1
Andy Ho asked on 27 Jul 2010, 04:09 AM
Hi,

Everytime I create a new Grid, the default size is 100%, even though I set the width of each column doesn't help.
Of course I can sum up the column width manually and then assign to WIDTH property of the grid, but is there any way that I can set the width of the Grid based on the column size?

Thanks.

4 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 28 Jul 2010, 10:10 AM
Hi Andy,

The HTML ouput of the RadGrid control is not a single <table>, but also includes some <div>s in which the <table>s reside. Generally, the width of child elements depend on the width of parent elements - your wish is exactly the opposite, which is not possible in this case. Please set the RadGrid width explicitly, based on the column widths.

Best wishes,
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
0
Andy Ho
Top achievements
Rank 1
answered on 29 Jul 2010, 01:23 AM
How about the height? I want the Grid height to be auto expanded and use the page scroll bar instead of the DIV scrollbar, how to do this?
0
Andy Ho
Top achievements
Rank 1
answered on 29 Jul 2010, 03:07 AM
Dimo,

You can refer to the attached screen, what I want are:

1. to remove the Horizontal scrollbar which come up automatically.

2. Use all the available height dynamically based on the splitter
0
Dimo
Telerik team
answered on 29 Jul 2010, 02:43 PM
Hello Andy,

1. If you have set Width="100%" for the MasterTableView, please remove that.

2. Currently you have enabled RadGrid scrolling. If you want to use the RadSplitter's or browser's scrollbars, you can simply disable the control's scrolling functionality. Alternatively, you can use the RadGrid vertical scrollbar and make the control expand to full height by setting 100% height to RadGrid. In this case you need to ensure that the RadGrid parent element has an explicit height. If the control is ajaxified, you need to use the following technique...

http://www.telerik.com/community/code-library/aspnet-ajax/ajax/how-to-set-100-height-and-random-styles-to-a-radajaxmanager-update-panel.aspx

or set UpdatePanelHeight="100%" in the RadGrid's AjaxSetting, if you are using the latest RadControls version.

If you need further assistance, please provide a code snippet, which reveals your scenario.

Sincerely yours,
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
Andy Ho
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Andy Ho
Top achievements
Rank 1
Share this question
or