<syncfusion:GridDataControl x:Name="dataGrid" Grid.Column="0"
AutoPopulateColumns="False"
ShowTooltips="True"
AutoPopulateRelations="False"
ColumnSizer="Star"
ItemsSource="{Binding CustomerInfo}"
ShowAddNewRow="False"
ShowGroupDropArea="True">
public class SortColumnBehavior : Behavior<GridDataControl>
{
GridDataControl dataControl = null;
/// <summary>
/// Called when [attached].
/// </summary>
protected override void OnAttached()
{
dataControl = this.AssociatedObject as GridDataControl;
dataControl.Model.QueryCellInfo += Model_QueryCellInfo;
}
private void Model_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
{
if(e.Cell.RowIndex == 0)
{
e.Style.ShowTooltip =true;
var column = dataControl.VisibleColumns[e.Cell.ColumnIndex];
e.Style.ToolTip = column.HeaderText;
}
}
protected override void OnDetaching()
{
dataControl.Model.QueryCellInfo -= Model_QueryCellInfo;
}
} |
<syncfusion:GridDataControl x:Name="dataGrid"
Grid.Row="0"
AutoPopulateColumns="False"
AutoPopulateRelations="False"
AllowDragColumns="True"
ColumnSizer="None"
ShowTooltips="True" |