We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

GridDataUnboundVisibleColumn complex binding format

Hi,

I'm trying to display a person last name + first name in one column with the GridDataUnboundVisibleColumn but so far it's not working...

My grid is binded to a ObservableCollection of Couples, and each Couple contain a Man and a Girl object.

This is what I did, and it's thowing an 'System.Reflection.TargetInvocationException' :

<SF:GridDataUnboundVisibleColumn HeaderText="Girl" Format="'{Girl.LastName} {Girl.FirstName}'">
<SF:GridDataUnboundVisibleColumn HeaderText="Man" Format="'{Man.LastName} {Man.FirstName}'">



3 Replies

GA Gobinath A Syncfusion Team July 30, 2013 04:42 PM UTC

Hi Jean Michel,

Sorry for the delay in getting back to you.

We have analyzed your code snippet and it will work only in normal property so if you are using complex property then you have to use following the code snippet for combine two property value in single column.

 

Code snippet[XAML]:

 

<syncfusion:GridDataUnboundVisibleColumn HeaderText="ComplexProperty">

 <syncfusion:GridDataUnboundVisibleColumn.CellItemTemplate>

    <DataTemplate>

         <Grid>

            <Grid.ColumnDefinitions>

              <ColumnDefinition Width="40" />

              <ColumnDefinition Width="*" />

            </Grid.ColumnDefinitions>

            <TextBlock Grid.Column="0" Text="{Binding Path=Record.Data.Complex.EmpID}" />

            <TextBlock Grid.Column="1" Text="{Binding Path=Record.Data.Complex1.EmpName}"/>

          </Grid>

     </DataTemplate>

 </syncfusion:GridDataUnboundVisibleColumn.CellItemTemplate>

</syncfusion:GridDataUnboundVisibleColumn>

 

 

We have prepared simple sample based on your requirement and please find the sample under the following location.

 

Sample: GDC_ComplexPropertyBinding.zip

 

Please let us know if you have any queries.

 

Regards,

Gobinath A.

 

 



JM JEAN MICHEL CAMIZON July 31, 2013 01:18 PM UTC

Hi,

Thank you for your response, this "Record.Data" is exaclty what I was looking for to be able to use Templates. It's perfect.


GA Gobinath A Syncfusion Team August 1, 2013 07:25 AM UTC

 

Hi Jean Michel,

 

Thanks for the update,

 

Please let us know if you have any other concerns

 

Regards,

Gobinath A.

 


Loader.
Live Chat Icon For mobile
Up arrow icon