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

Get MasterTableView Height/Row height dynamically after data is bound

1 Answer 186 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Winni
Top achievements
Rank 1
Winni asked on 19 Sep 2011, 12:44 PM

Hi,
Could anyone please tell me - How to get the following  dynamically in code behind (i was able to set values for these ...)
    1. RadGrid's each row height (Row height of each row in MasterTableView)
    2. Height of MasterTableView .

Why I need this:
One column in my radgrid is description. It can grow to huge size. I cant parse and give tool tip as I need to print and export(it exports/prints only the data on the grid)
So I gave scrolling to grid even though pagination is there .
Since the description can grow and shrink the following code inside DataBound Event is also not working

   
        if (gridItems < 4)

            {

                grid.ClientSettings.Scrolling.ScrollHeight = Unit.Pixel(gridItems * 28);

            }

So I tried instead of hard coded "28", the following

if (grid.MasterTableView.Height.Value >= 150)

       {

           grid.ClientSettings.Scrolling.ScrollHeight = Unit.Pixel(150);

       }

       else

       {

           grid.ClientSettings.Scrolling.ScrollHeight = grid.MasterTableView.Height;

       }



But grid.MasterTableView.Height is always 0.0   :(

 

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 22 Sep 2011, 10:15 AM
Hello Soumya,

I followed your scenario and prepared a sample project that is working as expected. Please give it a try and let me know if any questions arise.

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
Winni
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or