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
2965
Active Cell highlighting
posted

Apologies if this has been answered before, but I can't find anything relevant.

I have a grid, which is coloured by row, so I've changed the row Appearance BackColor and ForeColor.  The grid default CellClickAction is RowSelect.  But on certain columns of data I need to edit the cell, so on these columns I've set CellClickAction to CellSelect and I've enabled editing by double clicking on the cell.

My problem is I can drag a selection over the cells which are set to CellSelect.  Can I disable this anywhere?  At the moment I'm setting cell.SelectedApperance BackColor to Transparent and ForeColor to Black which isn't ideal.

Also, can I prevent ActiveCellAppearance from overridding my Row Appearance colours?  The only way I can see to do this is by setting ActiveCellAppearance.BackColor to Color.Transparent, but then I have a problem with my ForeColor as this is different per row so I can't set it to one specific colour.

Thanks,
Campbell

Parents
No Data
Reply
  • 469350
    Offline posted

    Hi Campbell,

    jcwild said:
    My problem is I can drag a selection over the cells which are set to CellSelect.  Can I disable this anywhere?  At the moment I'm setting cell.SelectedApperance BackColor to Transparent and ForeColor to Black which isn't ideal.

    I'm not sure I understand what you mean here. Why is selecting the cells a problem? Are you saying that you don't want the users to be able to select certain cells, but that they need to be able to select ranges of cells that do not include the editable one? Seems like an unusual UI and I'm not sure why you would want that.

    The only way I can think of to acheive something like that would be to handle the BeforeSelectChange event and cancel it if the new selection includes a cell you don't want.

    jcwild said:
    Also, can I prevent ActiveCellAppearance from overridding my Row Appearance colours?  The only way I can see to do this is by setting ActiveCellAppearance.BackColor to Color.Transparent, but then I have a problem with my ForeColor as this is different per row so I can't set it to one specific colour.

    Again, I am a little confused by the question. It sounds to me like you simply don't want an ActiveCellAppearance on the grid at all. If that's the case, then you can simply Reset it or set the BackColor and ForeColor to Color.Empty (not Color.Transparent).

     

Children