Hi, I have WDG in which I use the CellEditing Exiting EditMode event to set the style of the bound column cells when the cell content is edited. I have three questions:1. I want to set the cell style only when cell content has changed. Now the above function is triggered anytime the cell content is edited regardless of whether the cell content has changed. Is there a way to check if the content has changed before changing the cell style?
2. I want to achieve the same functionality for the TemplatedColumn cells i.e. when the content changes I would like to be able to invoke the same function. Since the TemplatedColumn does not have the same event exposed, how can I achieve this functionality?3. I want to clear the style after the row update has occurred. How do I achieve this?Thanks,
Hello a105019,
Thank you for posting on Infragistics forum.
I can give you the following answers to your questions:
1. You can use “EnteredEditMode” event, take the value of the cell, store it in global variable and then use it in “ExitingEditMode” to check if the value is changed. If value is changed then you can apply the styles needed. You can also use “CellValueChanged” event to achieve this - http://help.infragistics.com/Help/NetAdvantage/ASPNET/2010.3/CLR4.0/html/Infragistics4.Web.v10.3~Infragistics.Web.UI.GridControls.EditingClientEvents_members.html
2. When template column is used you can use the embedded control functionality. If it is a “TextBox” you can get the text entered in it and then use some of the “TextBox” events (like “Leave” or “LostFocus”) to make your style change.
3. You can use “RowUpdating/ed” event to remove the styles set for the row or row cells.
Let me know if you have further questions.
Hi, Thanks for the reply. The item 1 & 2 are exactly what I am looking for. Thats really helpful. I am still bit unclear about how to approach the 3rd item. A code sample will be of great help.
Thanks
Yes I got this working. Thanks
In order to subscribe for the “RowUpdated/RowUpdating” event you should add it in client events like this:
<Behaviors>
<ig:EditingCore>
<EditingClientEvents RowUpdated="updatedHandler" RowUpdating="updatingHandler" />
</ig:EditingCore>
</Behaviors>
<script type="text/javascript">
function updatedHandler(sender, args){ // sender is the object and e is the argument list}
</script>
In the following link the example is shown on how you can use this event to get the row modified - http://help.infragistics.com/Help/NetAdvantage/ASPNET/2010.3/CLR4.0/html/Infragistics4.Web.v10.3~Infragistics.Web.UI.GridControls.EditingClientEvents~RowUpdated.html
When you get the row you can change every cell style or modify other data if you need.
Let me know if you need further assistance with this question.