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.

GridDataBoundGrid : Add button to a cell

Thread ID:





70375 Dec 10,2007 06:21 AM Dec 11,2007 03:16 AM Windows Forms 2
Tags: GridControl
Asked On December 10, 2007 06:21 AM

I have a GridDataBoundGrid . Datasource is a datatable.

I want to add a column with a button in it.
Each row's last cell is a button.

what i tried but didn't work is.

for (int i = 0; i < _datatable.Rows.Count; i++)

SyncfusionGridControl[i + 1, 19].CellType = "GridCellButton";


Any solutions ?

Administrator [Syncfusion]
Replied On December 10, 2007 12:45 PM

To have a column of buttons in a GridDataBoundGrid, you need to set the CellType for the GridBoundColumn associated with the particular column.

If you have explicitly created GridBoundColumns (either from code or from the designer), you would use code like:

this.gridDataBoundGrid1.GridBoundColumns["Button1"].StyleInfo.CellType = "PushButton";
this.gridDataBoundGrid1.GridBoundColumns["Button1"].StyleInfo.Description = "Push Me";

If you have not explicitly added GridBoundColumns to your grid, then you need to use code like this.

this.gridDataBoundGrid1.Binder.InternalColumns["Button1"].StyleInfo.CellType = "PushButton";
this.gridDataBoundGrid1.Binder.InternalColumns["Button1"].StyleInfo.Description = "Push Me";

Replied On December 11, 2007 03:16 AM

Works great ! Thx you !


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.