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. (Last updated on: June 24, 2019).
Microsoft has ended support for older versions of IE. For the best experience, upgrade to the latest version of IE, or view this page in another browser.
In GridDataControl,you can use theCellMarginsInfoclassto describe the Cell’sPadding, TextMargins and also BorderMargins.Using the CellMarginsInfoyou can define each side of the cell’s margin individually. Margin sides that are not initialized,inherit default values from the base style. Generally the properties Left, Right, Top and Bottom are used to set the respective margin values.
Following code illustrates the usage of CellMarginsInfo to set GridDataControlCell’sPadding,TextMargins and also BorderMargins.
XAML
Here, two CellMarginsInfo definitions(CellMargin and CellBorderMargin) are created and applied to the VisibleColumns”Empmobileno”, “Mail ID” and “Designation” using the ColumnStyleproperty. GridDataColumnStyle is used to set the Padding, TextMargins and BorderMargins values.CellBorderMarginis applied for BorderMargins,and CellMargin is applied for PaddingandTextMargins.
The following screenshot illustratesthe output for the above code in the GridDataControl.
Here you can notice that the Cell Padding and TextMargins are applied for “Mail ID” and “Empmobileno” columns that are actually left aligned and BorderMargins applied for “Designation” column that is actually right aligned. You can also note that they vary from the cells of other VisibleColumns as padding or Margins are set for those columns where cells in other columns have default value.
2X faster development
The ultimate WPF UI toolkit to boost your development speed.
I agree to the creation of a Syncfusion account in my name and to be contacted regarding this message. No further action will be taken. Please see our Privacy policy and Cookie Policy.
This page will automatically be redirected to the sign-in page in 10 seconds.
You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.