var record = this.dataGrid.GetRecordAtRowIndex(3);
var column = this.dataGrid.Columns[1];
this.dataGrid.SelectCell(record, column);
using Syncfusion.UI.Xaml.Grid.Helpers;
//Select the Cells
var record = this.dataGrid.GetRecordAtRowIndex(rowIndex);
var column = this.dataGrid.Columns[columnIndex];
this.dataGrid.SelectCell(record, column);
//Deselect the cell
var removeRecord = this.dataGrid.GetRecordAtRowIndex(rowIndex);
var removeColumn = this.dataGrid.Columns[columnIndex];
this.dataGrid.UnSelectCell(removeRecord, removeColumn); |
private void DataGrid_CellTapped(object sender, GridCellTappedEventArgs e)
{
var expander = ((e.OriginalSender as GridCell).DataContext as Employee).Expander;
if (expander == "Serials")
{
var recordIndex = this.dataGrid.ResolveToRecordIndex(e.RowColumnIndex.RowIndex);
var row = this.dataGrid.RowGenerator.Items[recordIndex + 1];
if (row.IsExpanded)
this.dataGrid.CollapseDetailsViewAt(recordIndex);
else
this.dataGrid.ExpandDetailsViewAt(recordIndex);
}
} |
<Page.Resources>
<Style TargetType="syncfusion:GridDetailsViewExpanderCell">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="syncfusion:GridDetailsViewExpanderCell">
<Border Background="Transparent"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<Grid Background="{TemplateBinding Background}" Visibility="{TemplateBinding ExpanderIconVisibility}"
>
<TextBlock Text="Serials" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Page.Resources> |