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

Columns get disappeared after resizetofit()

4 Answers 14 Views
Grid
This is a migrated thread and some comments may be shown as answers.
vishal
Top achievements
Rank 1
vishal asked on 03 Dec 2014, 01:56 PM
 Hello,

I have three radgirds in RadTabStrip (1 grid in 1 tab), I want to achive the resize to fit facility. so I have written following code with "AllowColumnResize='True' AllowRowResize='false' ResizeGridOnColumnResize='true' AllowResizeToFit='true'" property settings of grid.

var grdstQ = $find("<%= Grid1.ClientID %>");
                    var clmstQ = grdstQ.get_masterTableView().get_columns();
                    for (var i = 0; i < clmstQ.length; i++) {
                        clmstQ[i].resizeToFit(false, true);
                    }

I have applied the above code solution for all three grids, the first grid in tab working fine but columns in other two grids disappeared after apply the same solution.

Please suggest, I am not getting how to resolve this strange issue.

Thanks in advance.

Regards,
Vishal

4 Answers, 1 is accepted

Sort by
0
vishal
Top achievements
Rank 1
answered on 04 Dec 2014, 09:50 AM
Awaiting response.

Someone please help.
0
vishal
Top achievements
Rank 1
answered on 08 Dec 2014, 11:02 AM
Any help from Telerik Admin?
0
Pavlina
Telerik team
answered on 08 Dec 2014, 02:12 PM
Hello,

Could you specify which is the event you use to apply the solution for resizing columns? You can try using
OnClientTabSelected event of the RadTabStrip, locate the corresponding RadGrid and then resize the columns to fit the widest cell's content

Regards,
Pavlina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
vishal
Top achievements
Rank 1
answered on 09 Dec 2014, 11:50 AM
Hello Pavlina,

Thanks for replying finally.

I was using pageLoad but OnClientTabSelected worked for me.

Thanks again.
Vishal
Tags
Grid
Asked by
vishal
Top achievements
Rank 1
Answers by
vishal
Top achievements
Rank 1
Pavlina
Telerik team
Share this question
or