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

[Solved] Keep Column Width

1 Answer 97 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Francisco
Top achievements
Rank 1
Francisco asked on 11 Mar 2010, 04:34 PM
The first time pages load, I create a RadGrid (OnInit) and I set the columns width. When I do a web service request, the following method is executed after that request:

function OnSuccessfullyWebServiceRequest(res){ 
    var grid = GetGrid(); 
    if (res){ 
            var masterTable = grid.get_masterTableView(); 
            var columns = masterTable.get_columns(); 
            for(var i = 0; i<columns.length; i++){ 
                var columnName = columns[i].get_uniqueName(); 
                    if (res.indexOf(columnName) < 0){ 
                        columns[i].set_visible(false); 
                    } 
                    else
                        columns[i].set_visible(true); 
            } 
        } 
            masterTable.dataBind(); 
        } 

The problem is after the masterTable.dataBind(), the columns width are changing. Is there a way to keep the columns settings?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 12 Mar 2010, 01:08 PM
Hi,

Try  setting  the MasterTableView TableLayout to Fixed .Let if know if you have any more queries.
   <MasterTableView  TableLayout="Fixed" EditMode="EditForms"

Princy
Tags
Grid
Asked by
Francisco
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or