Hi Josh,
You can handle the QueryCellStyleInfo event to do this. In the event handler code, you can loop through the records of the childtable untill specified condition is satisfied and then hide the pushbutton in the parentrecord by setting the celltype to textbox. Please refer the attached sample for more details. Below is the code snippet.
void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell
|| e.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell
&& e.Style.CellType == "PushButton")
{
Element el = e.TableCellIdentity.DisplayElement;
Record rec = el.ParentRecord;
if (rec.HasNestedTables)
{
foreach (GridRecord gr in el.ParentRecord.NestedTables[0].ChildTable.Records)
{
bool chk = (bool)gr.GetValue("Check");
if (chk)
{
e.Style.CellType = "TextBox";
break;
}
}
}
}
}
void gridGroupingControl1_TableControlCellButtonClicked(object sender, GridTableControlCellButtonClickedEventArgs e)
{
GridTableCellStyleInfo style = e.TableControl.GetTableViewStyleInfo(e.Inner.RowIndex, e.Inner.ColIndex);
if (style.TableCellIdentity.TableCellType != GridTableCellType.RecordPlusMinusCell)
{
string str = string.Format("Clicked on recordindex: {0}", style.TableCellIdentity.DisplayElement.GetRecord().GetSourceIndex());
MessageBox.Show(str, "Click!", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
Here is a sample
http://websamples.syncfusion.com/samples/Grid.Windows/F62028/main.htmRegards,
Rajagopal