(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
Hi,
I'm not sure I understand the behavior you want. The purpose of a dropdown is so that the user can drop it down and choose a value. This modifies the value of the cell in the grid.
Are you saying you want to show a dropdown in a cell but not allow the user to select a new value on it? If so, I'd advise against it, as this would be prety unintuitive and non-standard UI.
If you are saying that you want the user to be able to select an item from the list, but not to type into the cell, then you just need to set the Style of the column to DropDownList.
Sorry for interrupt you, just want to know how to place a UltraDropDown in an UltraGrid and how to bind the UltraDropDown with dataset. Note* In Column style i mentioned as dropdown but it's not coming in output. Please let me know, i'm finding very difficult to fix this problem.
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?
Is there a way to add a dropdown to a grid using the designer?
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.
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.
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.
PolarBear2k said:I'm looking for an option to go into the column's properties and specify the display style as a DropDown/DropDownList and having to set the DataSource, DataMember, DisplayMember and Value Member properties. During runtime this would render the column as abound dropdown. The KB article mentioned in this thread explains to set the ValueList property accordingly:e.Layout.Bands[0].Columns["Int32 1"].ValueList = this.ultraDropDown1; But where is the ultraDropDown1 control coming from? Obviously it needs to be already present on the form or entered manually by code and have its Data properties set. It seems to be that this control should be automatically created when you would change the display type of the column to DropDown/DropDownList.
I'm looking for an option to go into the column's properties and specify the display style as a DropDown/DropDownList and having to set the DataSource, DataMember, DisplayMember and Value Member properties. During runtime this would render the column as abound dropdown.
The KB article mentioned in this thread explains to set the ValueList property accordingly:
e.Layout.Bands[0].Columns["Int32 1"].ValueList = this.ultraDropDown1;
But where is the ultraDropDown1 control coming from? Obviously it needs to be already present on the form or entered manually by code and have its Data properties set. It seems to be that this control should be automatically created when you would change the display type of the column to DropDown/DropDownList.
UltraDropDown is a control included with NetAdvantage, just like the grid. So yes, you would have to place the control on the form at design-time or create one in code at run-time and set it's properties like DataSource, DataMember, DisplayMember and ValueMember. I'm not sure what you mean about "this control should be automatically created". There's no way for the grid to create it automatically or determine what settings you want to use, what table to bind it to, etc.
Thanks