Master-Detail Datagrids...bind to a button

  • Thread starter Thread starter John Celmer
  • Start date Start date
J

John Celmer

I have two datagrids with tables in a typed dataset that has a DataRelation.
How do I get a button's click event to move the cursor in the datagrid one.
I tried this in the click event handler:

BindingManagerBase* bm = this->BindingContext->Item[datasetX->TableA];

bm->Position = bm->Position + 1;

But it don't move the cursor. Can anyone prove some advice, please?
 
John Celmer said:
I have two datagrids with tables in a typed dataset that has a
DataRelation. How do I get a button's click event to move the cursor in the
datagrid one. I tried this in the click event handler:

BindingManagerBase* bm = this->BindingContext->Item[datasetX->TableA];

bm->Position = bm->Position + 1;

But it don't move the cursor. Can anyone prove some advice, please?

Here's the solution I found.

private: System::Void button1_Click(System::Object * sender,
System::EventArgs * e){

dataGrid1->CurrentRowIndex = dataGrid1->CurrentRowIndex + 1;

}
 
Back
Top