views:

1243

answers:

4

I've tried Infragistics on this but they don't seem to understand what I am asking and it takes days to get an answer so please help!

I need to place an Infragistics web grid into either a div or a table cell. The grid must size to fit the div or cell. If there is too much data to display, I need the grid to do its magic and add its own scrollbars.

So far I have achieved this using javascript and resizeing every time the browser window resizes. Unfortunately when refreshing the page (using AJAX), the grids resize themselves to their default sizes for a second before correcting but this is not acceptable to the customer (or me for that matter).

It is irritating that width=100% works but height=100% does not. I find that it just extends out of the div or table (not even resizing the div, just expanding out of it).

I have tried the KB article that sets the height and width to 100% and the frame custom rules to table-layout:auto but this doesn't work.

UPDATE

I created a test project with a 500px tall table, two rows (each 50% height) and two cells per row to give a 2 x 2 grid. If I set the Infragistics grid height to 100% within a cell, it fits perfectly until you bind it to data. It then extends, making the table more than 500px high.

I tried putting a 100% x 100% div in one of the cells and the grid in this. Then the table stays the correct size but the grid grows in height by the size of a row and extends out of the div and the cell :-(

I am starting to wonder if the Infragistics web controls are as good as they should be. They certainly don't seem to be as good as the Windows versions.

A: 

Have you tried only specifying width=100% and leaving the height specification off of the grid completely?

Another thought is placing the grid on an asp.net panel and placing the panel in the div or table cell.

Tyler
I tried that. When the grid data is smaller (less rows) than the div/cell it is in, the horizontal scrollbar for the grid appears to high up the page. Also, if there are too many rows, they extend past the div/cell.
Baffled by ASP.NET
I stumbled onto this KB from Infragistics that talks about dynamically resizing row height. It calls the InitializeLayout using javascript. You may be able to use this same technique to resize the grid accordingly.http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.Aspx?ArticleID=6143
Tyler
A: 

I had a simillar issue with ComponentArt's grids, and If I understand you then maybee this will help.

What I had to do was limit the height of the grid by putting it in my own Div, which had overflow-y scrollable. So I had this:

Do not specify a height on the grid at all.

Edit

You need to set a set a specific height on your div I think.

<table style="height:500px">
   <tr>
      <td>Cell 1</td>
      <td>Cell 2</td>
   </tr>
   <tr>
      <td>
         <div style="height:400px;overflow-y:scrollable"> <ingragists...>
         </div>
       </td>
       <td>Cell 3</td>
    </tr>
</table>
JoshBerke
Unfortunately that doesn't work either. On the Infragistics control the grid ends up absolutely positioned and won't scroll within the div. Even if it did, it would hide the column headers, which would not be acceptable to the customer.
Baffled by ASP.NET
Hah well keeping the grid headers is a whole other beast. I've managed to get my CA grids to live inside a fixed height scrollable div, and if you look at my issue tracker you'll find one in there to keep the column headers fixed.
JoshBerke
A: 

Have you tried it in an empty project without any user controls , masterpages and inheritance ? If there where no possible properties to do that , I think you can do this job by conditional code .

Sypress
A: 

I resolved this in the end by removing the doctype from the ASP.NET page. It seems that the way that the grid is laid out does not work properly with IE in standards mode. It looks like mainly an IE problem.

Infragistics have said that they are working on a new grid that doesn't have these problems but unfortunately it does not yet have the flexibility of the standard grid.

Baffled by ASP.NET