This question is locked. New answers and comments are not allowed.
I have a GridView that has a few ComboBoxColumns. The GridView is bound to a collection of objects. The comboboxcolumns are all bound to their respective collection of objects and their selectedvalue is set to a property of the gridview's source, which is as ID. The comboxcolumn binding is two-way so any changes made in the UI are updated in the object. Everything works fine. However there is something more I need to do.
Take for example one comboboxcolumn called 'Assistant Name'. The combobox in the column is bound to a collection of objects that have an 'ID' and 'Name' as properties. Now The GridView's itemssource has a property called 'AssistantID'. So the SelectedValueMemberPath is set to ID, DisplayMemeberPath is set to 'Name' and the 'DataMemberBinding' is set to 'AssistantID'. Now, for certain business needs, the itemssource object of the gridview also has a property called the 'AssistantName'. This is the name corresponding to the 'AssistantID'. I populate both these when I initially query the database. Now when the user makes change to the 'Assistant Name' column by picking another value in the combobox, the two-way binding automatically updates the 'AssistantID' property of the gridview itemssource object but does not update the 'AssistantName', which is the 'Name' value of the picked combobox item. Now, when I save these changes back to the database everything is fine, because the changes need to only contain 'AssistantID'. However, I also have to record the change for auditing purpose and for readability/simpliciy sake, we decided to store the 'AssistantName'. This however, as I mentioned above, is not updated.
Now, without doing any extra processing during save/recording-for-auditing, is there any way to pick up the comboboxcolumn changes into the 'AssistantName' property?
I hope I have explained well what I need.
Thanks!
Take for example one comboboxcolumn called 'Assistant Name'. The combobox in the column is bound to a collection of objects that have an 'ID' and 'Name' as properties. Now The GridView's itemssource has a property called 'AssistantID'. So the SelectedValueMemberPath is set to ID, DisplayMemeberPath is set to 'Name' and the 'DataMemberBinding' is set to 'AssistantID'. Now, for certain business needs, the itemssource object of the gridview also has a property called the 'AssistantName'. This is the name corresponding to the 'AssistantID'. I populate both these when I initially query the database. Now when the user makes change to the 'Assistant Name' column by picking another value in the combobox, the two-way binding automatically updates the 'AssistantID' property of the gridview itemssource object but does not update the 'AssistantName', which is the 'Name' value of the picked combobox item. Now, when I save these changes back to the database everything is fine, because the changes need to only contain 'AssistantID'. However, I also have to record the change for auditing purpose and for readability/simpliciy sake, we decided to store the 'AssistantName'. This however, as I mentioned above, is not updated.
Now, without doing any extra processing during save/recording-for-auditing, is there any way to pick up the comboboxcolumn changes into the 'AssistantName' property?
I hope I have explained well what I need.
Thanks!