Common way is to way have a field which is the combination of both the fields. So if your class is
class Something
{
string Key1 { get; set; }
string Key2 { get; set; }
}
Change it to
class Something
{
string Key { get { return string.Format("{0}|{1}", Key1, Key2); } set { } }
string Key1 { get; set; }
string Key2 { get; set; }
}
Now you can use "Key" as the primary key field for the grid and now you can uniquely identify every row.