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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How can i bind to GridComboBoxColumn's ItemsSource (in SfDataGrid) in code behind.

Thread ID:

Created:

Updated:

Platform:

Replies:

114894 Dec 12,2013 08:34 PM UTC Jan 29,2014 08:36 AM UTC WPF 5
loading
Tags: GridControl
Om Thapa
Asked On December 12, 2013 08:34 PM UTC

I need to bind to the GridComboBoxColumn ItemsSource in code behind. But I can't find a way to do it.
Is there a way to do it?

Narayanasamy J [Syncfusion]
Replied On December 17, 2013 01:08 PM UTC

Hi Om,

 

Thanks for contacting Syncfusion support.

 

We have analysed your query. In code behind by using BindingOperations.SetBinding method you can bind the ItemsSource for GridComboBoxColumn. We have prepared a sample based on this and it can be downloaded from the following location.

 

Sample link: GridComboBoxColumn.zip

 

Please let us know if you need further assistance.

 

Regards,

Narayanasamy

 


heromyth
Replied On January 4, 2014 05:28 AM UTC

The link has broken.

Jai Ganesh S [Syncfusion]
Replied On January 6, 2014 10:28 AM UTC

Hi heromyth,

 

We apologize for the inconvenience caused.

 

We faced some technical issue in our server, hence the sample was not downloaded from the uploaded link. However we have uploaded the sample again to the server and please find the sample location below,

 

Sample: GridComboBoxColumn.zip

 

Please let us know if you have any queries.

 

Thank you,

Jai Ganesh S


Om Thapa
Replied On January 14, 2014 09:49 PM UTC

Hi,
I am using the index binding as MappingName for a GridComboBoxColumn. And I need to get the item source from the same object I am bound to. But I can't figure out how to do it.
Scenario: I have a Customer object which has a dictionary containing cells. So, 
MappingName  is something like "Cells[CellName].Value". And the item source is also in the same object pointed by the binding "Cells[CellName].ComboBoxList".

I tried to use the BindingOperations, as you explained above but I don't have the source to bind to, as it is determined dynamically by the grid.
Thanks,
Om



Jai Ganesh S [Syncfusion]
Replied On January 29, 2014 08:36 AM UTC

Hi Om,

 

Thank you for using Syncfusion products.

 

We have analyzed your query. You can not directly set the index binding as a ItemSource  for a GridComboBoxColumn. However you can achieve your requirement by writing the  Custom GridCellComboBoxRenderer class and override the OnInitializedEditElement method. We have prepared the sample based on this and please find the sample under the following location:

 

Sample: SfDataGridComboboxSample Dictionary.zip

 

Please let us know if you need further assistance.

 

Thank you,

Jai Ganesh S


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

;