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
305
XamGrid Grouping on Column bound to Object.Property throws NullReferenceException
posted

We are using XamGrid from Infragistics NetAdvantage for Silverlight 11.2. There is an issue with the groupby that we have. There are a couple of columns in  the grid columns are bound to an object’s property(Object.Property). In any row, this column's data is not mandatory. The column key is set to Object.Property in order to show the Property in filters and and when this column is dragged for grouping, we get a NullReferenceException. I guess this is because some of the rows have the object as null. For example:

<ig:XamGrid.GroupBySettings>

      <ig:GroupBySettings AllowGroupByArea="Top" />

</ig:XamGrid.GroupBySettings>

                -------------------------------------------------------------------

<ig:TextColumn Key="Employee.Name" HeaderText="Name" IsReadOnly="true">

        <ig:TextColumn.HeaderTemplate>

          <DataTemplate>

            <TextBlock Text="{Binding Resources.EmployeeName, Source={StaticResource LocalizedResources}}"/>

          </DataTemplate>

        </ig:TextColumn.HeaderTemplate>

      </ig:TextColumn>

<ig:TextColumn Key="Dept.Name" HeaderText="Name" IsReadOnly="true">

        <ig:TextColumn.HeaderTemplate>

          <DataTemplate>

            <TextBlock Text="{Binding Resources.DeptName, Source={StaticResource LocalizedResources}}"/>

          </DataTemplate>

        </ig:TextColumn.HeaderTemplate>

      </ig:TextColumn>

 

Can you suggest a way to have the groupby not throw the Null Reference exceptions.