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

GridViewDataColumn data binding to UniqueName - why?

5 Answers 523 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Tyree
Top achievements
Rank 2
Tyree asked on 02 Aug 2010, 07:44 AM
If I don't define a DataMemberBinding (and I don't want one) but I set UniqueName I get binding errors for whatever value I entered into UniqueName. This makes no sense to me. I want to use the UniqueName for grid manipulation but with all the failed binding it slows the grid to a crawl. Based on the property name and the tiny mention in the documentation I assumed it was a string for users to do with as they wished. Why is it trying to use the string for binding if DataMemberBinding is missing? How can I avoid this without defining a DataMemberBinding?

5 Answers, 1 is accepted

Sort by
0
Yordanka
Telerik team
answered on 02 Aug 2010, 09:58 AM
Hello Tyree,

It will be better to send us a sample project where the problem can be reproduced.  If this is not possible for you please give us some more details about the grid and the defined columns.

Best wishes,
Yordanka
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
Valentin Raceanu
Top achievements
Rank 1
answered on 05 Sep 2011, 03:49 PM
I have the same problem. I too want to use UniqueName but this creates (why?) a binding for column. I am sending a link with the sample. Try to run the application with UniqueName set and unset for first column.

https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0B88SmcJsxJySNDU0MzI3ODItOWNhZC00NWYyLWJkZWQtNzUyYzExZDRlNWU4&hl=en_US

Regards,
Vali
0
Rossen Hristov
Telerik team
answered on 05 Sep 2011, 03:56 PM
Hello Valentin Raceanu,

The UniqueName is a "ghost from the past" property that we are currently trying to obsolete. The correct way to bind columns is to use the DataMemberBinding property. Please, don't use UniqueName. It was left for compatibility purposes only and will soon be gone, I hope.

Regards,
Ross
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Valentin Raceanu
Top achievements
Rank 1
answered on 05 Sep 2011, 04:40 PM
Do you have any ideas how I could identify a column than? Silverlight GridViewColumns doesn't have a Name property.

Thanks!
0
Rossen Hristov
Telerik team
answered on 05 Sep 2011, 04:43 PM
Hello Valentin Raceanu,

If the column was bound to "LastName" with DataMemberBinding for example, you can get it back like this:

column.DataMemberBinding.Path.Path

will return "LastName".

You can add checks for null before each consecutive property access of course. However, this is not unique, since we can have 10 columns bound to "LastName', but I doubt that you will actually do that in your real-world project.

I hope this helps.

Best wishes,
Ross
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
GridView
Asked by
Tyree
Top achievements
Rank 2
Answers by
Yordanka
Telerik team
Valentin Raceanu
Top achievements
Rank 1
Rossen Hristov
Telerik team
Share this question
or