Sorting Issue :
I created and POCO which Inclues another POCO via association and the grid blows.
Ex. Define Class - Address{ City , State, etc...}
Define ContactInfo{FirsName,LastName, Address, etc...} which contains User and Address
Bind the grid to a collection of contactinfo
<
ig:TextColumn Key="Address.City" HeaderText="Address" Width="201" />
try to sort on Address Column which is a property of th Address class and the grid blows
A TargetNullValue probably won't help in this situation as we don't use a binding on the object, we use a LINQ statement against the underlying data source.
Off the Column object is a property call .SortComparer which you can set to be an IComparer<t> to change how the sorting works.
Can you provide a TargetNullValue
Below is the Class and Xaml for the xamGrid :
I'm Using RiaServices the version of the control is 10.3.20103.1006
ContactInfo
{
[
]
; }
//Holds Primary Address
()]
)]
//Holds Primary Phone
//Holds Primary Email
//Holds Primary Notes
}">
>
="Visible" />
="SelectRow" />
="150" />
="150"/>
="M.I" />
="201" />
="125"/>
="State"/>
="75"/>
I tried out your issue here but did not reproduce your results. Below is the structure that I used for the XamGrid.
Could you produce a simple sample showing this behavior?
What version of the control are you using?
And is the field you are comparing a string / int / double or another simple data type field or is it an object, from the look of it (a City field) i would assume it is a string, but if it is an custom object you would need to have defined IComparable on the object.
<ig:XamGrid x:Name="grid" AutoGenerateColumns="false">
<ig:XamGrid.Columns>
<ig:TextColumn Key="Address.Town"></ig:TextColumn>
<ig:TextColumn Key="Address.State"></ig:TextColumn>
<ig:TextColumn Key="Name"></ig:TextColumn>
</ig:XamGrid.Columns>
</ig:XamGrid>
void MainPage_Loaded(object sender, RoutedEventArgs e)
List<Person> people = new List<Person>();
for (int i = 0; i < 50; i++)
Person p = new Person();
p.Name = "Person " + i;
Address a = new Address();
a.Town = "Town " + i;
if (i % 3 == 0)
a.State = "NJ";
}
if (i % 3 == 1)
a.State = "PA";
if (i % 3 == 2)
a.State = "DE";
p.Address = a;
people.Add(p);
grid.ItemsSource = people;
public class Person
public string Name { get; set; }
public Address Address { get; set; }
public class Address
public string State { get; set; }
public string Town { get; set; }