Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
555
Setting the GridCell Style
posted

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,

Parents
  • 15979
    Suggested Answer
    posted

    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.

Reply Children