The Syncfusion® native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I am using a DataGrid that displays about 25-30 rows. I wanted to figure out how do I set the VerticalAlignment (to Middle) for the text in each of these rows. Preferably in C#.
FPFarjana Parveen Ayubb Syncfusion Team July 29, 2015 03:37 PM UTC
Hi Yatharth,
Thank you for contacting Syncfusion support.
We have analyzed your query. By default we have set the VerticalAlignmet as center for all the columns except GridTemplateColumn in SfDataGrid. If you want to set the VerticalAlignment as Center for GridTemplateColumn then you have to set VerticalAlignment in corresponding control which you have loaded into the GridTemplateColumn.CellTemplate.
Please refer the below code snippet and sample in the following location:
FPFarjana Parveen Ayubb Syncfusion Team July 31, 2015 10:43 AM UTC
Hi Yatharth,
In our pervious solution, you can set the VerticalAlignment as Center for GridTemplateColumn in XAML and you can also define the VerticalAlignment as Center for GridTemplateColumn in code behind, please refer the below code snippet. We also attached the simple sample in the following location: