Пример #1
0
            private int AddRowToSelection(GridView view, int handle)
            {
                RowInfo rowInfo;

                rowInfo.level = view.GetRowLevel(handle);
                if (handle < 0) // group row
                {
                    handle = view.GetDataRowHandleByGroupRowHandle(handle);
                }
                rowInfo.Id = view.GetRowCellValue(handle, descriptor.keyFieldName);
                SaveSelList.Add(rowInfo);
                return(handle);
            }
Пример #2
0
 public void SaveSelectionViewInfo(GridView view)
 {
     SaveSelList.Clear();
     CellSelection.Clear();
     int[] selectionArray = view.GetSelectedRows();
     if (selectionArray != null)  // otherwise we have a single focused but not selected row
     {
         for (int i = 0; i < selectionArray.Length; i++)
         {
             int dataRowHandle = AddRowToSelection(view, selectionArray[i]);
             if (view.OptionsSelection.MultiSelectMode == GridMultiSelectMode.CellSelect)
             {
                 GridColumn[] columns = view.GetSelectedCells(dataRowHandle);
                 string[]     names   = new string[columns.Length];
                 for (int j = 0; j < columns.Length; j++)
                 {
                     names[j] = columns[j].FieldName;
                 }
                 CellSelection[view.GetRowCellValue(dataRowHandle, descriptor.keyFieldName)] = names;
             }
         }
     }
     AddRowToSelection(view, view.FocusedRowHandle);
 }