first add the namespace
xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid"
To use DatagridControl, you should try like this -
<xcdg:DataGridControl ItemsSource="{Binding PersonList}"
Margin="0,0,0,100"
ReadOnly="{Binding IsGridReadOnly}"
>
<xcdg:DataGridControl.Columns >
<xcdg:UnboundColumn FieldName="Id" Visible="False" />
<xcdg:Column FieldName="FirstName"
Width="*"
Visible="True" />
<xcdg:Column FieldName="LastName"
Width="*"
Visible="True" />
</xcdg:DataGridControl.Columns>
</xcdg:DataGridControl>
In the ViewModel, Here i have
private ObservableCollection<Person> _PersonList ;
public ObservableCollection<Person> PersonList
{
get { return _PersonList; }
set { _PersonList = value; }
}
In the constructor, i am calling LoadData Method to populate Person List. In Person class i have 3 fields - ID, FirstName and LastName.
Here in the datagrid, you can see there is 2 types of columns - column and unboundcolumn