Master-Detail Datagrids...bind to a button

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?
 
J

John Celmer

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;

}
 

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