I am trying to add two columns with ultra-combo boxes to Ultra grid. So far I have this code , but I don’t see the column. Why is that.
UltraGridLayout layout = args.Layout;
UltraGridBand band = layout.Bands[0];
band.Columns["Cutsomer"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
This should help.
HOWTO:What is the best way to place a DropDown list in a grid cell?
Let me know if you still have trouble getting it to work or any questions. :)
Thank you
I tried the version with the value list, I did everithing like in the example. But I dont see even the added column in my grid.
What I am doing wrong
Well, I don't see anything wrong with your code that's adding the column. My best guess is that something is happening after this code is executed which is removing the column. Maybe you are calling grid.DisplayLayout.Load and blowing away these settings.
If that's not the case, maybe you can post a small sample project demonstrating the problem, and I'd be happy to tell you why it's not working.
I figured out how to achieve the combo box
Now I have problem displaying two fields in the combo box
I want to display CustID and Name and the value will be only CustID
foreach(DataRow listRow in dsListCustomer.Tables[0].Rows)
{ valueList.ValueListItems.Add(listRow["CustID"].ToString(), listRow["Name"].ToString());
}
Hi,
What you would need to do is set your ValueMember to the CustId. Then you need to set the DisplayMember to a column that contains the text you want the user to see. If you want the user to see both the CustID and the name, then you need to create a column in the Combo (perhaps an unbound column) that contains this as a single value. So you could add an unbound column to the Combo and use that unbound column as your DisplayMember. To populate the unbound column, you would use the InitializeRow event and combine the CustId and Name into a single string.
Could you give me a code example
I figured out how to do that. Now I am trying to filter one of the boxes by the other. I was using cell change event and the event fires in the required time but it gives me the error
The event 'System.Windows.Forms.Control.Layout' can only appear on the left hand side of += or -=
If you want to access the value of a grid cell, then you use the Value property of the grid cell, not the combo. The combo services the entire column, so using the value of the combo would not work.
Thank you I figured out my error. :)
Now I have truble accessing the combo box value inside the grid .
If I tried to access it in the conventional way by combo.Value it is erroring out.
Is there any special way to access it?
Well, that error message is a syntax error in your code and since you didn't provide the code, I can't tell you what's wrong with it.