private void gridView3_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e) { PalletLocation pl = new PalletLocation(); DataRow dr = gridView3.GetFocusedDataRow(); if (dr != null) { DataRow dr2 = gridView5.GetFocusedDataRow(); int excludePalletLocationID = Convert.ToInt32(dr["ID"]); int itemID = Convert.ToInt32(dr2["ID"]); gridDestination.DataSource = pl.GetLocationForItemsExclude(itemID, excludePalletLocationID); } }