hi oliver thanks for your help i kinda figured that out minutes
afterwards...but what i am actually trying to do is this:
i have a listbox control that gets its data from another listbox (hence gets
a subset by selecting from the first list box) and i have a datagrid which
has a template column and a bound column, i want to bind the bound column to
this second listbox and then its template column implements a dropdownlist
for every bound column item, now this dropdownlist (in the template column of
the datagrid) i want to bind it to a dataset's datatable
I have already created a dropdownlist that gets the data from a dataset but
how do i implement this whithin the datagrid in a
<templatecolumn><itemTemplate>
i cant seem to do this can you please help?
"Oliver Sturm" wrote:
ShadowsOfTheBeast wrote:
hi all i am trying to bind data to my datagrid from a listbox which i think
it should work but an error is coming up saying i have to bind to a
datasource that implements the Inumerable or icollection...but i thought
list
boxes did implement one of the above as they do have their items collection
property,
I'm not completely sure I understand you correctly - a bit of sample code
about what you are doing could have helped. But I assume you are trying to
bind the list box directly to the grid, like this:
myDataGrid.DataSource = myListBox;
This won't work because it's not the list box that implements the
collection interface, it's only the object returned by the Items property.
This is a special collection for use with the ListBox and it implements
IList. So you should be fine if you use a line like this to do the binding:
myDataGrid.DataSource = myListBox.Items;
Oliver Sturm
--
omnibus ex nihilo ducendis sufficit unum
Spaces inserted to prevent google email destruction:
MSN oliver @ sturmnet.org Jabber sturm @ amessage.de
ICQ 27142619 http://www.sturmnet.org/blog