Infragistics Home

Infragistics Forums

Infragistics community online discussions.
Welcome to Infragistics Forums Sign in | FAQ
in Search

Set the grid's width using a css class

Last post 07-31-2008 22:41 by Oscar Mora. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 07-30-2008 19:02

    • Oscar Mora
    • Top 150 Contributor
    • Joined on 06-09-2008
    • California, USA
    • Points 543

    Set the grid's width using a css class

    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?

    Filed under: ,
    • Post Points: 20
  • 07-30-2008 22:24 In reply to

    Re: Set the grid's width using a css class

    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? 

    Best Regards,
    Rumen Stankov (MCSD.NET)
    The Infragistics ASP.NET Team
    • Post Points: 20
  • 07-31-2008 11:31 In reply to

    • Oscar Mora
    • Top 150 Contributor
    • Joined on 06-09-2008
    • California, USA
    • Points 543

    Re: Set the grid's width using a css class

    Hi Rumen,

    Yes you are right, it works. I'm not sure why it wasn't working yesterday.

    Thanks

    • Post Points: 5
  • 07-31-2008 12:43 In reply to

    • Oscar Mora
    • Top 150 Contributor
    • Joined on 06-09-2008
    • California, USA
    • Points 543

    Re: Set the grid's width using a css class

    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).

    • Post Points: 20
  • 07-31-2008 12:51 In reply to

    Re: Set the grid's width using a css class

    Answer

    Hello Oscar,

    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. 

    Best Regards,
    Rumen Stankov (MCSD.NET)
    The Infragistics ASP.NET Team
    • Post Points: 20
  • 07-31-2008 22:41 In reply to

    • Oscar Mora
    • Top 150 Contributor
    • Joined on 06-09-2008
    • California, USA
    • Points 543

    Re: Set the grid's width using a css class

    Hi Rumen,

    That makes total sense. I understand the limitation. I'll define the width in the grid.

    Thanks.

    • Post Points: 5
Page 1 of 1 (6 items)
Powered by Community Server (Commercial Edition), by Telligent Systems