Right I'm setting the width of the grid using the property UltraWebgrid.Width, which seems to be the same as the UltraWebgrid.DisplayLayout.FrameStyle.Widht. I want to set the width in my css, and then set UltraWebgrid.DisplayLayout.FrameStyle.CssClass to a class located in the css. I did that and it doesn't work.
Is there a way to set the widht from a css?
Hello Oscar,
Applying Css style directly on FrameStyle did the trick for me (works only for width though, height for tables in Css seems like a generally tricky topic), so I assume something in the other settings of your grid interferes? I started with an empty grid (dropped from toolbox), bound to NorthWind AccessDataSource1 and then I have this:
<style type="text/css"> .gridSize { width: 300px; height: 300px; } </style> <FrameStyle CssClass="gridSize"></FrameStyle>
With applies as expected to me. What am I missing?
Hi Rumen,
Yes you are right, it works. I'm not sure why it wasn't working yesterday.
Thanks
That makes total sense. I understand the limitation. I'll define the width in the grid.
Thanks.
Thanks for the follow-up and for the steps to reproduce that. The problem with this scenario is that with all these options set on, the grid will need to know its width server side in order to produce the HTML needed for the fixed colunm size, etc, etc. If you specify this through CSS, at server-side the grid will not know the width, hence the HTML rendered will probably be not consistent with the functionality, hence the side-effects you have.
Ok, I'm back with this issue. I knew something was going on with the width.
Try this:
1) Create a grid with the horizontal scroll bar enabled. Set a fixed grid width.
2) Create some columns, make sure the sum of all widths are wider than the grid so that the scroll bar is displayed.
3) Run the page. So far so good. The grid has the width set in step 1)
4) Remove the grid width, now define the width in a css class, set the FrameStyle.CssClass to that class.
5) Run the page. The scroll bar is not enabled. The grid will be a wide as the sum of all columns. This is not consistent with step 3).