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
620
SelectedItems on my valueList
posted

I get the rows and the dropdown works fine too.... However, i cannot seem to figure out how i bind the dropdown with the typeId. Could you help plz? 

 

 

 

OnLoad 

ultraGrid2.DataSource = dataLayer.getHaendelseStatus(); //gets Id, name, typeId
          

        }

        private void ultraGrid2_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
        {
            Infragistics.Win.ValueList v1;

            v1 = e.Layout.ValueLists.Add("MyValueList");
            v1.ValueListItems.Add(1, "A");
            v1.ValueListItems.Add(2, "B");
            v1.ValueListItems.Add(3, "C");
           
            e.Layout.Bands[0].Columns.Add("ny", "nothingSpecial");
            e.Layout.Bands[0].Columns["ny"].ValueList = e.Layout.ValueLists["MyValueList"];
            }

 

I have also tried with an ultradropdown approach..

      private void ultraGrid2_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
        {

 ultraDropDown1.DataSource = dataLayer.gettypeNames();
            ultraDropDown1.ValueMember = "Id";
            ultraDropDown1.DisplayMember = "Art";
           
  
            e.Layout.Bands[0].Columns.Add("ny", "nothingSpecial");
            e.Layout.Bands[0].Columns["ny"].ValueList = this.ultraDropDown1;
           

}
 

How on earth do i bind the dropdown to the typeId??  ultraGrid2.DataSource = dataLayer.getHaendelseStatus(); //gets Id, name, typeId

Parents
  • 45049
    posted

    By "bind the dropdown to the typeId?" do you mean "how do I apply this dropdown to the column in my grid that represents the typeId property?"  If that's the case, then do one of the following instead of creating a new column:

    e.Layout.Bands[0].Columns["typeId"].ValueList = e.Layout.ValueLists["MyValueList"]; // from first example

    e.Layout.Bands[0].Columns["typeId"].ValueList = this.ultraDropDown1; // from second example

    If that's not what you meant, can you further explain what you mean by "bind the dropdown to the typeId?"

  • 620
    Offline posted in reply to genvej

    Everywhere I go you guyz seem to link to

      HOWTO:What is the best way to place a DropDown list in a grid cell?

    I shouldnt be too suprised as the user ratings are pretty much all saying &()=#%%#+ to the content maybe an update is due? 

    so... I did all you said and still I get no combo

    Im gonna give this a last chance before i ditch it. +12 hous on this and im done

     

     

     public FormForside()
            {
                InitializeComponent();
                Infragistics.Win.AppStyling.StyleManager.Load("Styles/office2007black.isl");
               
               
                DataTable dt = new DataTable();
                dt.Columns.Add("ID", typeof(int));
                dt.Columns.Add("DisplayText", typeof(string));

                dt.Rows.Add(new object[ { 1, "A" });
                dt.Rows.Add(new object[ { 2, "B" });
                dt.Rows.Add(new object[ { 3, "C" });
                dt.AcceptChanges();

                ultraDropDown1.SetDataBinding(dt, null);
                ultraDropDown1.ValueMember = "Id";
                ultraDropDown1.DisplayMember = "DisplayText";
                ultraGrid2.DataSource = dataLayer.getHaendelseStatus();

     

                populateStaticFields();


            }

        
            private void ultraGrid2_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
            {


                e.Layout.Bands[0].Columns["Id"].ValueList = ultraDropDown1;


            }

Reply Children
No Data