'Declaration Public Event BeforeCellListDropDown As CancelableCellEventHandler
public event CancelableCellEventHandler BeforeCellListDropDown
The event handler receives an argument of type CancelableCellEventArgs containing data related to this event. The following CancelableCellEventArgs properties provide information specific to this event.
Property | Description |
---|---|
Cancel (Inherited from System.ComponentModel.CancelEventArgs) | |
Cell | Returns a reference to the cell of interest. |
The cell argument returns a reference to an UltraGridCell object that can be used to set properties of, and invoke methods on, the cell that will have its dropdown list dropped down. You can use this reference to access any of the returned cell's properties or methods.
The cancel argument enables you to programmatically prevent the cell's dropdown list from being dropped down. This argument can be used to prevent the dropdown list from dropping down unless a certain condition is met.
This event is generated when a cell's dropdown list is about to be dropped down, either programmatically, or by user interaction. A cell's dropdown list can be dropped down programmatically by setting the cell's DroppedDown property to True.
This event is only generated for a cell whose column's Style property is set to 4 (StyleDropDown), 5 (StyleDropDownList), 6 (StyleDropDownValidate), or 8 (StyleDropDownCalendar).
Set the column's ValueList property to a ValueList object to populate the dropdown list.
The AfterCellListCloseUp event is generated when a cell's dropdown list is closed.
Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.UltraWinGrid Private Sub UltraGrid1_BeforeCellListDropDown(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.CancelableCellEventArgs) Handles ultraGrid1.BeforeCellListDropDown ' BeforeCellListDropDown gets fired when the user is dropping down the drop down ' in a cell, for example by clicking on the drop down arrow in the cell. ' Following code cancels the event preventing the UltraGrid from dropping the ' drop-down down if the number of items in the value list is 0. If Not Nothing Is e.Cell.Column.ValueList AndAlso e.Cell.Column.ValueList.ItemCount <= 0 Then e.Cancel = True End If End Sub
using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinGrid; using System.Diagnostics; private void ultraGrid1_BeforeCellListDropDown(object sender, Infragistics.Win.UltraWinGrid.CancelableCellEventArgs e) { // BeforeCellListDropDown gets fired when the user is dropping down the drop down // in a cell, for example by clicking on the drop down arrow in the cell. // Following code cancels the event preventing the UltraGrid from dropping the // drop-down down if the number of items in the value list is 0. if ( null != e.Cell.Column.ValueList && e.Cell.Column.ValueList.ItemCount <= 0 ) { e.Cancel = true; } }
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2