The properties for my UltraGrid show a property for what appears to be each of the ErrorProviders defined on the form. The description column is like "Error on ErrorProvider1" where ErrorProvider1 is replaced with the name of the provider. The property value is blank and when you click on it there are no defaults, dropdown or elipses provided. Is is possible to link the grid to an ErrorProvider and if so how?
Thanks, Dave
Hi Dave,
There is no such property on the grid. You are probably looking at an extender property. If you place an ErrorProvider component on your form, then the ErrorProvider component provides an extender property to any controls on the form. It's nothing to do specifically with the grid, this will show up on any control.
So then there isn't any way to use an ErrorProvider with an UltraGrid?
Hi Tobias,
The ListObject returns the object in the data source that represents the data item. The problem with the code you have here is that it is assuming that the object is always a DataRowView. That will only be true if you are using a DataSet / DataTable as your DataSource. If you are using a List<T> or a BindingList<T>, then you can't cast that into a DataRowView, because it's not a DataRowView, it's a T.
So if your data source is: BindingList<Person>
Then your code to get the typed ListObject would be:
var drv = (Person)e.Row.ListObject;
My problem exactly, sample code fails on following line:
var drv = (DataRowView)e.Row.ListObject;
Have you solved this? And how?
If the grid data source is bound to a business entity, ie BindingList<Person>, then wouldn't e.Row.ListObject simply return an entity instance of Person?
Hello,I am facing a very similar situation, which you faced some time ago.I have a grid whose data source is a business entity, ie BidingList<Person>. I want to validate user inputs for all cells in the row(s) for that grid.I want to use the approach listed at http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/WinGrid_Display_Row_Cell_Errors_Using_IDataErrorInfo.html but the issue is that in my case the e.Row.ListObject returns a BidingList<Person>. , whereas the example in this link expects a DataRowView .How did you resolve it in ur case, as you also had a business entity and not a DataRowView .Pls advice.Is there any other better approach for it ? using fragistics UltraValidator control, custom coding for cellupdate events, etc.
I was a little worried about looping through the grid, but performance seems fine. Below is the code I used in case others are looking for a similar solution. As you can see, I stopped on just the row.
{
if ((int)c.CustomerID > errCustomerID) //make sure you're past the previous error
{ errCustomerID = (int)c.CustomerID;
}
{ CurrentRow.Activate(); }