Focus on new inserted row

G

Guest

Hi,
I have DataTable and I perform Rows->AddRow on it. New record is created
and it is visible in datagridview. But how to make new record as focused one
after below operation.
DataRow^ dataRow;
dataRow = MyTable->NewRow();
dataRow[1] = "shit happens";
MyTable->Rows->Add(dataRow);
????MyDataGridView->FocusedRow = dataRow ;

Thanks,
Peter
 
W

W.G. Ryan eMVP

I believe the Property is Selected that you want - just pass in Rows.Count
setting selected to it and it should work
 

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