(This regards Win NOT Web).
I have researched other posts re: "uneditable columns" and have read this article:
HOWTO:How can I make a grid or a column, row, or cell in the UltraWinGrid disabled or read-only?
I have an UltraDropDown in an UltraGrid column.
My issue is that as soon as I set .Activation to anything other than "AllowEdit", as detailed in the
above article, in the InitializeRow event, the UltraDropDown stops working ????
How can I have any UltraDropDown column in a WinGrid for selection purposes ONLY, the column
should NOT be editable following the close of the UltraDropDown ???
This WinGrid has some bound and some unbound columns. This UltraDropDown column of the UltraGrid
is UNBOUND, although the UltraDropDown itself IS BOUND to a 1-column table of items appearing in the dropdown.
How can I prevent editing in the unbound UltraDropDown column ???
Thank you,
XPXJ
Okay, I think one of us is confused. That fact that the ValueList or DropDown is bound is seems irrelvantto the question. Maybe I just don't understand what you are asking.
You can set the ValueList property of a column in the grid at run-time or design-time. But the column may not exist at design-time, of course, unless the grid has a datasource.
I meant a databound valuelist/dropdown. Right now I have a bound dropdown on the form that is hidden and serves as the valuelist property for a column in the grid.
Sure, assuming that your grid's DataSource is available at design-time so that the grid has columns, you can set the ValueList property on the column at Design-time just as well as at run-time.
Is there a way to add a dropdown to a grid using the designer?
Binding the UltraDropDown to a data source is exactly the same as binding a grid or any other control. You just set the DataSource and DataMember. Or you can use the SetDataBinding method to set both at once, which is a bit more efficient.
The only difference with the DropDown is that you will also want to set ValueMember and DisplayMember to determine which field corresponds to the Value of the cell and which field is displayed to the user, respectively.
As for attaching the UltraDropDown to the grid, you simply set the ValueList property of the column to the UltraDropDown control.
You might want to check out this KB article for more information.
HOWTO:What is the best way to place a DropDown list in a grid cell?