trying to capture rowchanged event for datagrid without success

  • Thread starter Thread starter astro
  • Start date Start date
A

astro

I've tried the following without success.......

AddHandler DS1.Tables("dial").RowChanged, AddressOf after_row_insert
AddHandler CType(Me.dgDials.DataSource, DataTable).RowChanged,
AddressOf after_row_insert


the 2nd raises an "invalid cast" error, neither redirects to my
'after_row_insert' event.


Any ideas why this is not working?


Thanks
 
Your fine example works when the object of interest is the dataview....but I
am interested in a child table's row change event....

let me explain the scenario:

I have a customer table. I have a dataview for this table that my
textboxes, comboboxes, etc. are bound to. This is not a defaultview, it is
a custom dataview that I filter, sort and searh on.

I have a datagrid which is bound to the relation between the dataview and a
child table. I want to trap the rowchange event of this datagrid. It's
datasource is dv1 (my dataview), it's datamember is the relation between the
parent and child table: companydial.

I think the currenyManager idea will work.....just don't know how to point
it to this 'child' datagrid.

Any ideas?
 
Astro,
I think the currenyManager idea will work.....just don't know how to point
it to this 'child' datagrid.

Any ideas?
Almost the same as in your first post in this thread.

Dim cma As CurrencyManager = DirectCast _
(BindingContext(DirectCast(dgdials.datasource,dataview)),
CurrencyManager)

I changed it here so watch typos,

I hope this helps,

Cor
 
thanks - that works for the rowchange on the dataview...but not when I
change rows in the dial datagrid....
 
Astro,

This does something more than the rowchange in a datagrid. This fires when
there is a selected rowchange in the datagrid even when the datarow in the
table is not changed.

Cor
 
thanks for your diligent replies Cor........

I"m taking a break from this approach..........in working through this
problem I think I have a better idea of the coupling between the grid and
the underlying data table. It seems to be better to trap & save the row
changes at the table.rowchanges event then hooking into the grid events via
a reference to a currency manager..


-)
 

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

Back
Top