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

Resizing a RadGrid

2 Answers 64 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Darren
Top achievements
Rank 1
Darren asked on 12 Oct 2012, 05:51 PM
Can somebody point me to an example of resizing a RadGrid with:

Static Headers
Auto Layout
Ajaxified
Scrolling
WebBlue skin

I'm using this:

function GridCreated2(sender, args) {
            var RadGrid1 = $find(sender.ClientID);
            //RadGrid1.get_masterTableView().get_dataItems()[5].set_selected("true");
            var row = RadGrid1.get_masterTableView().get_selectedItems()[0];
            if (row) {
                setTimeout(function () {
                    var rowElement = row.get_element();
                    var scrollArea = RadGrid1.GridDataDiv;
                    if ((rowElement.offsetTop - scrollArea.scrollTop) + rowElement.offsetHeight + 20 > scrollArea.offsetHeight) {
                        scrollArea.scrollTop = scrollArea.scrollTop + (rowElement.offsetTop - scrollArea.scrollTop) + (rowElement.offsetHeight - scrollArea.offsetHeight) + rowElement.offsetHeight;
                    }
                    else if ((rowElement.offsetTop - scrollArea.scrollTop) < 0) {
                        scrollArea.scrollTop = rowElement.offsetTop;
                    }
                }, 200);
            }

But my data area collapse when I set the height to 100%

2 Answers, 1 is accepted

Sort by
0
Darren
Top achievements
Rank 1
answered on 12 Oct 2012, 08:19 PM
Okay what makes the width of the grid shrink?  The grid's container is 100% but I think the width of the grid is not shrinking once expanded...

If I use Fixed layout it sizes properly.  What's up with that?
0
Pavlina
Telerik team
answered on 16 Oct 2012, 02:08 PM
Hello,

Go through the forum thread below which elaborates on this subject and see if this information will be useful for you:
http://www.telerik.com/community/forums/aspnet-ajax/grid/radgrid-100-height-chrome.aspx

All the best,
Pavlina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Darren
Top achievements
Rank 1
Answers by
Darren
Top achievements
Rank 1
Pavlina
Telerik team
Share this question
or