Query |
Answer | ||
How to align cell value to center ?
|
We have analyzed your query to change the alignment of cells in SfDatGrid and you can achieve this by using the following ways.
Case 1 : If you want to use same alignment to all the cells in a grid, refer to following code snippet
Note :
By using the above solution, horizontal alignment will not be changed for the below columns
Case 2 : If you want to use different alignment for different columns, you can make use of GridColumn.TextAlignment property. Please refer to following code snippet
| ||
How format cell value without using a different property ? Like cell value appear "123" and I want it to show "123 Kg". Like binding with StringFormat.
|
You can achieve this by writing DisplayBinding for the specific column. Please refer to the below KB article to know more details on formatting cell value
KB Link:
Also please refer to the below UG Link
UG Link:
| ||
How to make a column to fill the rest of space? Like there are 3 columns, and I want second column to fill the space.
|
You can set column sizer of specific column as AutoLastColumnFill or AutoWithLastColumnFill.
Please refer to the below UG link for more details
UG Link:
| ||
How to hide a column without setting its width to 0 ?
|
By default, we will set column width as 0 when you hide the column. Can you please let us know why you do not want to make the column width as 0 while hiding? |