ValueChangedEvent and cell's background color

Aug 31, 2009 at 8:13 PM

Hello,

 

i'm trying to achive the following result from my grid.

I need the back ground of a row to change when I edit some cell. What I heve is:

 

 

 public class ValueChangedEvent : SourceGrid.Cells.Controllers.ControllerBase
        {
            public override void OnValueChanged(SourceGrid.CellContext sender, EventArgs e)
            {
                base.OnValueChanged(sender, e);
                SourceGrid.Position otherCell = new SourceGrid.Position(sender.Position.Row, 10);
                SourceGrid.CellContext otherContext = new SourceGrid.CellContext(sender.Grid, otherCell);
                
                otherContext.Value = true;
                if (GetVal(sender, sender.Position.Row, 2) == "True")
                {
                    //I need the code to change the background
                    //color of the row sender.Position.Row
                }
            }
            private string GetVal(SourceGrid.CellContext sender, int row, int col)
            {
                SourceGrid.Position otherCell = new SourceGrid.Position(row, col);
                SourceGrid.CellContext otherContext = new SourceGrid.CellContext(sender.Grid, otherCell);
                return otherContext.Value.ToString();
            }
        }

 public class ValueChangedEvent : SourceGrid.Cells.Controllers.ControllerBase

        {

            public override void OnValueChanged(SourceGrid.CellContext sender, EventArgs e)

            {

                base.OnValueChanged(sender, e);

                SourceGrid.Position otherCell = new SourceGrid.Position(sender.Position.Row, 10);

                SourceGrid.CellContext otherContext = new SourceGrid.CellContext(sender.Grid, otherCell);

 

                otherContext.Value = true;

                if (GetVal(sender, sender.Position.Row, 2) == "True")

                {

                    //I need the code to change the background

                    //color of the row sender.Position.Row

                }

            }

            private string GetVal(SourceGrid.CellContext sender, int row, int col)

            {

 

                SourceGrid.Position otherCell = new SourceGrid.Position(row, col);

                SourceGrid.CellContext otherContext = new SourceGrid.CellContext(sender.Grid, otherCell);

                return otherContext.Value.ToString();

 

 

 

            }

        }

 

Any Ideas????

 

Thank you very much

 

Sep 2, 2009 at 11:45 AM
It looks like you have a handle on it.. Are you still asking how to do something?
Derek