views:

44

answers:

0

I am looking at DataGridView to assist with the following functionality without DataSet/Table usage.

I am replacing few columns with the DataGridViewComboBox. As a specific and slightly contrived example below, I am replacing AccessID column on BindingList (of Setting) :

class Setting { public int AccessID { get { return ... } set { ... } } }

class Access {

//This is implicit from List index => public int ID { get { return .. } }

public int Name { get { return .. } set { ... } } }

What I am trying to achieve is DisplayMember of Access instance Name to change/set the AccessID property of Setting instance.

So far I'm setting up the columns and binding for the grid. While doing that a List or BindingList (of Access instances) is available, and I set relevant combobox columns' DataSource to it.

Whilst replacing specific columns of interest, the constraint is that Setting type cannot have additional data members, and Access type is not suitable for an enumerated type application (ie. it's dynamic).

Q: Is it possible to reflect/set the change to the AccessID property via a combobox column on a grid?

Thanks in advance.