We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Fixed column width with full width in treegrid

Hi,
How can I make column width when load tree grid with resize mode 'fixed column' to full in tree grid like normal mode
Regards,
M. Salah

1 Reply

JS Jonesherine Stephen Syncfusion Team February 24, 2017 11:55 AM UTC

Hi Mohamed, 
Thanks for contacting Syncfusion support. 
As per our current behavior we can’t able to stretch the column to auto width using “FixedColumns” mode. We have prepared the work around and rendered column with given width values in column collection. We have achieved this by using create client side event and removed the style attribute of other columns. 
Please find the code example below: 
$("#TreeGridContainer").ejTreeGrid({              
                columnResizeSettings: { 
                    columnResizeMode: ej.TreeGrid.ColumnResizeMode.Normal 
                },               
                columns: [ 
{ field: "taskID", headerText: "Task Id", editType: "numericedit", width: "45" }, 
{ field: "taskName", headerText: "Task Name", editType: "stringedit", width: "200" },                 
], 
               create: function (args) { 
             var $cols1 = this.getContentTable().children("colgroup").find("col"), 
             $cols2 = this.getHeaderTable().children("colgroup").find("col"); 
                    $($cols1[2]).removeAttr("style"); 
                    $($cols1[3]).removeAttr("style"); 
                    $($cols1[4]).removeAttr("style"); 
                    $($cols2[2]).removeAttr("style"); 
                    $($cols2[3]).removeAttr("style"); 
                    $($cols2[4]).removeAttr("style"); 
                },            
 }) 
We have also prepared the sample based on this. Please find the sample from below location 
Regards, 
Jone sherine P S 


Loader.
Up arrow icon