Hi,
I am creating grid at runtime.
in FieldLayoutInitialized i am creating unbound fields.
one sample unbound field is
UnboundField field = new UnboundField();
field.Name= "Testfield";
field.BindingPath = "Binding path";
FieldLayout fieldLayout;
fieldLayout.Fields.Add(field)
--------------------------------------------
But my requirement is i have a field which is calculated one so for that i created converter. coverter will ruturn sum of two values.
A3 = A1+A2;
If it is from XAML file we can write like
<Textbox.Value>
<MultiBinding Converter="{StaticResource ConvertnameClass}" Mode="OneWay"> <Binding Path="A1"/> <Binding Path="A2"/> </MultiBinding>
</Textbox.Value>.
field.Converter = coverter class object;field.ConverterParameter = ???;
if it is single binding we can send the field.BindingPath = "class prop value";
how can i send multiple binding values to converter from code behind when it is creating run time.
please help me out.
Hello,
I have created a sample project with the functionality you both want. It shows how to create a MultiBinding in code and set it to the Binding Property of the UnboundField.
Hope this helps you.
I'm looking into doing something similar. Could you provide a code example? Thanks!
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
Thank you for your post. I have been looking through it and I can say that you can create a style for the CellValuePresenter in XAML and set the MultiBinding there and after that you can apply that Style to the UnboundField’s FiledSettings CellValuePresenterStyle Property in code – behind. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.