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.
Unfortunately, activation email could not send to your email. Please try again.

DetailsGrid-column-binding

Thread ID:

Created:

Updated:

Platform:

Replies:

127297 Nov 8,2016 07:39 AM Nov 14,2016 10:54 PM WPF 3
loading
Tags: SfDataGrid
Juraj Tomana
Asked On November 8, 2016 07:39 AM

Hi.

I'm using MVVM pattern and I have grid with details-grid records. How can I bind for example GridComboBoxColumn.ItemsSource to my ViewModel?

Thanks.
Regards,
Juraj

Srinivasan Vasu [Syncfusion]
Replied On November 9, 2016 08:09 AM

Hi Juraj, 

Thanks for contacting Syncfusion support. 

We have checked your query and you can bind the ViewModel property to the ItemsSource of GridComboBoxColumn like the below code example. 
Please refer the below code example. 
Code Example[XAML]: 
<syncfusion:GridComboBoxColumn HeaderText="Customer Area" 
                                                            ItemsSource="{Binding Path=ComboBoxItemsSource, 
                                                            Source={StaticResource orderInfoRepository}, 
                                                                           Mode=TwoWay}" 
                                                            MappingName="CustomerCity" /> 
 
 
  
If your requirement is differ from this, please let us know the more details about your requirement. 
 
Regards, 
Srinivasan 
 


Juraj Tomana
Replied On November 10, 2016 02:14 AM

Hi.

Thanks, but I really can't bind to Resources of View. I have dynamically generated views and I can bind just to some visual ancestor's data-context.

Something like:

<MyView>

...

<SfDataGrid>
...
<SfDataGrid.DetailsViewDefinition>

....
<syncfusion:GridComboBoxColumn HeaderText="Customer Area" 
                                                            ItemsSource="{Binding Path=DataContext.ComboBoxItemsSource, RelativeSource={RelativeSource FindAncestor, Type=myView}" 
                                                            MappingName="CustomerCity" /> 


.... but this doesn't work.

Thanks.
Regards,
Juraj





Srinivasan Vasu [Syncfusion]
Replied On November 14, 2016 10:54 PM

Hi Juraj,

 
We will provide workaround for your query. A support incident to track the status of this feature has been created under your account. Please log on to our support website to check for further updates 
  
Please let me know if you have any questions. 
  
Regards, 
srinivasan 


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.

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.

;