<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();
}
} |