// not needed with builds after 532... int FindRowRegex(C1FlexGridBase grid, string pattern, int rowStart, int col, bool wrap) { // null? found (allow searching for empty strings though) if (pattern == null) { return(rowStart); } // search for the string for (int row = rowStart; row < grid.Rows.Count; row++) { var str = grid.GetDataDisplay(row, col); if (str != null && Regex.IsMatch(str, pattern)) { return(row); } } // not found, wrap from top if (wrap) { for (int row = grid.Rows.Fixed; row < rowStart; row++) { var str = grid.GetDataDisplay(row, col); if (str != null && Regex.IsMatch(str, pattern)) { return(row); } } } // not found return(-1); }
//---------------------------------------------------------------------- #region ** object model /// <summary> /// Connects or disconnects this <see cref="GridRenderer"/> to a given /// <see cref="C1FlexGrid"/>. /// </summary> public void SetRenderer(C1FlexGridBase grid, bool value) { if (value != GetRenderer(grid)) { if (value) { _grids[grid] = true; grid.Renderer = _editor.Renderer; } else { _grids.Remove(grid); grid.Renderer = null; } } }
public override void OnDrawCell(C1FlexGridBase flex, OwnerDrawCellEventArgs e, C1FlexGridRenderer.CellType cellType) { if (cellType == CellType.ColumnHeader) { using (var brush = GetHeaderBrush(e.Bounds)) { // paint the cell background e.Graphics.FillRectangle(brush, e.Bounds); // paint the border and content e.DrawCell(DrawCellFlags.Border | DrawCellFlags.Content); } } else { base.OnDrawCell(flex, e, cellType); } }
public override void OnDrawCell(C1FlexGridBase flex, OwnerDrawCellEventArgs e, C1FlexGridRenderer.CellType cellType) { try { if (cellType == CellType.Highlight) { if (e.Style.Name == "Modified") { cellType = CellType.RowHeaderSelectedHot; CellRange rg = flex.GetCellRange(e.Row, 1, e.Row, flex.Cols.Count - 1); rg.Style = flex.Styles["Modified"]; } else if (e.Style.Name == "Added") { cellType = CellType.RowHeaderSelectedHot; CellRange rg = flex.GetCellRange(e.Row, 1, e.Row, flex.Cols.Count - 1); rg.Style = flex.Styles["Added"]; } else if (e.Style.Name == "Detached") { cellType = CellType.RowHeaderSelectedHot; CellRange rg = flex.GetCellRange(e.Row, 1, e.Row, flex.Cols.Count - 1); rg.Style = flex.Styles["Detached"]; } else { cellType = CellType.Normal; // cellType = CellType.ColumnHeaderSelected; } } base.OnDrawCell(flex, e, cellType); }catch{} }
public bool GetRenderer(C1FlexGridBase grid) { return(_grids.ContainsKey(grid)); }