New Product Launch - BoldDesk !
Introducing help desk ticketing software.
New Product LaunchBoldDesk: Help desk ticketing software starts at $10 for 3 agents.
Try it for free.private void gridDataBoundGrid1_DrawCell(object sender, GridDrawCellEventArgs e) { if( e.ColIndex == 1) { GridBoundRecordState state = this.gridDataBoundGrid1.Binder.GetRecordStateAtRowIndex(e.RowIndex); if( state.HasChildList && state.ChildCount == 0) { int count; if (state.Position >= state.Table.Count) { count = 0; //addnew row } else { this.gridDataBoundGrid1.BeginUpdate(); this.gridDataBoundGrid1.Model.SuspendChangeEvents(); this.gridDataBoundGrid1.ExpandAtRowIndex(e.RowIndex); count = state.ChildCount ; this.gridDataBoundGrid1.CollapseAtRowIndex(e.RowIndex); this.gridDataBoundGrid1.Model.ResumeChangeEvents(); this.gridDataBoundGrid1.EndUpdate(); } if(count == 0) { using(SolidBrush brush = new SolidBrush(e.Style.BackColor)) { e.Graphics.FillRectangle(brush, e.Bounds); e.Cancel = true; } } } } }