This is a migrated thread and some comments may be shown as answers.

[Solved] Change background colour of a cell after edit

5 Answers 166 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Satrajit
Top achievements
Rank 1
Satrajit asked on 16 Sep 2010, 04:52 PM
Hello,

I have requirement that after the user edits a particular cell, the background colour of the cell must change to green.

I am using the following lines of code in the cell edit ended event ,which seems to work , if I navigate to the next cell in the same row, but when I click on the next row or some other row, the color changes are gone.

try

{

 

 

SolidColorBrush SldClrBrsh = new SolidColorBrush(Colors.Green);

 

if

 

 

(e.NewData ! = e.OldData)

 

{

e.Cell.Background = SldClrBrsh

 

as Brush;

 

}

 

 


}

 


Can someone please let me know the correct way of doing this?

Note: I have also tried using the cell validated event, but I get the same results.   

Also I do not have any code on the row edit completed event.

I am using the 2010.2.812.1040 version of the controls

5 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 17 Sep 2010, 06:25 AM
Hello,

 You can check this demo for more info about how to achieve your goal.

Regards,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Juliana
Top achievements
Rank 1
answered on 17 Jan 2011, 04:10 PM
Hello Vlad,

What condition would you advise to use in implementation of ConditionConverter? Could I pass as a parameter for IValueConverter smth like e.OldData to localize updated cells?

Thanks,
Juliana
0
Veselin Vasilev
Telerik team
answered on 20 Jan 2011, 02:07 PM
Hi Juliana,

Can you please give us some more information about your case? Is it the same as the Satrajit's one?

Regards,
Veselin Vasilev
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Juliana
Top achievements
Rank 1
answered on 24 Jan 2011, 03:41 PM
Hello Veselin ,

I have columns with CheckBox in CellTemplate. The check box I’ve either clicked or de-clicked should outline in red (during the session). After saving changes it should be cleaned.

My solution was to have two fields : current value which is bound to cell and previous value where I store the loaded value. In template selector I compare these values and assign outlined or normal template.

My problem is that I have about 50 columns like that.

Is it the best solution?

Best Regards,
Juliana
0
Veselin Vasilev
Telerik team
answered on 31 Jan 2011, 10:18 AM
Hello Juliana,

Yes, that seems to be the correct approach.

Kind regards,
Veselin Vasilev
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
GridView
Asked by
Satrajit
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Juliana
Top achievements
Rank 1
Veselin Vasilev
Telerik team
Share this question
or