Make EpiCombo Read Only in Updateable BAQ

I have asked this question in a different form before I got the answer. Six months later, I am doing another variation of the same thing and missing something.

I am with a new company that created a BAQCombo rather than User Fields.

I am failing to understand the infragistics logic I need to make this read only.

I have from former assistance given to me on User Fields:

// Populate drop downs upon screen

load private static void

//Get control of the grid where the dropdown is being added

//Standard EpiCombo or BAQCombo DropDown Style Selections BAQCombo SMI-ReasonChange = (BAQCombo)csm.GetNativeControlReference(“dd5e12a6-1f69-49a8-8873-72045d7b2556”); (WHERE do I find the GUID associated with BAQCombo - all I can see is the MyGrid Guid)

//DropDownList make it just a dropdown (not typing permitted) SMI-ReasonChange.DropDownStyle = Infragistics.Win.UltraWinGrid.UltraComboStyle.DropDownList;

Help. Feeling stupid. Been staring at this for two days.

What is the point of having a dropdown that can’t be changed? Just to see what other values it could have been?

Updatable Dashboard allows for change ship Date (Locked on form now) and a BAQCombo holds VALID reason codes for why it is changed. We want to restrict the permitted users from making new reason codes. We want them to ONLY be able to select from items populated in the list.

I know this could be done in the Form itself but the ownership wanted this compartmentalized rather than doing field code securities on the Order > Release tab form.

Okay… You want the available options to be static, and not allow someone to type one in (even if it would be valid, but not on your list of what you limit it to. So Read Only from the combo’s list’s point of view, but not read only from the bound field’s point of view. That correct?

You could 2ad a YD column to the Reason codes to identify each reason code as being on your list, then use that field to filter the list of reason codes returned by the BO when it populates that combo.

Yes. Static drawn from an BAQCombo

Error: CS1061 - line 61 (140) - ‘Ice.Lib.Framework.EpiUltraGrid’ does not contain a definition for ‘DisplayLayoutBands’ and no extension method ‘DisplayLayoutBands’ accepting a first argument of type ‘Ice.Lib.Framework.EpiUltraGrid’ could be found (are you missing a using directive or an assembly reference?)

I struggled for days with a similar problem a while back - trying to make a custom EpiUltraGrid “fully” read-only (where the user could go into the cell to copy text but the cell wouldn’t go into “edit mode”). It’s not as trivial as you’d think.

Couple things first,

  1. You don’t need to get a hold of your control by referencing the GUID; you should be able to just use the name you gave it. And I’m talking about the EpiUltraGrid control… the combo box within the grid isn’t a control by itself.
  2. You’ll need some Usings statements. I think System.Drawing and Infragistics.Win should cover it

Here are two lines of code that allowed me to make my grid behave the way I wanted:

myGrid.ReadOnly = true;
myGrid.DisplayLayout.Override.AllowUpdate = DefaultableBoolean.False;

That won’t work for you though since you’re trying to attack one column. Here is a shot in the dark code snippet that I doubt will actually work, but it may help steer you down the right path:

yourGrid.DisplayLayout.Bands[0].Columns[x].Override.AllowUpdate = DefaultableBoolean.False;

(where x is an integer that identifies the column of interest – count from left to right starting at zero)

Basically, you need to dive down into the column itself and manipulate its properties. I think you need to use the Override class but I’m not sure. Your problem is harder than mine was because you’re dealing with a combo box and actually do need to update the data field that the control is bound to via drop-down selection… but if you give that code snippet a shot and see what happens I think it could help you get closer to a solution.

Also, the documentation on this site is going to be your friend: UltraGridOverride - Infragistics Windows Forms™ Help