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

DetailsGrid-column-binding

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

3 Replies

SV Srinivasan Vasu Syncfusion Team 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 
 



JT Juraj Tomana 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






SV Srinivasan Vasu Syncfusion Team 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 


Loader.
Up arrow icon