I've been all over google looking for a simple event (and example) of the event to call when updating a row in WinGrid. What I have is a grid showing a list of orders; all columns in the WinGrid are uneditable except for the last column of each row which allows users to change a shipping date. Upon exiting the edit I want to call the appropriate WinGrid event (e.g. OnAfterUpdate), then call my business tier to pass the newly supplied date and the order number (DataKey for the row).
Checking documentation all I am finding are events such as BeforeEnterEditMode, BeforeExitEditMode which are all well and good for some additional features and input error checking that I will be implementing, but that's about the extent of it.
To note, we are using the version NetAdvantage 2011.2. Any information on an update event would be extremely helpful as well as small implmentation sample.
Thanks,
Paul
Hello,
I am just checking about the progress of this issue. Let me know If you need my further assistance on this matter?
Thank you for using Infragistics Components.
Hello ,
UltraGridRow object has several properties for indexing of the row, which you could use in several different scenarios:
Index- The index of this row in its parent collection
http://help.infragistics.com/Help/NetAdvantage/WinForms/2011.1/CLR2.0/html/Infragistics2.Win.UltraWinGrid.v11.1~Infragistics.Win.UltraWinGrid.UltraGridRow~Index.html
ListIndex- Returns the index corresponding to this row from the IList that the control is bound to. Return value of -1 indicates that a row has been deleted or doesn't exist anymore.
http://help.infragistics.com/Help/NetAdvantage/WinForms/2011.1/CLR2.0/html/Infragistics2.Win.UltraWinGrid.v11.1~Infragistics.Win.UltraWinGrid.UltraGridRow~ListIndex.html
VisibleIndex - Returns the index of this row in its parent collection, relative to all other visible rows. Hidden rows are not counted.
http://help.infragistics.com/Help/NetAdvantage/WinForms/2011.1/CLR2.0/html/Infragistics2.Win.UltraWinGrid.v11.1~Infragistics.Win.UltraWinGrid.UltraGridRow~VisibleIndex.html
Please let me know if you have any further questions
Thanks for the info. One quick question about the row DataKey. Isn't this something you'd set in the DataKeyNames property of the Grid? (e.g. similar to the ASP.Net GridView control) or is this something that is not available in the UltraWinGrid. If it is, can it be set programmatically?
Hello,
I think that most appropriate event for your scenario is BeforeCellUpdate event, it occurs before a cell is updated. More information and a simple code snipped regarding this event you could find on the following link:
http://help.infragistics.com/Help/NetAdvantage/WinForms/2011.1/CLR2.0/html/Infragistics2.Win.UltraWinGrid.v11.1~Infragistics.Win.UltraWinGrid.BeforeCellUpdateEventArgs.html
This event is cancelable event, which meant that if the new value (e.NewValu) doesn’t meet your custom criteria you could set e.Cancel = true; and the cell wouldn’t be updated with the new value. If the new value meets your custom criteria, then you could call your business tier to pass the newly supplied date and the order number (DataKey for the row).
Please let me know if you have any further questions.