<Syncfusion:GridTemplateColumn> <Syncfusion:GridTemplateColumn.CellTemplate> <DataTemplate> <Button Width="Auto" Syncfusion:FocusManagerHelper.FocusedElement="True" Height="Auto" Click="Button_Click" Content="Call” /> </DataTemplate> </Syncfusion:GridTemplateColumn.CellTemplate> </Syncfusion:GridTemplateColumn> |
<Syncfusion:GridTemplateColumn> <Syncfusion:GridTemplateColumn.CellTemplate> <DataTemplate> <Button Width="Auto" Syncfusion:FocusManagerHelper.FocusedElement="True" Height="Auto" Click="Button_Click" Content="Call” /> </DataTemplate> </Syncfusion:GridTemplateColumn.CellTemplate> </Syncfusion:GridTemplateColumn> |
<syncfusion:GridTemplateColumn >
<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" Content="B1"/>
<Button x:Name="button2" Grid.Column="1" Click="button2_Click" Height="20" syncfusion:FocusManagerHelper.FocusedElement="True" Content="B2"/>
</Grid>
</DataTemplate>
</syncfusion:GridTemplateColumn.CellTemplate>
</syncfusion:GridTemplateColumn> |
hello Sathiyathanam,
I just download the sample EditingTemplateColumn_WPF-1364933297141210955.zip , and add two messagebox in the two button_click event. When I click the button1, the messagebox show immediately, but when I click button2, the messagebox only show at the second click.
this.dataGrid.CellRenderers.Remove("Template");
this.dataGrid.CellRenderers.Add("Template", new GridCellTemplateExt());
public class GridCellTemplateExt : GridCellTemplateRenderer
{
protected override void SetFocus(FrameworkElement uiElement, bool needToFocus)
{
if (!needToFocus)
DataGrid.Focus();
}
} |