private void grdOfficeNotes_SelectionChanged(object sender, EventArgs e) { int currentPK = (int)grdOfficeNotes.GetCurrentRowPK(); if (currentPK > 0) { oOfficeNote.GetCurrentDataSet().Tables["OfficeNote"].DefaultView.Sort = "OfficeNoteId"; oOfficeNote.GetCurrentDataSet().Tables["OfficeNote"].DefaultView.Find(currentPK); } }It gets the correct PK but didn't change the values on the detail page.
private void grdOfficeNotes_SelectionChanged(object sender, EventArgs e) { int currentPK = (int)grdOfficeNotes.GetCurrentRowPK(); string currentPKstr = currentPK.ToString(); if (currentPK != 0) { oOfficeNote.GetCurrentDataSet().Tables["OfficeNote"].DefaultView.ApplyDefaultSort = true; int onPosition = oOfficeNote.GetCurrentDataSet().Tables["OfficeNote"].DefaultView.Find(currentPKstr); // Use the form's BindingContext object to set the position this.BindingContext[oOfficeNote.GetCurrentDataSet(), "OfficeNote"].Position = onPosition; } }I don't want to just select a dataset that only contains the single row selected from the grid because there can be hundreds of notes for the currently selected patient. They use the grid to select one they're interested in but from there, they want to see all the notes that were entered around the same time. They will want to be able to hit next and previous to follow the thread of the notes. Ideally, I would prefer not to have to change the sort order for the detail page either but I'll live with that if I must.