Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
210
XamGrid how to add Checkbox column
posted

Hi,

I am new to use Infragistics controls m facing problem during adding checkbox column in XamGrid. It gives me folloing error;

A column has been added with an Empty key. All columns must have a unique key.

Here is my code;

 

 

 

 

 

 

 

 

 

 

 

 

 

 

<ig:XamGrid Grid.Row="1" Name="dgCustomer" ItemsSource="{Binding CustomerCollection}" Height="Auto" AutoGenerateColumns="True" Width

="685">

 

 

 

 

<ig:XamGrid.Columns>

 

 

 

 

<ig:TemplateColumn>

 

 

 

 

<ig:TemplateColumn.AddNewRowEditorTemplate>

 

 

 

 

<DataTemplate>

 

 

 

 

<CheckBox x:Name="SelectBranch" IsChecked="{Binding IsSelected,Mode=TwoWay}" VerticalAlignment="Center" HorizontalAlignment="Center"/>

 

 

 

 

</DataTemplate>

 

 

 

 

</ig:TemplateColumn.AddNewRowEditorTemplate>

 

 

 

 

</ig:TemplateColumn>

 

 

 

 

</ig:XamGrid.Columns>

 

 

 

 

</ig:XamGrid>

please help me out waiting for your quick reply

Parents
  • 6759
    Verified Answer
    Offline posted

    Hi itskashif,

    you're getting this exception because you haven't set the Key property for the TemplateColumn that you are using. Every column in XamGrid should have its Key property set.

    For your particular use case you should use CheckBoxColumn instead of Template column. The xaml should look something like this:

    <ig:CheckBoxColumn Key="IsSelected">

    You could also take a look at this sample illustrating the use of different type of columns.

    Hope this helps,

Reply Children
No Data