Print Page | Close Window

ListConverter for DataTable

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=890
Printed Date: 11-Jun-2026 at 12:00am


Topic: ListConverter for DataTable
Posted By: vecs
Subject: ListConverter for DataTable
Date Posted: 16-Jul-2008 at 1:43am
In my example I have an EditorView for Product entity with ComboBox control binded to Product.SupplierId property. Also I have DataTable contained data on suppliers having "Id" and "Name" fields.
I`d like to screw this suppliers table up to ComboBox dropdown list so "Id" and "Name" field values be treated as ValueMember and DisplayMember (surely I use ControlBindingManager for binding).
Suppliers table have no corresponding Supplier entity type in my module because this table is coming as additional dictionary from 3rd party source..

Is it possible to use DataTable as source of values for ComboBox control? How should I setup ListConverter for corresponding BindingDescriptor?



-------------



Replies:
Posted By: davidklitzke
Date Posted: 16-Jul-2008 at 4:02pm
Look at the Advanced Tutorial on "Binding to Non-Persistable Objects".  The real problem is not than we can't bind to non-persistable objects.  That is easy enough to do.  The real problem is that we can't save the changes.



Print Page | Close Window