The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Hi,
I''m trying to change cell type to combo, when a specific cell is clicked.
Lets say the column contains cells with text, but when a cell is clicked, I want it to become a combo box.
I tried doing it using the "CellType" property, and by setting the data source, display member and value member in style info object.
I tried call this properties in preparestyleinfo event handler or when the form is loaded, but none of the above has worked! Why?
The only way I succeeded to change the cell to combo, is by specifing the whole column as combo, but then, each cell is combo.
Is it possible to change only one cell when selected?
Thanks in advance,
Gil K
ADAdministrator Syncfusion Team July 25, 2004 06:49 AM UTC
So you only want to see the combobox when the cell is the currentcell?
The simplest way to do this is to set the GridBoundColumn.StyleInfo properties to set the column up as a ComboBox with the CellType/DataSource/DisplayMember/ValueMember properties. In addition, set
GridBoundColumn.StyleInfo.ShowButtons = GridShowButtons.ShowCurrentCell.
This should only show the button when the cell is current. You would not have to handle any events.
If you really want to do this from an event, you would have to do it in QueryCellInfo, but there would be technical problems you would have to overcome if you want to have a different ValueMember than DisplayMember since the grid really needs the cell to be a combobox in order to support this.