On a simple grid on a form - column rules like 'not null' are enforced e.g. an 'not null' message shows when you move off the row
When it is a 3 hierarchy grid - it does not. Why? (Doesn't matter - is not the question i seek)
NB this is a column rule. As opposed to a Table Constraint, or Index Constraint (unique) - which are not enforced in the Grid and only appear when the user Saves.
It seems that DataTable can have constraints added to it - so it appears necessary to recreate all table constraints in .NET.
Can someone simply confirm that wingrid does not deal with index constraints, please ?
If a column rule does show up perhaps I am missing some setting that allows other constraints to kick in........ ?
Yeah I agree, I went to a new project and dropped adapters onto a form and an ultragrid and created a constraint on the 3rd table, then set the datasource to look at the table level1. All I am doing is setting the grid to look at the first table and all 3 show up. Great nice and easy
And then, yep the 3rd level in the grid obeyed just fine and came up with all the error messages i.e. not null , unique constraint.
Also I then changed the datasource to a dataview for table 1 - and it still worked.
Then i went a step further and created dataview for table 2 and table 3 and bound them to the table2bindingsource and table3bindingsource
And it still worked. ( idea is to be able to further refine the table2 and 3 dataview down if desired)
So why does my original project not work ? AAAARRRRRRHHHH!!!
I will look and say when i find it.
The WinGrid does not really deal with the DataTable directly. It only deals with the IBindingList interface and the BindingManager. If the grid tries to update the data source and it fails for any reason, then the grid should recieve a notification of the error, or maybe an exception. In which case, the grid will respond by firing the CellDataError and/or the Error event and show an error message to the user.
There is no difference when the grid has a single table or a hierarchical relationship.