BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
private bool col2Check = false; private void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e) { if(e.TableCellIdentity.TableCellType == GridTableCellType.ColumnHeaderCell && e.TableCellIdentity.Column.Name == "Col2") { e.Style.CellType = "CheckBox"; e.Style.Description = e.Style.Text; e.Style.CellValue = this.col2Check; e.Style.Enabled = true; //e.Style.BackColor = SystemColors.Window; //e.Style.CellAppearance = GridCellAppearance.Raised; } } private void gridGroupingControl1_TableControlCellClick(object sender, GridTableControlCellClickEventArgs e) { GridTableCellStyleInfo style = e.TableControl.Model[e.Inner.RowIndex, e.Inner.ColIndex]; if(style.TableCellIdentity.TableCellType == GridTableCellType.ColumnHeaderCell && style.TableCellIdentity.Column.Name == "Col2") { this.col2Check = !this.col2Check; e.Inner.Cancel = true; } }
Record r = style.TableCellIdentity.ParentRecord;
int rowIndex = r.ParantTable.DisplayElements.IndexOf(r);
Stefan
>Clay,
> I have check boxes in the header cell of nested table. Then I need Col2Check variable to be a array of boolean values. My question to you is How do i get the row index of the parent table so i can store whether the check box is checked or not.
Element columnHeaderRow;
ChildTable childTable = columnHeaderRow.ParentChildTable;
NestedTable nestedTable = childTable.ParentNestedTable;
Record parentRecord = nestedTable.ParentRecord;
The key is to get first the ChildTable.ParentNestedTable and on that nested table call ParentRecord.
Stefan
>stefan,
> I''m trying to get parent record in QueryCellStyleInfo event. ParentRecord is always nothing. Any suggestion. Thanks