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
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?"
Well, thats pretty much what i meant, you got that right however that doesnt seem to work...
The typeId column is now a simple field, not a drop down anymore
:-(!
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();
e.Layout.Bands[0].Columns["Id"].ValueList = ultraDropDown1;
This code looks to me as though it should work. I don't see anything obvious that suggests anything is wrong with it.
Does the behavior change if you move the data binding code out of your form's constructor into the form's Load event handler?
Are the cells in this column editable? If you don't allow editing in these cells, I believe that the drop down won't appear.
If these ideas don't help, then I suspect you'll need more direct assistance than I can provide over these peer-to-peer forums. You can submit a support request so that a Developer Support Engineer can provide you with this assistance. I suggest that you include a sample project that we can run and debug, so that we can be sure we're using the same code you're testing with, and can provide you with appropriate adjustments.