We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to change padding of all GridCell's in a SfDataGrid


On mobile I am finding the padding on individual cells to be too large (see image below). I have tried setting the Padding property on the GridNumericColumn and by setting the CellStyle but neither effect the visual result. Can you advise on how to change the padding of DataCells please. I am using Syncfusion DataGrid on Android / IOS and UWP with SfDataGrid version 20.4.0.41/

Thanks, Martin.


                    <data_grid:GridNumericColumn NumberDecimalDigits="1"

                                                 HeaderText="(lts)"

                                                 MappingName="Capacity"

                                                 CellTextSize="14"

                                                 Padding="0"

                                                 TextAlignment="Center"

                                                 AllowEditing="True">

                        <data_grid:GridNumericColumn.CellStyle>

                            <Style TargetType="data_grid:GridCell">

                                <Setter Property="Padding"

                                        Value="0" />

                                <Setter Property="Margin"

                                        Value="0" />

                            </Style>

                        </data_grid:GridNumericColumn.CellStyle>

                    </data_grid:GridNumericColumn>



Screenshot 2023-01-02 191003.png 


1 Reply

SV Suja Venkatesan Syncfusion Team January 5, 2023 04:24 PM UTC

Hi Martin,


We would like to let you know that SfDataGrid allows to set padding for the cells in both display and edit mode by using the property GridColumn.Padding. Please refer to our user guidelines documentation regarding the same in the below link.


UG link: https://help.syncfusion.com/xamarin/datagrid/column-types#padding


If we misunderstood the reported scenario, please share more information about it, along with the expected illustrative video or image. It will be more helpful for us to provide a timely solutions.


Regards,

Suja


Loader.
Up arrow icon