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

DetailsGrid-column-binding

Thread ID:

Created:

Updated:

Platform:

Replies:

127297 Nov 8,2016 12:39 PM UTC Nov 15,2016 03:54 AM UTC WPF 3
loading
Tags: SfDataGrid
Juraj Tomana
Asked On November 8, 2016 12:39 PM UTC

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 01:09 PM UTC

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 07:14 AM UTC

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 15, 2016 03:54 AM UTC

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.

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

;