New to Telerik UI for .NET MAUI? Start a free 30-day trial

DataGrid NumericalColumn

The DataGridNumericalColumn is used to represent only numerical values. It uses the Telerik UI for .NET MAUI NumericInput control to edit the value in EditMode. The difference between this column and the text one is that it will directly invoke the numeric keyboard on the mobile devices.

Important Properties

  • PropertyName—Specifies the name of the property of the object type that represents each row within the grid.
  • HeaderText—Defines the content that will be displayed in the Header UI that represents the column.
  • CellContentStyle—Defines the Style object that sets the appearance of each cell associated with this column. The TargetType of the Style has to be of the TextBlock type.
  • CellContentStyleSelector—Defines the StyleSelector instance that allows for the dynamic appearance on a per-cell basis.
  • CellContentFormat—Defines the custom format for each cell value. The String.Format routine is used and the format passed has to be in the form required by this method.
  • CellContentTemplate (DataTemplate)—Defines the appearance of each cell associated with the concrete column. CellContenTemplate enables you to customize the default look of the cell.
  • CellEditTemplate (DataTemplate)—Defines the editor associated with the concrete column. The CellEditTemplate is displayed when the cell is in edit mode.
  • FooterText—Defines the content that will be displayed in the Footer UI that represents the column.
  • FooterStyle (DataGridColumnFooterStyle)—Defines the Style object that sets the appearance of each footer cell associated with this column.
  • FooterContentTemplate (DataTemplate)—Defines the appearance of the footer.

For more information about CellDecorationStyle and CellDecorationStyleSelector, refer to the Columns Styling topic.

CellContentFormat uses the format string provided by the framework. For more details, refer to the Standard Numeric Formatting and Custom Numeric Formatting articles.

Example

<telerik:DataGridNumericalColumn PropertyName="StadiumCapacity"
                                     HeaderText="Stadium Capacity"
                                     CellContentFormat=" Seats - {0:D}">
    <telerik:DataGridNumericalColumn.CellContentStyle>
        <telerik:DataGridTextCellStyle TextColor="Green"
                                           FontSize="18"
                                           SelectedTextColor="LightCoral" />
    </telerik:DataGridNumericalColumn.CellContentStyle>
</telerik:DataGridNumericalColumn>

DataGrid Numerical Column

Example with CellContenTemplate and CellEditTemplate

<telerik:DataGridNumericalColumn PropertyName="StadiumCapacity">
    <telerik:DataGridColumn.CellContenTemplate>
        <DataTemplate>
            <Label Text="{Binding StadiumCapacity}"/>
        </DataTemplate>
    </telerik:DataGridColumn.CellContenTemplate>
    <telerik:DataGridColumn.CellEditTemplate>
        <DataTemplate>
            <telerik:RadDockLayout>
                <Button Text="OK" Command="{Binding CommitEditCommand}" telerik:RadDockLayout.Dock="Right" />
                <Button Text="X" Command="{Binding CancelEditCommand}"  telerik:RadDockLayout.Dock="Right"/>
                <Slider Maximum="80000" Minimum="30000" 
                        Value="{Binding Item.StadiumCapacity}" 
                        HorizontalOptions="FillAndExpand" />
            </telerik:RadDockLayout>
        </DataTemplate>
    </telerik:DataGridColumn.CellEditTemplate>
</telerik:DataGridNumericalColumn>

See Also

In this article
Not finding the help you need?