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
close icon

Binding Combobox contents within a GridDataControl

Hi,

I'm busy evaluation your data grid.
I've noticed all your ComboBox-in-cell examples bind the combobox contents to a static resource:

E.g.


How would one bind the combobox contents (ItemsSource) to a (ObservableCollection) property on the data model assigned to the page.

E.g. (pseudo code)

class MyModel
{
List ItemsInGrid;
List LookupItemList;
}

in page code-behind, constructor:
{
DataContext = new MyModel();
}

in XAML, within GridDataControl, CellEditItemTemplate containing Combobox:




i.e. how do I bind to my DataContext.LookupItemList list?




2 Replies

PA Pavel September 29, 2010 11:36 AM UTC

Give some x:Name to your page (i use cotrolRoot everywhere for this)

Then just use ElementName binding:







JJ Jeraldes J Syncfusion Team October 12, 2010 10:16 AM UTC

Hi,

Sorry for the delay caused.

Hi Pavel thanks for your update regarding this answer you provided.

Let us know if you need any other details.

Regards,
Jeraldes J



Loader.
Live Chat Icon For mobile
Up arrow icon