We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

How do I add a button to a bound Grid Grouping control row

I would like to add a column to the end of each row that a user can click on to get more detail. I'm not sure how to add that column or object to the extra column.

Thanks,
Josh

5 Replies

HA haneefm Syncfusion Team April 2, 2007 06:25 PM UTC

Hi Josh,

Please refer to the attached sample and let me know if this helps.
GGC_unboundColumn.zip

Also refer this KB article for more details relating unbound column.
How do I have an unbound checkbox column in a GridGroupingControl?

Best regards,
Haneef


JK Josh King April 3, 2007 10:10 PM UTC

Thanks. I am trying to add the button column to the child table. I'm getting an out of range error when running this code:

((GridTableDescriptor)this.gridGroupingControl1.TableDescriptor.Relations[0].ChildTableDescriptor).Columns.Add("Detail");

Is there a different path to the child table that works?

>Hi Josh,

Please refer to the attached sample and let me know if this helps.
GGC_unboundColumn.zip

Also refer this KB article for more details relating unbound column.
How do I have an unbound checkbox column in a GridGroupingControl?

Best regards,
Haneef


HA haneefm Syncfusion Team April 3, 2007 10:36 PM UTC

Hi Josh,

You can try this code.

this.grid.GetTableDescriptor("ChildTableName").UnboundFields.Add("ExtraColumnName");

Best regards,
Haneef


JK Josh King April 3, 2007 10:55 PM UTC

That is working. The column I am adding is a PushButton column. How do I get text to display on the push button? Right now the button is blank. Also, I need to capture the click event of that button.

Thanks!



>Hi Josh,

You can try this code.

this.grid.GetTableDescriptor("ChildTableName").UnboundFields.Add("ExtraColumnName");

Best regards,
Haneef


HA haneefm Syncfusion Team April 3, 2007 11:56 PM UTC

Hi Josh,

You can handle the QueryCellStyleInfo event of the grid and set the e.Style.Description as data that you want it to be displayed for the pushbutton cells in grid. The following is the code.

private void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if( e.Style.CellType == "PushButton")
e.Style.Description = "YourTextHere";//e.Style.Text;
}

Try handling the TableControlCellButtonClicked event of the grid to get the puh button clicked event.

[c#]
private void gridGroupingControl1_TableControlCellButtonClicked(object sender, GridTableControlCellButtonClickedEventArgs e)
{
MessageBox.Show("PushButton Clicke");
}

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon