I have search for this for a while now and feel like an idiot for asking. However, how can I determine the binding path for a given CellValuePresenter. I have looked at the field, the cell, and the CellValuePresenter's template and can not find the binding path anywhere. Is this possible?
Thank you
Devin
Hello dnapoleon518,
I have been reading though your post and I am not completely sure I understand what is the functionality that you are looking for. I assume that you wish to determine to which property of the data object, given CellValuePresenter is bound. If my assumption is correct you can use the Name property of the Field that corresponds to the CellValuePresenter, since the property to which a Field is bound is determine by the Name property. For example if you have property named ID in your data object the field that corresponds to that property will have its Name property set to "ID".
Please let me know if this is what you are looking for or I have misunderstood you in any way.
I excluded a key piece of information. I want to do this for Unbound Fields that have been bound. As I understand it, using unbound fields in the only way to bind to a complex source. My source is a LINQ query that Joins two Business Objects together.
Dim test = From x in x_set Join y In y_set On x.id Equals y.id Order By x.date
<igDP:UnboundField BindingPath="x.Name" BindingMode="TwoWay" Label="Name" Width="auto" />
<igDP:UnboundField BindingPath="y.Name" BindingMode="TwoWay" Label="Name" Width="auto" />
Thank you for your reply.
I have read your last post and it seems that your LINQ query is without select statement and I can’t understand what exactly you would like to select from the database. Could you please give me your whole LINQ query or provide me with a small, isolated sample application with your database.
I am looking forward to hearing from you.
There is no database, this is a Business Object. Also, there is no select statement. I figured out how to do it by looking at the Infragistic's source code. The cell.cs file has a class called UnboundCell which has a method called VerifyBindingStatus which led me to the answer.
I check the CellValueProvider to get the field property, I then check the type to see if the Field is an UnboundField. Next, I convert the Field to an UnboundField and dim a PropertyPath equal to the UnboundField's BindingPath.
Furthermore, the result of a LINQ to Objects query without a select statement is the only way that I can bind to a source and not lose the events associated with source objects (x_set and y_set) in the query. This results in a complex binding expression which has an enumerable of an anonymous type that has two properties that point to x_set and y_set. Which is the reason for using UnboundFields. The only question that remains is, can you bind a Field (not an UnboundField) to a complex binding expression (x.id).
I am just checking if my last reply was helpful for you.
If you require any further assistance please do not hesitate to ask.
This is resolved I apologize that I didn't mark an answer sooner. The the propertypath was the key in code behind.
Thanks
Thank you for feedback.
If you have any other questions feel free to ask.