Sfdatagrid sample!

Chào, 
Update:
question3: 
can i apply multi indentwith for each level? (each level different indentwidth)






3 Replies 1 reply marked as answer

MA Mohanram Anbukkarasu Syncfusion Team November 11, 2020 09:18 AM UTC

Hi khanh, 

Thanks for contacting Syncfusion support.  

In SfDataGrid, there is no direct support to set different width for each indent columns. However you can achieve this requirement by setting the width of the indent column manually when multiple groups are added to the DataGrid as shown in the following code example. 

Code example:  

this.sfDataGrid1.GroupColumnDescriptions.CollectionChanged += GroupColumnDescriptions_CollectionChanged; 
 
private void GroupColumnDescriptions_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) 
{ 
    this.sfDataGrid1.BeginInvoke(new Action(() => { 
        if (this.sfDataGrid1.GroupColumnDescriptions.Count > 1) 
        { 
            this.sfDataGrid1.TableControl.ColumnWidths[0 + Convert.ToInt16(this.sfDataGrid1.ShowRowHeader)] = 50; 
            this.sfDataGrid1.TableControl.ColumnWidths[1 + Convert.ToInt16(this.sfDataGrid1.ShowRowHeader)] = 200; 
            this.sfDataGrid1.TableControl.Invalidate(); 
        } 
    })); 
} 

 



Please let us know if you require further assistance from us.  

Regards, 
Mohanram A. 


Marked as answer

TG The GridLock November 11, 2020 12:11 PM UTC

Thanks for the answers!
Seems to be what I need.
I want to ask more, can I remove these 2 lines? (redrawing headercellstyle).




MA Mohanram Anbukkarasu Syncfusion Team November 12, 2020 11:44 AM UTC

Hi khanh, 

Sorry for the inconvenience.  

Based on our control implementation, it is not possible to remove those lines from the header indent cell. Please let us know if you require any other assistance from us.  

Regards, 
Mohanram A. 



Loader.
Up arrow icon