private void lstBooks_SelectedIndexChanged(object sender, EventArgs e)
{
ListBox theListBox = null;
DataRowView bookView = null;
DataRow book = null;
System.Collections.IList lendings = null;
int count = 0;
// Get the selected DataRow from Books
theListBox = sender as ListBox;
bookView = theListBox.SelectedItem as DataRowView;
book = bookView.Row;
// Get all the rows from Lendings using the DataRelation created in BuildRelationship()
lendings = book.GetChildRows(library.Relations["BookHistory"]);
// Clear the DataGridView and re-populate it with the rows from Lendings for that book
dgvLendHistory.DataSource = null;
dgvLendHistory.DataSource = lendings;
}