Infragistics V9.2
The best way to get a grip of this bug? Is propably to set a test application, se code below....
When done, try this:
- Filter custID:s by enter "1" in the filer cell
- Use the backspace key to delete the "1"
- Position the cursor to fname filter cell, using the mouse
- RESULT : Error Messagebox: Error: Unable to update the data value:
============== CODE "INSTRUCTIONS"===========
1. Create a windows form application
2. Copy the code below into Form1
3. Add a load event on the form, se code below
4. Add an InitializeLayout to the grid, se code below
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using Infragistics.Win;using Infragistics.Win.UltraWinGrid;
namespace WindowsFormsApplication{ public partial class Form1 : Form { public Form1() { InitializeComponent(); }
private void Form1_Load(object sender, EventArgs e) { // Set up the grid with some sample data. ultraGrid1.DataSource = OneBand; }
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { // Layout GeneralGridLayout(e); GeneralGridFilterLayout(e);
// Width foreach (UltraGridColumn column in ultraGrid1.DisplayLayout.Bands[0].Columns) { column.Width = 150; } }
public static DataSet OneBand { get { DataTable tblCust = new DataTable("customers"); DataColumn col;
col = new DataColumn("custID", typeof(int)); tblCust.Columns.Add(col);
tblCust.PrimaryKey = new DataColumn[] { col };
col = new DataColumn("fname", typeof(string)); tblCust.Columns.Add(col);
col = new DataColumn("lname", typeof(string)); tblCust.Columns.Add(col);
col = new DataColumn("firstContact", typeof(DateTime)); tblCust.Columns.Add(col);
string[] names = { "Mike Finnigan", "Claudia Vanst", "Paul Forrest", "Dirk Spiggler", "Abraham Lincoln" }; DateTime[] dates = { DateTime.Now.AddYears( -2 ), DateTime.Now.AddMonths( -1 ).AddMinutes( 19 ).AddSeconds( 2 ), DateTime.Now.AddHours( -4 ).AddMinutes( 3 ).AddSeconds( 7 ), DateTime.Now.AddDays( -1 ).AddMinutes( 123 ).AddSeconds( 12 ), DateTime.Now.AddMonths( -1 ).AddMinutes( 19 ).AddSeconds( 3 ) }; DataRow row; char[] delim = { ' ' }; string[] name; for (int idx = 0; idx < names.Length; ++idx) { row = tblCust.NewRow(); name = names[idx].Split(delim);
row["custID"] = idx + 1; row["fname"] = name[0]; row["lname"] = name[1]; row["firstContact"] = dates[idx];
tblCust.Rows.Add(row); }
DataSet ds = new DataSet("CustInfo");
ds.Tables.Add(tblCust);
return ds; } }
public static void GeneralGridLayout(InitializeLayoutEventArgs e) { e.Layout.ScrollStyle = ScrollStyle.Immediate; e.Layout.ScrollBounds = ScrollBounds.ScrollToFill; }
public static void GeneralGridFilterLayout(InitializeLayoutEventArgs e) { e.Layout.Override.FilterUIType = FilterUIType.FilterRow; e.Layout.Override.FilterEvaluationTrigger = FilterEvaluationTrigger.OnCellValueChange; e.Layout.Override.FilterOperatorLocation = FilterOperatorLocation.WithOperand; e.Layout.Override.FilterOperatorDefaultValue = FilterOperatorDefaultValue.StartsWith; e.Layout.Override.FilterClearButtonLocation = FilterClearButtonLocation.RowAndCell; e.Layout.Override.FilterRowPromptAppearance.BackColorAlpha = Alpha.Opaque; e.Layout.Override.SpecialRowSeparator = SpecialRowSeparator.FilterRow; e.Layout.Override.SpecialRowSeparatorAppearance.BackColor = Color.FromArgb(233, 242, 199); }
}}
Hi,
In the future, it would be much better and easier if you could simply attach a sample project to your post. Creating a sample from a code snippet like this is not easy, and the steps you listed here left out a lot of things I had to do in order to get this working, such as adding the project references, the using statements, and adding a grid to a form.
Anyway, I tried this out, but I was unable to reproduce the problem. This might be because the steps you listed here don't seem to make much sense. I followed the first two fine. I typed a "1" into the filter cell for the fname column and all the rows in the grid were filtered out. Then I deleted the "1" and all the rows came back.
But that's where you lost me:
segerby said:- Position the cursor to fname filter cell, using the mouse
The cursor is already in the fname filter cell. So I don't know what you mean here. Perhaps you mean click away from the fname filter cell. So I tried clicking on another cell in the filter row. But this works just fine and I get no exceptions.
Are you using the latest service release?
How to get the latest service release - Infragistics Community
Hello Mike!
Sorry about the trouble I got you into with the code.
To get this behavior, you must:
- enter "1" in the filter cell for custID (NOT int the filter cell of fname)
- delete it with the backspace key
- then try move the cursor to another cell......
Okay, I tried again following your new instructions, but I still don't get any errors.I tried clicking on another cell in the filter row, tabbing out of the cell, and clicking on another cell outside the filter row and everything worked just fine for me.
Hello!
OK, maybe its an environment issue, anyway I attach my test application if i will make any difference, the istruction i still:
- Position the cursor in the custID filer cell
- Enter the following keystroke : "1", "Backspace", "Tab"
- In my environment I now get the Error Message
I will leave it here and instruct my users not to use the "Backspace" key when filtering , thanks for yor time!
Hi Mike!
Where logged on to a different account: miho_cab, when answering, you are still "talking" to the same person.
Thanks again for your time