Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
143526 | Mar 25,2019 12:42 PM UTC | Apr 4,2019 06:50 AM UTC | WPF | 6 |
![]() |
Tags: SfDataGrid |
<syncfusion:GridTemplateColumn HeaderText="GrandTotal" MappingName="GrandTotal" >
<syncfusion:GridTemplateColumn.CellTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Button x:Name="button1" Grid.Column="0" Click="button1_Click" Height="20" syncfusion:FocusManagerHelper.FocusedElement="True" Margin="2" Content="B1"/>
<Button x:Name="button2" Grid.Column="1" Click="button2_Click" Height="20" syncfusion:FocusManagerHelper.FocusedElement="True" Margin="2,0,0,0" Content="B2"/>
</Grid>
</DataTemplate>
</syncfusion:GridTemplateColumn.CellTemplate>
</syncfusion:GridTemplateColumn> |
this.dataGrid.CellRenderers.Remove("Template");
this.dataGrid.CellRenderers.Add("Template", new CustomGridCellTemplateRenderer());
public class CustomGridCellTemplateRenderer : GridCellTemplateRenderer
{
protected override void SetFocus(FrameworkElement uiElement, bool needToFocus)
{
if (!needToFocus)
DataGrid.Focus();
}
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.