tag:blogger.com,1999:blog-6184851556979812172.post7036144381474369479..comments2023-10-25T18:27:44.770+10:00Comments on Math Geek Coder: Linq with Xceed's WPF Grid - Part IILuke Marshallhttp://www.blogger.com/profile/11665669405673984228noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-6184851556979812172.post-70057112240573107982007-09-26T13:25:00.000+10:002007-09-26T13:25:00.000+10:00I've updated the post again to remove the need for...I've updated the post again to remove the need for the dirty flag hack.<BR/><BR/>Embarrassingly the base.EndEdit() call was reseting the flag to false.<BR/><BR/>I hang my head in shame. :)<BR/><BR/>Cheers,<BR/>LukeLuke Marshallhttps://www.blogger.com/profile/11665669405673984228noreply@blogger.comtag:blogger.com,1999:blog-6184851556979812172.post-48371396785868059942007-09-21T08:09:00.000+10:002007-09-21T08:09:00.000+10:00Thanks Marcus! They are good suggestions.I origin...Thanks Marcus! They are good suggestions.<BR/><BR/>I originally tried using the DataRow.IsDirty flag, but it is read-only and for some reason wasn't being set correctly. <BR/><BR/>I was going to look into this further as I totally agree, if nothing has been changed, there's no point in calling SubmitChanges().<BR/><BR/>The flip side is that linq handles all of the changes, so if nothing has changed, SubmitChanges() does nothing.<BR/><BR/><BR/>I like the property idea for the LinqGrid, and will definately use it. I'll still probably set it to use the singleton, (as linq doesn't play well with multiple instances) - but the design will be much cleaner.<BR/><BR/>Cheers!Luke Marshallhttps://www.blogger.com/profile/11665669405673984228noreply@blogger.comtag:blogger.com,1999:blog-6184851556979812172.post-8902887058673166382007-09-20T23:45:00.000+10:002007-09-20T23:45:00.000+10:00Hi Luke,I like where you are going with this serie...Hi Luke,<BR/><BR/>I like where you are going with this series of post...<BR/><BR/>I do have 2 suggestions on the design at this point:<BR/><BR/>- Instead of declaring your own "dirty" flag, I suggest using the DataRow.IsDirty property. The main advantage of using it will be that if the LinqRow enters edition mode but receives no modifications, then changes will not be submitted (can dramatically reduce number of calls being made, depending on your EditTriggers/CellEditorDisplayConditions )<BR/><BR/>- You could add the Linq context instance as a property on the LinqGrid instead of using a static reference. This would make the design more versatile and re-usable.<BR/><BR/>Accessing the context would then be as easy as:<BR/><BR/>LinqGrid parentDataGrid = DataGridControl.GetParentDataGridControl( this ) as LinqGrid;<BR/><BR/>if( parentDataGrid != null)<BR/>{<BR/>parentDataGrid.LinqContext.SubmitChanges();<BR/>}<BR/><BR/>I'm already impatient to see your next posts of this series.Anonymousnoreply@blogger.com