How to enable the button in WinForms GridDataBoundGrid?
The button can be shown in edit mode only can be achieved by register the ButtonEdit CellModel to GridDataBoundGrid. Set TableStyle.CellType as ButtonEdit cell type from CustomCellTypes option. After register the cell type you need set property TableStyle.ShowButton as showCurrentCellEditing from GridShowButton options.
C#
//Register the cell model -> Syncfusion.GridHelperClasses.Windows.dll RegisterCellModel.GridDataBoundCellType(this.gridDataBoundGrid1, CustomCellTypes.ButtonEdit); this.gridDataBoundGrid1.TableStyle.CellType = CustomCellTypes.ButtonEdit.ToString(); //show the buttons only on current cell editing. this.gridDataBoundGrid1.TableStyle.ShowButtons = Syncfusion.Windows.Forms.Grid.GridShowButtons.ShowCurrentCellEditing;
VB
'Register the cell model -> Syncfusion.GridHelperClasses.Windows.dll RegisterCellModel.GridDataBoundCellType(Me.gridDataBoundGrid1, CustomCellTypes.ButtonEdit) Me.gridDataBoundGrid1.TableStyle.CellType = CustomCellTypes.ButtonEdit.ToString() 'show the buttons only on current cell editing. Me.gridDataBoundGrid1.TableStyle.ShowButtons = Syncfusion.Windows.Forms.Grid.GridShowButtons.ShowCurrentCellEditing
|
Sample
Conclusion
I hope you enjoyed
learning about how to enable the button click only on current cell in edit
mode in WinForms GridDataBoundGrid. You can refer to our WinForms GridDataBoundGrid feature tour page
to know about its other groundbreaking feature representations documentation
and how to quickly get started for configuration specifications. You
can also explore our WinForms GridDataBoundGrid example
to understand how to create and manipulate data.
For current
customers, you can check out our components from the License and Downloads page. If you
are new to Syncfusion, you can try our 30-day free trial
to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!