public static void Refresh <T>(GridListControl gridControl, IList <T> record) { gridControl.Grid.Model.RowCount = record.Count; gridControl.Refresh(); if (record.Count > 0) { gridControl.SetSelected(0, true); } }
public static void Refresh <T>(GridListControl gridControl, IList <T> record, int additionalRowCount = 0) { gridControl.Grid.Model.RowCount = record.Count + additionalRowCount; gridControl.Refresh(); if (record.Count > 0) { gridControl.SetSelected(additionalRowCount, true); } }
public static void AddObject <T>(GridListControl gridControl, IList <T> record, T obj, bool isLastRowFocus = true) { record.Add(obj); gridControl.Grid.Model.RowCount = record.Count; gridControl.Refresh(); if (isLastRowFocus) { gridControl.SetSelected(gridControl.Grid.RowCount - 1, true); } }
public static void RemoveObject <T>(GridListControl gridControl, IList <T> record, T obj) { record.Remove(obj); gridControl.Grid.Model.RowCount = record.Count; gridControl.Refresh(); if (record.Count > 0 && gridControl.SelectedIndex != 0) { gridControl.SetSelected(gridControl.SelectedIndex - 1, true); } }
public static void UpdateObject <T>(GridListControl gridControl, IList <T> record, T obj) { record[gridControl.SelectedIndex] = obj; gridControl.Refresh(); }
public static void UpdateObject <T>(GridListControl gridControl, IList <T> record, T obj, int additionalRowCount = 0) { record[gridControl.SelectedIndex - additionalRowCount] = obj; gridControl.Refresh(); }