This is a migrated thread and some comments may be shown as answers.

How do we define identity column?

2 Answers 29 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Alexey Oyun
Top achievements
Rank 1
Alexey Oyun asked on 03 Jun 2010, 09:11 AM
I have list of objects where object has structure of
class MyObject
{
 string Name
 List<strings> Values
}

Here is the list

    List<MyObject> scopeInfos = new List<MyObject>()
                                             {
                                                 new MyObject("Country")
                                                     {
                                                         Values = new List<string>()
                                                                      {
                                                                          "USA",
                                                                          "Germany"
                                                                      }
                                                     },
                                                 new MyObject("City")
                                                     {
                                                                                                                  Values = new List<string>()
                                                                      {
                                                                          "New York",
                                                                          "Berlin"
                                                                      }

                                                     },
                                                 new MyObject("Product"),
                                                 new MyObject("Shipper")
                                             };

Here Name is unique identifier, but I could not define it in grid view.

Problem is when gridview gets such object when I select "Product" row and than try to select "Shipper" both rows remain selected. If I will add Id property to MyObject selection problem gets solved. It would be nice to be able to define which column should be identity, rather than adding "ID" of type Guid property to MyObject (which solves problem) or wrapping to another object.

2 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 03 Jun 2010, 09:20 AM
Hello,

I believe that you have such problem due to the fact that Name actually is a field not a property.

All the best,
Vlad
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Alexey Oyun
Top achievements
Rank 1
answered on 03 Jun 2010, 10:06 AM
My apologies, that was problem inside MyObject  I get in the list.
Tags
GridView
Asked by
Alexey Oyun
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Alexey Oyun
Top achievements
Rank 1
Share this question
or