How to swap rows and columns
9 Dec 2019 / 1 minute to read
This can be done in GridControl by handling virtual events QueryCellInfo, SaveCellInfo, QueryRowCount, QueryColCount. Here GridControl.Data property is used.
//In the QueryCellInfo handler.
e.Style.ModifyStyle(this.gridControl1.Data[e.ColIndex, e.RowIndex], Syncfusion.Styles.StyleModifyType.Override);
//In the SaveCellInfo handler.
this.gridControl1.Data[e.ColIndex, e.RowIndex] = e.Style.Store;
//In the QueryRowCount handler.
e.Count = this.gridControl1.Data.ColCount;
//In the QueryColCount handler.
e.Count = this.gridControl1.Data.RowCount;
'In the QueryCellInfo handler.
e.Style.ModifyStyle(Me.gridControl1.Data(e.ColIndex, e.RowIndex), Syncfusion.Styles.StyleModifyType.Override)
'In the SaveCellInfo handler.
Me.gridControl1.Data(e.ColIndex, e.RowIndex) = e.Style.Store
'In the QueryRowCount handler.
e.Count = Me.gridControl1.Data.ColCount
'In the QueryColCount handler.
e.Count = Me.gridControl1.Data.RowCount
Was this page helpful?
Yes
No
Thank you for your feedback!
Thank you for your feedback and comments. We will rectify this as soon as possible!
An unknown error has occurred. Please try again.
Help us improve this page