In SfDataGrid, when you set TextMargin in GridColumn, it will apply the margin only for the record cells and not the header cells. However, you want to set the TextMargin in header, to override the GridHeaderCellRenderer, and append some spaces to the text of UI Label following a period and make the color of the period appended at the end of the transparent, such that it will be look like text is set with some margin at the right end. Otherwise we include transparent period at the end of the string after the spaces and set the TextMargin based on the record cells.
In following code sample ensure that the text is set with the margin at right end.
Refer the following screenshot that shows the final outcome on execution of the above code.
You can download a working sample for this KB from the below link:
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:|