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
15
Display list of values in ultra-drop down in ultra grid based on conditional.
posted

I have to display list of values in ultra-drop down in ultra grid based on conditional.

  • If all grid row values is “No” the drop down list is working fine
  • If grid row values is “yes” the drop down list is No-edit mode and working fine as expected.
  • If grid row values is “Yes/No” the drop down list of values is displaying for both but in this scenario if grid values is “yes” the drop down should not be editable

 

Below is my code:

        private void Loadvalues()

        {

            ArrayList ValueType = new ArrayList();

            DataSet ds = null;

 

            DateType.Add("No");

            DateType.Add("Suspend");

 

            ds = objMem.GetOwnervalues(objfuleId.FileId);

            foreach (DataRow row in ds.Tables["OwnerID"].Rows)

            {

                if (Convert.ToString(row["Value"]) == ("Yes"))

                {                                     

                    UltraGridColumn column = this.grdContracts.DisplayLayout.Bands[0].Columns["Value "];                

                    column.CellActivation = Activation.NoEdit;

                }

                else

                {

                    _ValueUltraDropDown.DataSource = DateType;

                    _ ValueUltraDropDown.Rows[0].Selected = true;

                    UltraGridColumn column = this.grdContracts.DisplayLayout.Bands[0].Columns["Value "];              

                    column.CellActivation = Activation.AllowEdit;

                }             

            }              

        }

  • 25665
    Offline posted

    Hello Muniraja,

    Thank you for contacting Infragistics!

    Looking at your code you when you convert the value to string you do a check for the exact match of “Yes”, so when the value contains both yes and no it will go to your else statement an allow editing. You will want to change your check so that it looks to see if the value contains “Yes” instead of exactly being “Yes”.