Skip to main content

Microsoft Silverlight

Answered Question Datagrid column cell color change, after editRSS Feed

(0)

sl_ananya
sl_ananya

Member

Member

16 points

21 Posts

Datagrid column cell color change, after edit

Hi,  inside my datagrid I have used celltemplate and celleditingtemplate to display and edit data.

 

Now , i can edit data after double click. I want to change color of column after I am done with editing. How shud I do that. I think I need to do this in Datagrid's committingedit event, but how?

sladapter
sladapter

All-Star

All-Star

17181 points

3,133 Posts

Re: Datagrid column cell color change, after edit

The best way to do this is using DataBiding, you can set the binding to your display control's Background. Use a ValueConverter in the binding, based on the Data return different SolidColorBrush to set the background color.

See the answer in this thread:

http://silverlight.net/forums/p/27465/93474.aspx#93474

sladapter
Software Engineer
Aprimo, Inc

Please remember to mark the replies as answers if they answered your question

sl_ananya
sl_ananya

Member

Member

16 points

21 Posts

Re: Datagrid column cell color change, after edit

I am binding my datagrid with a collection, And more than one column is editable.
I want to change color of column only when someone has edited data. How I will determine that
that which column is being edited, and user has actually edited data. i.e data in textbox is different than the original data.

lee_sl
lee_sl

Contributor

Contributor

2990 points

584 Posts

Answered Question

Re: Re: Datagrid column cell color change, after edit

try something like this

http://leeontech.wordpress.com/2008/10/05/changing-foreground-of-cells-that-are-modified-in-datagrid/

----------------------------------------------
Available for consulting in Dallas, TX
http://leeontech.wordpress.com/

puneetpriyadarshi
puneetpr...

Member

Member

28 points

17 Posts

Re: Re: Datagrid column cell color change, after edit

 Try this link it might help

 

Thanks,

Puneet

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities