Ejemplo n.º 1
0
        private void BindFocusedRow(GridView view, int focusedRowHandle)
        {
            object row = view.GetRow(focusedRowHandle);

            if (row != null && row.GetType() != typeof(DevExpress.Data.NotLoadedObject))
            {
                ReadonlyThreadSafeProxyForObjectFromAnotherThread proxy = (ReadonlyThreadSafeProxyForObjectFromAnotherThread)view.GetRow(focusedRowHandle);
                REGION record = (REGION)proxy.OriginalRow;
                BindingSource.DataSource = _context.REGION.Where(c => c.CODE == record.CODE);
            }
            else
            {
                ClearBindings();
            }
        }
Ejemplo n.º 2
0
 private void GridViewLookup_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
 {
     if (!_ignoreLeaveRow)
     {
         GridView view = (GridView)sender;
         object   row  = view.GetRow(e.FocusedRowHandle);
         if (row != null && row.GetType() != typeof(DevExpress.Data.NotLoadedObject))
         {
             ReadonlyThreadSafeProxyForObjectFromAnotherThread proxy = (ReadonlyThreadSafeProxyForObjectFromAnotherThread)view.GetRow(e.FocusedRowHandle);
             INVT record = (INVT)proxy.OriginalRow;
             BindingSource.DataSource = _context.INVT.Where(c => c.CODE == record.CODE);
         }
         else
         {
             ClearBindings();
         }
     }
 }