I have an ultragrid with one of the columns having a valuelist of all employees. I set the column style to DropDownValidate (since I want AutoComplete but do not want the user to add values that aren't in the list). I wanted to capture the CellDataError event and put my own messagebox instead of the generic one, but I noticed that the event fires multiple times for one error, thereby displaying multiple error messageboxes in a row.
Do you know why this would be happening and how to prevent it so that it is only called once?
Thank you for your assistance, ~Kelly
Hi Kelly,
I am not aware of any reason why the evert would fire twice, unless there are two errors. Can you duplicate this behavior in a small sample project? What kind of error are you getting? What are you doing in the Error and/or CellDataError events of the grid?
Hi Mike,
Is there a way to do it by skipping the CellDataError event altogether and just somehow passing it to my ErrorProvider (which I set through DataTable_OnRowChanging).
Thanks!~Kelly
The Grid Displays Department and the Employee who is the direct for that department. Its datasource is a datatable I filled from our SQL db. The following appears when you add a new row (I use an error provider):
The direct column has a value list with all of the employees. The column has a DropDownValiate style and Suggest AutoCompleteMode:
I chose DropDownValidate since I do not want them to type someone that does not exist. I then wanted to capture the generic error and display a custom one, so I put this in the CellDataError event of the grid:
Private Sub AvtGrid_SystAdmin_CellDataError(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.CellDataErrorEventArgs) _ Handles AvtGrid_SystAdmin.CellDataError e.RaiseErrorEvent = False MessageBox.Show("You Must Choose a Valid Employee from the List", _ "Invalid Employee", MessageBoxButtons.OK, MessageBoxIcon.Error)End Sub
When the user types an invalid person and commits the record:
The CellDataError event is called multiple times (never the same numer, sometimes 2x, sometimes 5x, etc). This occurs even if I have no code in that event, in which case this is the generic error:
I will attempt to recreate this in a sample project and get back to you with an update, but any help you could give would be much appreciated!~Kelly