How Do You Display Multiple Child Items in a ListBox or DataGrid?

  • Thread starter Thread starter Phil Galey
  • Start date Start date
P

Phil Galey

I have three tables in an XML file containin a list of programs written and
the systems on which they are installed: the Programs table, the Systems
table, and the ProgramsSystems table. The ProgramsSystems table lists the
IDs for the combinations of Programs and Systems.

I'm trying to bind a datagrid or a listbox to a dataset/dataview/datatable
such that when a current program is displayed on the form, the datagrid or
listbox list all the systems, but with only those highlighted on which the
program is installed. It would always list all the systems, with only a
subset highlighted.

Is the datagrid or the listbox a more straighforward control to use for
that? And is there some sample code available that shows how this is done?
Thanks.
 
Cor,

Thanks. Your method is quite useful and I'm going to use it in my program.
But I was really talking about the situation where you can specify possibly
more than one child item. So for example, if your program were to show a
list of countries that the selected person has visited, rather than just the
one they are from.

Phil
 
Phil,

That is standard very easy when you show only the countries from that
persons, however when you want them show hem selected where the others still
stay, than it will take probably more work. And not using the datagrid,
because that has AFAIK no multiselect.

Cor
 
Back
Top