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
135
How do I add items to a UltraWebGrid CSOM WebGrid.Band.Column.ValueList?
posted

 I am trying to dynamically add distinct values from a column of one UWG to the dropdown list of another UWG Column. The documentation isnt exactly clear on what members are available in the CSOM for the ValueList object.  

   "A two dimensional array of the column's value list. The second dimension has two elements arrays containing: [DataValue, DisplayText]."

 Can anyone expound on the available members or provide any examples on how to clear the existing list and repopulate?

Thanks,

Andrew 

Parents
No Data
Reply
  • 135
    posted

    Here is how it works in case anyone could not understand the documentation.

    var sourceNames; //a string array of names that is populated by another method.

    var sourceName;
    var iterator;
    var ddlArrayContainer;
    var ddlArrayItem;

    ddlArrayContainer = new Array(sourceNames.length);
    for (iterator = 0; iterator < sourceNames.length; iterator++) {
        sourceName = sourceNames[iterator];
        ddlArrayItem = new Array(sourceName, sourceName);
        ddlArrayContainer[iterator] = ddlArrayItem;
    }

    cell.Column.ValueList = ddlArrayContainer;

Children
No Data