Rabu, 04 Februari 2009

Multiple datagrids in a master/detail form. vb 2005


Hey again all.

I have a form with one master datagrid view and three detail datagridviews.

In the Form Load event I define the datasource for the master datagridview.

In the masterdatagridview_selectionchanged event I define the datasource for the other datagrids according to the row selected in the master grid.

The problem with this is that the selectionchanged event triggers in the form load event as each new record is added to the masterdatagridview.

I could get around this by using the mouseup event instead of the selectionchanged event, but then I am killing all keyboard navigation support.

Is there a better way of doing this?

Regards

Dave


Edited by - fibaoptix on 5/3/2008


Dave,

Try this sequence of operation...

1. dgMasterDataGridView.SuspendLayout

2. Load your datasource then assign it to the grid

3. dgMasterDataGridView.ResumeLayout

I use a third party grid control by Syncfusion as it offer more more 'control' over data presentation and event handling.

Scott




source :http://www.vbcity.com

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

Trik Gambar Bergerak

Trik Gambar-dimouse

Trik hapus pwd mysql

Trik insertin to db

Trik jadi root dilinux

Trik jam-distatus-bar

Trik Koneksi-ke database

Trik Koneksi-msql-php

Trik lihat-database-mysql

Trik membahas-fungsi-else

Trik member-area