C
Craig Buchanan
I have an class, named MessageTemplate, that has three properties: Name,
Description, and Tokens. The Name and Description properties are strings.
The Tokens property, however, is a KeyedCollection of the Token class. The
Token class has two string properties: Name and Pattern.
I have a third class, named MessageTemplateAdapter, that manages the
MessageTemplate's CRUD processes to a single XML file. This works
correctly.
I am in the midst of creating a form to add/edit the MessageTemplate class.
I've created an ObjectDataSource to tie the MessageTemplateAdapter to a
DetailsView. This works as expected for the Name and Description
properties.
I would like to bind the MessageTemplate's Tokens collection to a GridView
on the same form, then use the GridView to add/edit each Token. Moreover, I
want the DetailsView's Insert/Update methods to save the collection's data
along w/ the Name and Description properties. Essentially, I want to save
the parent and the child together.
While I'm able to bind the Tokens collection to GridView in the
DetailsView's DataBound event (the DetailView's DataItem), I haven't been
able to get the GridView's Edit/Delete/Insert to work.
Does anyone have a recommendation on how to handle complex data binding like
this?
Thanks in advance,
Craig
Description, and Tokens. The Name and Description properties are strings.
The Tokens property, however, is a KeyedCollection of the Token class. The
Token class has two string properties: Name and Pattern.
I have a third class, named MessageTemplateAdapter, that manages the
MessageTemplate's CRUD processes to a single XML file. This works
correctly.
I am in the midst of creating a form to add/edit the MessageTemplate class.
I've created an ObjectDataSource to tie the MessageTemplateAdapter to a
DetailsView. This works as expected for the Name and Description
properties.
I would like to bind the MessageTemplate's Tokens collection to a GridView
on the same form, then use the GridView to add/edit each Token. Moreover, I
want the DetailsView's Insert/Update methods to save the collection's data
along w/ the Name and Description properties. Essentially, I want to save
the parent and the child together.
While I'm able to bind the Tokens collection to GridView in the
DetailsView's DataBound event (the DetailView's DataItem), I haven't been
able to get the GridView's Edit/Delete/Insert to work.
Does anyone have a recommendation on how to handle complex data binding like
this?
Thanks in advance,
Craig