this.sfdatagrid.AutoGeneratingColumn += sfdatagrid_AutoGeneratingColumn;
this.sfdatagrid1.AutoGeneratingColumn += sfdatagrid1_AutoGeneratingColumn;
void sfdatagrid_AutoGeneratingColumn(object sender, AutoGeneratingColumnArgs e)
{
if (e.Column.MappingName == "RollNo" || e.Column.MappingName == "Grade")
e.Cancel = true;
}
void sfdatagrid1_AutoGeneratingColumn(object sender, AutoGeneratingColumnArgs e)
{
if (e.Column.MappingName == "Age")
e.Cancel = true;
} |
<syncfusion:SfDataGrid x:Name="sfdatagrid"
Grid.Column="0"
ItemsSource="{Binding Stud}"
AutoGenerateColumns="True"
SelectionMode="Single"
RowSelectionBrush="Transparent"
AllowEditing="True"
AllowDrop="True"
AllowFiltering="False"
AllowGrouping="True"
ShowRowHeader="True"
ShowGroupDropArea="False"
/> |