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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridDataUnboundVisibleColumn complex binding format

Thread ID:

Created:

Updated:

Platform:

Replies:

110262 Jul 25,2013 01:28 PM UTC Aug 1,2013 07:25 AM UTC WPF 3
loading
Tags: GridControl
JEAN MICHEL CAMIZON
Asked On July 25, 2013 01:28 PM UTC

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}'">



Gobinath A [Syncfusion]
Replied On 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.

 

 


JEAN MICHEL CAMIZON
Replied On 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.

Gobinath A [Syncfusion]
Replied On 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.

 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;