Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
170
Dropdown (ValiueList) in Grid shows value when data bind???
posted

Hi,

In my Ultrawebgrid i have 3 columns with one of them is a dropdown.

After binding data to the grid, the InitializeLayout method fires and should now populate the column with a dropdownlist (valueliet):

UltraGridColumn decisionColumn = gridTest.DisplayLayout.Bands[0].Columns.FromKey("InterestId");

ArrayList decisions = Decision.GetAllByType();

decisionColumn.ValueList.DataSource = decisions;

decisionColumn.ValueList.DisplayMember = "ReferenceId";

decisionColumn.ValueList.ValueMember = "ReferenceId";

decisionColumn.ValueList.Style.CssClass = "gridData";

decisionColumn.ValueList.DataBind();

Everything is bound correctly to the grid but the dropdownlist does not appear (i.e. i cannot select from a dropdownlist).

To test, i populated the dropdownlist in a separate method just to see if the dropdownlist is populated without binding to the datagrid. The dropdownlist appears in this test.

So now I try with a valuelist. This seems to work better.

In the above image: The DecisionId is the "Id" that should be mapped to the ValueList

If I click on the cell then the dropdownlist appears with the correct "text" associated to ID 130.

I would like the dropdown list with the associated ID displayed the text to appear.

I've been stuck on this and was hoping someone might have a suggestion.

Thanks!

  • 170
    Suggested Answer
    posted

    I really need to stop working late. I checked over and over again if the column data type was different. And it was all set as Int32. So why wasn't it picking it up?

    Frig...the data was coming in from a datatable and that wasn't set up properly as integers.

    Foolish.

    Thanks for those who took interest.