Data Grids As Goood Looking List Boxes

O

orekinbck

Hi There

Using C# forms, I have a main screen that contains 2 data grids.
* The data grids are connected to ArrayLists (each grid has its own
ArrayList)
* The data grids are intended for display purposes only
* When the user clicks on a cell I want the whole row to select
* The user can only select one row at a time
* I want to wire up the two data grids so that changing the selected
row in one data grid changes the selected row in the other data grid

I have spent 2 days trying to get the grids to behave properly, and
just cannot get over the line ...

Am I using data grids for the wrong purpose? Is there another control I
can use ? Please bear in mind that the user wants each 'list' to have
columns and borders around each cell.

Oh, and if u have managed to get two data grids to work together in the
way I am trying to, pppllleeeaaasssee let me know!

Thanks In Advance
Bill
 
D

Dmytro Lapshyn [MVP]

Hi,

You can actually use regular ListViews with grid lines turned on.
You will have to implement the synchronization manually though, but given
you populate the lists from ArrayLists, it should come down to just keeping
track of the index of the currently selected row.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top