private bool FindTypeID(UltraGridChildBand band, string typeID) { if (band.Rows.Count > 0) { foreach (UltraGridRow row in band.Rows) { if (row.ChildBands == null) { if (row.Cells["TypeID"].Value.ToString() == typeID) { row.Activate(); return(true); } } else { foreach (UltraGridChildBand childband in row.ChildBands) { if (FindTypeID(childband, typeID)) { return(true); } } } } } return(false); }
private void ultraGrid1_CellChange(object sender, CellEventArgs e) { // Use the BeforeEnterEditMode event to position the edit controls UltraGridCell objCell = this.ultraGrid1.ActiveCell; // This should be impossible, but its good practice to check // to make sure there is an active cell before continuing if (objCell == null) { return; } // Get the UIElement associated with the active cell, which we will // need so we can get the size and location of the cell if (objCell.IsDataCell && objCell.Band.Key == "Level1") // change cost for weights { if (objCell.Column.Key == " ") { UltraGridChildBand band = null; if (objCell.Row.Cells["Section"].Value.ToString() == "Sub Type Catalogs") { band = objCell.Row.ChildBands["SubTypeCatalogs"]; } else if (objCell.Row.Cells["Section"].Value.ToString() == "Tracker Infos") { band = objCell.Row.ChildBands["Trackers"]; } if (band != null) { foreach (UltraGridRow row in band.Rows) { row.Cells[" "].Value = !(bool)objCell.Value; } ultraGrid1.UpdateData(); ultraGrid1.Refresh(); } } } }