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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridDataBoundGrid : Add button to a cell

Thread ID:





70375 Dec 10,2007 11:21 AM UTC Dec 11,2007 08:16 AM UTC WinForms 2
Tags: GridControl
Asked On December 10, 2007 11:21 AM UTC

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 05:45 PM UTC

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 08:16 AM UTC

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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon