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

Enable/Disable PushButtons

Thread ID:





44925 Jun 7,2006 07:47 AM UTC Jun 7,2006 12:25 PM UTC WinForms 5
Tags: GridControl
Tom Tabruyn
Asked On June 7, 2006 07:47 AM UTC

I''ve got 2 grids with pushbuttons, and I''d like to enable/disable these from one another. I.e. clicking on PushButton1 in Grid1 would enable PushButton2 in Grid2. I can get to the PushButton that fired the event through the EventArgs as in private void AddRange_CellButtonClicked(object sender, GridCellButtonClickedEventArgs e) but how would I do this from another PushButton''s event? thanks, tom

Administrator [Syncfusion]
Replied On June 7, 2006 08:35 AM UTC

Hi Tom, Could you try this code to enable pushbutton in a cell. Here is a code snippet. ////Try this code in CellButtonClicked event handler. GridControl grid = sender as GridControl; string Name = grid.Name; if( Name.Equals("gridControl1")) { this.gridControl2[e.RowIndex,e.ColIndex].Enabled = false; //False For disable; True for Enable } else { this.gridControl1[e.RowIndex,e.ColIndex].Enabled = false; //False For disable; True for Enable } Here is a sample. http://www.syncfusion.com/Support/user/uploads/GridPushButtonEnabled_ffe1ffd4.zip Please let me know if this helps. Best Regards, Haneef

Tom Tabruyn
Replied On June 7, 2006 09:56 AM UTC

Even after setting this.gridControl1[e.RowIndex,e.ColIndex].Enabled = false; the PushButton remains active (clickable, same look), and the CellButtonClicked event handler keeps getting fired.

Tom Tabruyn
Replied On June 7, 2006 09:59 AM UTC

maybe important info: we''re using v2.1.0.9

Administrator [Syncfusion]
Replied On June 7, 2006 10:10 AM UTC

Hi Tom, Try this code to disable the CellbuttonClick event in a push button cell. Here is a code snippet //For different look and Feel of the Enabled/Disable Pushbutton text this.gridControl1.TableStyle.Description = "Click"; this.gridControl2.TableStyle.Description = "Click"; this.gridControl2[e.RowIndex,e.ColIndex].Clickable= false; Best Regards, Haneef

Tom Tabruyn
Replied On June 7, 2006 12:25 PM UTC

yup - that did it. Thanks!


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