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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

DropDownGridCell in GridDataBoundGrid

Thread ID:





22508 Dec 14,2004 05:43 PM UTC Dec 14,2004 08:32 PM UTC WinForms 1
Tags: GridControl
Asked On December 14, 2004 05:43 PM UTC

I would like to use a pushbutton rather than the default dropdown button to drop down the grid. I am using the following code to create my DropDownGridCell mports System Imports System.Collections Imports System.ComponentModel Imports System.Diagnostics Imports System.Drawing Imports System.Windows.Forms Imports System.Text Imports System.Runtime.Serialization Imports Syncfusion.Diagnostics Imports Syncfusion.Windows.Forms Imports Syncfusion.Windows.Forms.Grid ''/ ''/ Summary description for DropDownGridCell. ''/ Public Class DropDownGridCellModel Inherits GridDropDownGridCellModel Private _embbeddedGrid As GridControlBase Public Property EmbeddedGrid() As GridControlBase Get If _embbeddedGrid Is Nothing Then _embbeddedGrid = New GridControlBaseImp() End If Return _embbeddedGrid End Get Set _embbeddedGrid = value End Set End Property Protected Sub New(info As SerializationInfo, context As StreamingContext) MyBase.New(info, context) End Sub ''New Public Sub New(grid As GridModel) MyBase.New(grid) End Sub ''New Public Overrides Function CreateRenderer(control As GridControlBase) As GridCellRendererBase Return New DropDownGridCellRenderer(control, Me) End Function ''CreateRenderer End Class ''DropDownGridCellModel Public Class DropDownGridCellRenderer Inherits GridDropDownGridCellRenderer Private _grid As GridControlBase Public Sub New(ByVal grid As GridControlBase, ByVal cellModel As GridCellModelBase) MyBase.New(grid, cellModel) Me.DisableTextBox = True Me.ControlText = "More..." DropDownButton = New GridCellButton(Me) Me._grid = Nothing End Sub ''New Protected Overrides Sub OnInitialize(ByVal rowIndex As Integer, ByVal colIndex As Integer) Me._grid = CType(Me.Model, DropDownGridCellModel).EmbeddedGrid Me._grid.Dock = DockStyle.Fill MyBase.OnInitialize(rowIndex, colIndex) End Sub ''OnInitialize Protected Overrides Sub InitializeDropDownContainer() MyBase.InitializeDropDownContainer() ''this.DropDownContainer.FormBorderStyle = FormBorderStyle.SizableToolWindow; Me.DropDownContainer.IgnoreDialogKey = True End Sub ''InitializeDropDownContainer Protected Overrides Function CreateInnerControl(ByRef grid As GridControlBase) As Control grid = Me._grid grid.Dock = DockStyle.Fill grid.CausesValidation = False Return grid End Function ''CreateInnerControl End Class ''DropDownGridCellRenderer Thanks in advance for any help.

Administrator [Syncfusion]
Replied On December 14, 2004 08:32 PM UTC

What is not working for you? I was able to display a pushbutton in the grid\Sample\In Depth\DropdownGrid sample by changing the button in the Renderer constructor the same as you. If you wantto set More... as the text, you need to set the button.Text property.
Public Sub New(grid As GridControlBase, cellModel As GridCellModelBase)
      MyBase.New(grid, cellModel)
      Me.DisableTextBox = True
      DropDownButton = New GridCellButton(Me)
      DropDownButton.Text = "More..."
      Me._grid = Nothing
End Sub ''New
If you want to enlarge the button, you set the ButtonBar size in the CellModel constructor.
Public Sub New(grid As GridModel)
        ButtonBarSize = New Size(60, 20)
End Sub ''New


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

Live Chat Icon For mobile
Live Chat Icon