Hello,
I have an UltraGrid with a column called 'LandCodes'. I set the ValueList of this column and set the Style to ColumnStyle.DropDownList.
The scenario is:I select a value from the drop down for a 'LandCodes' cellI then scroll the mouse wheel
Currently this causes the value in the cell to change.
The behaviour I am looking for is the value no remain the same but for the grid to scroll.
Any help would be greatly appreciated.
Thanks,Paul
Hi,
I tried this out with UltraCombo and it still works just fine for me. I don't have any problem with the mouse wheel.The mouse wheel still scrolls the grid and doesn't change the cell value.
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { UltraGridLayout layout = e.Layout; UltraGridBand band = layout.Bands[0]; UltraGridOverride ov = layout.Override; UltraCombo cbo = new UltraCombo(); this.Controls.Add(cbo); DataTable dt = new DataTable(); dt.Columns.Add("Key", typeof(int)); dt.Columns.Add("Name", typeof(string)); dt.Rows.Add(new object[] { 0, "Apple" }); dt.Rows.Add(new object[] { 1, "Banana" }); dt.Rows.Add(new object[] { 2, "Cherry" }); dt.Rows.Add(new object[] { 3, "Grape" }); dt.Rows.Add(new object[] { 4, "Watermelon" }); cbo.DataSource = dt; cbo.ValueMember = "Key"; cbo.DisplayMember = "Name"; band.Columns["Int32 1"].EditorComponent = cbo; band.Columns["Int32 1"].CellActivation = Activation.ActivateOnly; }
Why are you using UltraCombo and EditorComponent? That will work, of course, but it's not a very efficient way to do it. Unless you need the combo to provide editor buttons or multi-select, it would be better to use UltraDropDown as the ValueList of the column.
Not a problem; I see what you're doing and I agree, with a value list this problem does not occur. However, i'm setting the EditorComponent to an UltraCombo; this is when I'm seeing the undesired scroll behavior with CellActivation set to ActivateOnly
The forums will not allow me to update a file with an unknown extension like that.
Only files with the following extensions are allowed: zip, cab, jpg, gif, png, mpg, mpeg, avi, wmv, wma, mp3, ra, rar, rm, sql, txt.
All I did was put a grid on a form and bind it to a DataSource that has an integer field with values from 0 to 4.
Then I did this:
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { UltraGridLayout layout = e.Layout; UltraGridBand band = layout.Bands[0]; ValueList vl = new ValueList(); vl.ValueListItems.Add(0, "Apple"); vl.ValueListItems.Add(1, "Banana"); vl.ValueListItems.Add(2, "Cherry"); vl.ValueListItems.Add(3, "Grape"); vl.ValueListItems.Add(4, "Watermelon"); band.Columns["Int32 1"].ValueList = vl; band.Columns["Int32 1"].CellActivation = Activation.ActivateOnly; }
Mike, could you send the sample in a different way? (Zip, with the extension changed to zi_ might work) I believe our zealous Corporate email security software is stripping the attachment without giving me the option to retrieve it.
I should also mention that I am specifically using an UltraCombo as the Editor, and the latest release of Infragistics WinForms (13.2, updated 2 days ago)
I tried this out and I can't get the behavior you describe. The mouse wheel has no effect on a column where the CellActivation is set to ActivateOnly. When I use the wheel in a case like this, the grid scrolls, and the value of the cell does not change, which seems like correct behavior.
I'm attaching my sample here so you can try it and see if you get the same results.