コード例 #1
0
        private void AuthorsDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            DataGrid     dataGrid  = sender as DataGrid;
            DataGridRow  row       = (DataGridRow)dataGrid.ItemContainerGenerator.ContainerFromIndex(dataGrid.SelectedIndex);
            DataGridCell RowColumn = dataGrid.Columns[1].GetCellContent(row).Parent as DataGridCell;
            string       LastName  = ((TextBlock)RowColumn.Content).Text;

            RowColumn = dataGrid.Columns[2].GetCellContent(row).Parent as DataGridCell;
            string FirstName = ((TextBlock)RowColumn.Content).Text;

            DataRow[] _authors = _authorTableModel.FindAuthors(LastName, FirstName);
            _selectedAuthor = _authorTableModel.ConvertDataRowToAuthor(_authors[0]);
        }
コード例 #2
0
 private void PreShowSetSelectAuthorsListBox(object sender, RoutedEventArgs e)
 {
     _authors = _authorTable.FindAuthors(TB_SelectAuthorLastName.Text, TB_SelectAuthorFirstName.Text);
     AddRowsToListBox();
 }