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.
Unfortunately, activation email could not send to your email. Please try again.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

58973 Apr 2,2007 01:49 PM Apr 3,2007 07:56 PM Windows Forms 5
loading
Tags: GridControl
Josh King
Asked On April 2, 2007 01:49 PM

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

haneefm [Syncfusion]
Replied On April 2, 2007 02:25 PM

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

Josh King
Replied On April 3, 2007 06:10 PM

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

haneefm [Syncfusion]
Replied On April 3, 2007 06:36 PM

Hi Josh,

You can try this code.

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

Best regards,
Haneef

Josh King
Replied On April 3, 2007 06:55 PM

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

haneefm [Syncfusion]
Replied On April 3, 2007 07:56 PM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;