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 cell of the ComboBox type which uses a datasource and display/value-members.
I would like to pre-select specific values in the combo before displaying it to the user.
So if the combox contains the values 1, 5, 10 and 20 I would like 10 to be displayed in the combo when the user opens the form.
This would be somewhat similar to use SetSelectedIndex = 2 in a standard Windows combobox.
Thanks in advance.
ADAdministrator Syncfusion Team November 11, 2005 10:19 AM UTC
Try setting the CellValue to be the value member of the entry you want to see. So if the display member has a value of "Apple", and its corresponding valuememer is 192, then try setting:
grid[rowIndex, colIndex].CellValue = 192;
GAGeir AamodtNovember 11, 2005 01:39 PM UTC
That works perfectly, thanks a lot Clay.
Another ComboBox follow up; is it possible to have text in the combo that is not part of the datasource. Like when you open the form and in the combo you find the text "Please select Color" (or something like that.
ADAdministrator Syncfusion Team November 11, 2005 02:19 PM UTC
There are no property setting for this. You would have to code it.
One way to try to do this would be to use a GridListControl celltype and show the column headers in the GridListControl. You could make the first header in the GridListControl a covered cell and put your text there. But it would likely require handling events on the embedded grid within the gridlistcontrol to get this working.