Let me preface by saying..I'm just getting started with Infragistics so my questions is basic. Pretty much I'm trying to evaluate if we should use Infragistics or another company. My feeling is not that great..I think these controls are way to difficult to use.
Also, I dont know why all the examples are with DataSets. DataSets are being replaced by Generic Lists...
So, here's what I'm trying to do:
1) I've placed an UltraGrid on my form.
2) everything else will be done dynamically and not with the wizard.. (again not sure why using wizards)
3) using a BindingList<T> to create a hierarchical view of the data in the UltraGrid.
4) For one of the fields in the Band 1 I want to display the value from the bindinglist but when a user clicks the cell I want to be able to display the UltraCombo. I'm fine with showing the UltraCombo all the time as well.
The problem I'm having is I cannot get the UltraCombo on the UltraGridColumn at run time when a user clicks the column value
I've tried adding the UltraCombo when declaring the Band and Binding the data to the UltraGrid. I even tried to add the UltraCombo to the UltraGrid_AfterCellActivate
Please give me some guidance
Hi,
lj34 said:I think these controls are way to difficult to use.
The controls are very powerful and very flexible, but this comes at the expense of a somewhat steep learning curve. But I am here to help. :)
lj34 said:Also, I dont know why all the examples are with DataSets. DataSets are being replaced by Generic Lists
Generic lists aren't really a replacement for DataSets. DataSets/Datatables still have a great deal of useful functionality when working with a data source that needs to deal with a database on the back end. But as far as the grid is concerned, it uses the IBindingList interface, anyway. So the grid does not care if you use a DataSet, a DataTable, or a generic list, as long as it implements IBindingList (which they all do).
Anyway... to answer your question, you might want to check out this KB article:
HOWTO:What is the best way to place a DropDown list in a grid cell?
One thing this article will point out is that you are probably better off using UltraDropDown instead of UltraCombo for a list in a grid column. The UltraDropDown is specifically designed for this purpose.
The best place to attach the dropdown to the column is in the InitializeLayout event of the grid. This event fires right after you bind the grid, so it perfect for settings up the columns the way you want them.
Ur code works really fine and i managed to insert an ultracombo to a cell in a wingrid. But my question is autocomplete property does not work in the attached ultracombo. Here I have attached the code that I used. Please help because I’m new to the infragistics
private void cmdAdd_Click(object sender, EventArgs e)
{
//Add rows to wingrid
int counter = 0;
Infragistics.Win.UltraWinGrid.UltraGridRow row = grdWoovenCom.DisplayLayout.Bands[0].AddNew();
counter = grdWoovenCom.Rows.Count;
if (grdWoovenCom.Rows.Count <= 1)
row.ParentCollection.Move(row, 0);
}
else
counter = counter - 1;
row.ParentCollection.Move(row, counter);
//Event that fird when a row add to the wingrid
private void grdWoovenCom_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
DataSet FiberTable = LoadFiber();
//Create DropDown
UltraCombo sd = new UltraCombo();
sd.AutoCompleteMode = Infragistics.Win.AutoCompleteMode.Suggest;
sd.DataSource = FiberTable.Tables[0];
sd.DisplayMember = FiberTable.Tables[0].Columns[1].ToString();
sd.ValueMember = FiberTable.Tables[0].Columns[1].ToString();
sd.DataBind();
e.Layout.Bands[0].Columns[0].ValueList = sd;
For future reference, when you attach an EditorControl to a column, properties of the EditorControl are only used when the grid column doesn't already have a property that does the same thing. The grid column properties take precedence over the editor control settings.
Hi Mike,
Thank you veru much. It's working
You need to set the AutoCompleteMode on the grid column, not the UltraCombo.