Hi
I am using IDataErrorInfo for managing error in object, I can generate error in some cases in child row, but it doesn;t show error icon in parent row, when all grid are collapsed no one can notice error in child grid, I want to show error in parent row at same time, I need some idea, help me with code example.
rubie
Hi Rubie,
I have taken the example from the following article and attached it as a project to this post, following your requirements:
http://help.infragistics.com/Help/NetAdvantage/WinForms/2013.1/CLR4.0/html/WinGrid_Display_Row_Cell_Errors_Using_IDataErrorInfo.html.
Please write the string "1" in the second column in the child row, then collapse the parent row.
Please feel free to let me know if I misunderstood you or if you have any other questions.
but I couln;d able use this without dataset or datatable, how can I do when I have bindingsource.
Hello,
As far as I understand your data source is some list of T class. So you could do something similar to the approach shown in the attached sample
Please let me know if you have any further questions.
I am making simple , how can ignores error in cell, can I show error in only rowselector.
I am attaching you sample, if u try totalattenddays in child table more then 31 gives you error icon in all cell of parent table , how can I set on error only on rowselector on that time.
Yes, you could ignore cell error. To do this you should set
ultraGrid1.DisplayLayout.Override.SupportDataErrorInfo = SupportDataErrorInfo.RowsOnly;
in order use IDataErrorInfo to display only row errors. Cell errors are ignored.
In your Employee class, you should implement validate method, which validates all of your fields and set _error if there is any error in the record. Then in get methods of Error property, you should call your validate method. I have modified your sample in order to demonstrate you this approach.
I hope that this will helps you.
In this case, I could n't show any error icon on any cell but only on row selector, what I will do, if will have to show icon on relative cell as well as row selector.
thanks
modified: if I make RowAndCell then it will through icon on every cell of parent row, when I got error on child row.
Thanks Hristo, But what happen if there is any data validation error on parent table , it shouldn't show icon on parent relative cell , if I make RowAndCell then it will through icon on every cell of parent row, so there is not any way to set error icon on rowselector and relative cell both parent and child level.
Hello ,
You could apply SupportDataErrorInfo by band level, so on your second band you could apply this property to CellOnly for example and also you should implement validate method, which validates all of your fields and for the Attendence class. Please see attached sample.