public override void OnInitializeDisplayView(DataColumnBase dataColumn, UILabel view) { base.OnInitializeDisplayView(dataColumn, view); var gridcell = dataColumn.GetType().GetRuntimeProperties().FirstOrDefault(x => x.Name.Equals("Element")).GetValue(dataColumn); (gridcell as UIView).BackgroundColor = UIColor.FromRGB(225, 245, 254); }
protected override void OnRender(Graphics paint, Rectangle cellRect, string cellValue, CellStyleInfo style, DataColumnBase column, RowColumnIndex rowColumnIndex) { if (column.GridColumn.MappingName == "IsClosed") { DataRowBase dataRow = (DataRowBase)column.GetType().GetProperty("DataRow", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).GetValue(column); if ((dataRow.RowData as OrderInfo).Quantity > 50) { paint.FillRectangle(new SolidBrush(style.BackColor), cellRect); } else { base.OnRender(paint, cellRect, cellValue, style, column, rowColumnIndex); } } }