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
395
Appearance on CellClick event
posted

Hi,

If I setting an appearance on the current clicked cell (CellClick event) and than click on another cell, my appearance on the last cell getting lost.

What do i wrong?

            Appearance appearancePlus = new Appearance("minus");
            appearancePlus.Image = Resource1.add;

            Appearance appearanceMinus = new Appearance("plus");
            appearanceMinus.Image = Resource1.delete;

private void gridData_InitializeRow(object sender, InitializeRowEventArgs e){

          e.Row.Cells[0].Appearance = appearancePlus; //default

}

private void gridData_ClickCell(object sender, ClickCellEventArgs e){

          e.Cell.Appearance = appearanceMinus; //the picture should change and never getting lost

//thats work only so long as the current cell is selected

}

 

THX

Parents
No Data
Reply
  • 37774
    Verified Answer
    posted

    My only guess here is that something that you are doing is causing the InitializeRow event to fire (such as changing the value of another cell in that row).  You could get around this by only setting the Appearance in the InitializeRow event when the e.ReInitialize property is false.

    -Matt

Children
No Data