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
215
Populate the value of a drop down based on a dataset.
posted

Hi

I've use this post for reference:

https://www.infragistics.com/community/blogs/bf9d3b11-fd1c-4ecd-a46e-dcbd97be1898/archive/2009/05/08/creating-a-dropdown-list-in-a-grid-cell-whose-list-values-are-dependent-on-another-cell.aspx

I want to populate a dropdown (differently for every row based on the value of a dataset or could use a list). When I do what is in the code below it only wipes out all my rows in the grid.  Is there a better/easier way:

    private void UltraGridList_BeforeCellActivate(object sender, CancelableCellEventArgs e)
        {
            if (e.Cell.Column.Key == "FIELD1")
            {
                UltraGridBand rootBand = this.UltraGridList.DisplayLayout.Bands[0];
                //            rootBand.ColumnFilters.ClearAllFilters();
                mDSetPackageDetails = PresentationLogic.GetPackageDescDetails(Convert.ToInt32(UltraGridList.ActiveRow.Cells["FIELD2"].Value), UltraGridList.ActiveRow.Cells["FIELD3"].Value.ToString());
                ValueList valLstPackage = new ValueList();
                foreach (DataRow dRow in mDSetPackageDetails.Tables[0].Rows)
                    valLstPackage.ValueListItems.Add(CheckDBNull.ConvertToString(dRow["FIELD1"]).Trim());
                UltraGridList.DisplayLayout.Bands[0].Columns["FIELD1"].ValueList = valLstPackage;
                rootBand.ColumnFilters["X_SUPRA_DSCNT_ID"].FilterConditions.Add(FilterComparisionOperator.Equals, mDSetPackageDetails);
            }
        }