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
335
Totally new to ValueLists, need help.
posted

I am trying to figure out how to add a valuelist to the ultragrid but everything I've found and tried has not worked.  I have to be missing something.  If someone could step me through each step for just a simple list of a couple of items, I could figure out the rest from there.

Thanks,
Kevin

Parents
  • 145
    posted

    Are you just trying to create a dropdown list in one of the columns in the grid?  If that's the case, then here's a small snippet that might help:

    -------------------
    Infragistics.Win.ValueList vl = new Infragistics.Win.ValueList();
    for (int i = 1; i <= 10; i++)
    {
                vl.ValueListItems.Add(i);
    }

    this.ultraGrid1.DisplayLayout.Bands[0].Columns[0].ValueList = vl;
    this.ultraGrid1.DisplayLayout.Bands[0].Columns[0].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
    ----------------

    All this does is create a simple valuelist, adds 10 items to it, associates it with the first column in the top level (band 0) of the grid and sets the style of the column to be a DropDownList.  There's also a BindableValueList object in case you just want to bind to a source of data instead of building up the ValueList by hand.

Reply Children