private void _docStructure_AfterCheck(object sender, GridAfterCheckEventArgs e) { if (e.Item is GridRow row && row.Tag is IPropertyType propertyType && row.GridPanel.Parent is GridRow parent && parent.Tag is IPlaceholder placeholder) { var field = row.Cells.FirstOrDefault()?.Value?.ToString(); if (!string.IsNullOrWhiteSpace(field)) { var ignored = GetIgnoredFields(placeholder.Name)?.ToArray(); if (row.Checked && (ignored?.Contains(field) ?? false)) { SetIgnoredFields(placeholder.Name, ignored.Where(x => string.CompareOrdinal(x, field) != 0)); } else if (!row.Checked && !(ignored?.Contains(field) ?? false)) { var list = new List <string>(); if (ignored?.Any() ?? false) { list.AddRange(ignored); } list.Add(field); SetIgnoredFields(placeholder.Name, list); } } } }
private void supergrid_AfterCheck(object sender, GridAfterCheckEventArgs e) { //选择 GridRow gr = (GridRow)e.Item; string id = gr["PlSerialNum"].Value.ToString(); if (gr.Checked) { if (!checkedIDs.Contains(id)) { checkedIDs.Add(id); } } else { if (checkedIDs.Contains(id)) { checkedIDs.Remove(id); } } }
/// <summary> /// Handles row CheckBox checked changes /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SuperGridControl1AfterCheck( object sender, GridAfterCheckEventArgs e) { GridRow crow = e.Item as GridRow; // If the check state is going from unchecked to // checked, then add anew sub panel under the the // row that was checked. if (crow != null && crow.Checked == true) { GridPanel panel = new GridPanel(); InitPanel(panel); crow.Rows.Add(panel); // Since we are always adding the row to the end // of the list, lets make sure it is visible on the screen panel.EnsureVisible(true); } }