BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
//in form load, subscribe to the event this.gridDataBoundGrid1.Model.QueryCellInfo += new GridQueryCellInfoEventHandler(grid_QueryCellInfo); //in handler, set readonly style depending on checkbox private void grid_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e) { if(e.RowIndex > 0 && e.ColIndex > 0 ) { int checkBoxColIndex = this.gridDataBoundGrid1.Binder.NameToColIndex("checkBoxCol"); if(e.ColIndex != checkBoxColIndex) { string s = this.gridDataBoundGrid1[e.RowIndex, checkBoxColIndex].Text; if(s.Length > 0 ) e.Style.ReadOnly = bool.Parse(s); } } }
private void gridDataBoundGrid1_RowsDeleting(object sender, GridRowRangeEventArgs e) { int checkBoxColIndex = this.gridDataBoundGrid1.Binder.NameToColIndex("checkBoxCol"); for(int i = e.From; i <= e.To; ++i) { GridStyleInfo style = this.gridDataBoundGrid1[e.RowIndex, checkBoxColIndex]; if(style.Text == style.CheckBoxOptions.CheckedValue) { e.Cancel = true; break; } } }
private void gridDataBoundGrid1_RowExpanded(object sender, GridRowEventArgs e) { GridBoundRecordState state = gridDataBoundGrid1.Binder.GetRecordStateAtRowIndex(e.RowIndex); ((IBindingList)state.ChildList).ListChanged += new ListChangedEventHandler(list_ListChanged); } private void gridDataBoundGrid1_RowCollapsing(object sender, GridRowEventArgs e) { GridBoundRecordState state = gridDataBoundGrid1.Binder.GetRecordStateAtRowIndex(e.RowIndex); ((IBindingList)state.ChildList).ListChanged -= new ListChangedEventHandler(list_ListChanged); }