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.
I have a GridControl with a ColumnStyle whose CellType is set to "CombobBox". The DataSource for the combobox column is set to a collection of objects. Is it possible to programmatically scroll up or down through the values?
STstanleyj Syncfusion Team February 17, 2006 01:22 PM UTC
Hi Don,
see if Style.DropDownStyle = GridDropDownStyle.AutoComplete helps. If the dropdown is to be dropped on changing values, then use this code to show the dropdown.
private void gridDataBoundGrid1_CurrentCellChanged(object sender, System.EventArgs e)
{
GridComboBoxCellRenderer renderer = this.gridDataBoundGrid1.CurrentCell.Renderer as GridComboBoxCellRenderer;
if(this.gridDataBoundGrid1.CurrentCell.Renderer.StyleInfo.CellType == "ComboBox")
{
this.gridDataBoundGrid1.CurrentCell.ShowDropDown();
}
}
The above idea is to scroll the value when editing. If your requirement is different and you need to locate the selected index programmatically, then see if this piece of information helps.
The ComboBox CellType uses the ListBox for the dropdown and button is derived from GridCellButton and ComboBox is not directly implemented. The ListBox can be handled through the ListBoxPart to the instance of theGridComboBoxCellRenderer.
this.gridDataBoundGrid1.Focus();
this.gridDataBoundGrid1.CurrentCell.MoveTo(3,2); // ComboBox cell
this.gridDataBoundGrid1.CurrentCell.ShowDropDown();
GridComboBoxCellRenderer renderer = this.gridDataBoundGrid1.CurrentCell.Renderer as GridComboBoxCellRenderer;
renderer.ListBoxPart.SelectedIndex = i; // to select programmatically
Best regards,
Stanley
MSMaxim Software SystemsFebruary 17, 2006 03:25 PM UTC
Thanks for the info. I managed to get the functionality I needed by grabbing the existing value of the cell and using my custom collection class to determine what the previous/next value should be, then setting that new value back into the cell. But hopefully what you''ve posted will help someone else in the future.