Home Forums WinForms controls Xceed Grid for WinForms Visual Cues While Tabbing Through Grid

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #17165 |

    I’m having issues with the visual cues when a user is using the Xceed Grid.  When a user tabs through the grid, I cannot get the current cell to display any kind of visual effect to notify the user where he/she is at.  You have no idea what cell you are on until you start to type something to edit the cell.  We want to use Grid1.SingleClickEdit = False, but have tried setting that to true, but the cursor does not display in the cell you are in after a tab like I would expect.  I have also tried the code below (found on this forum), to change the cell’s backcolor on the current cell. 

     Private Sub GridIdentity_CurrentCellChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridIdentity.CurrentCellChanged
        If Not previousCell Is Nothing Then
            previousCell.ResetBackColor()
        End If
        If Not GridIdentity.CurrentCell Is Nothing Then
            GridIdentity.CurrentCell.BackColor = Color.SkyBlue
        End If
        previousCell = GridIdentity.CurrentCell
    End Sub

    This also does not work, the cell backcolor appears to flicker for a moment almost like the cell backcolor was changed for an instant, but then the applied stylesheet (office themes) override it.  This appears to be a bug and we need a work around so there is a visual cue to the user while tabbing.  We are building our apps to have the blue office 2007 style theme to them.  There appears to be no solution found on this forum yet.  Please advise.

    Nick

    Imported from legacy forums. Posted by Nick (had 1755 views)

    User (Old forums)
    Member
    Post count: 23064

    I had the same problem. You have most of the answer already, having chosen the right event to handle; just try this (C# code, should be trivial to convert to VB):

            private void grid_CurrentCellChanged( object sender, EventArgs e )
            {
                Cell cell = grid.CurrentCell;
                if( !cell.ReadOnly )
                {
                    if( cell.CellEditorManager.GetType().Equals( typeof( TextEditor ) ) ) // in case you have other editors for which you don’t need a cursor
                        cell.EnterEdit(); // this displays the cursor
                }
            }

    Good luck, and best regards.

     

    Aaron Haspel

     

     

    Imported from legacy forums. Posted by Aaron (had 331 views)

    User (Old forums)
    Member
    Post count: 23064

    Does not work. I get an error.

    Error: An attempt was made to edit a cell that is already being edited.

     

    Plus, this would not handle dropdowns, checkboxes, etc.  I need a visual cue for all tabbing, like cell background color stated in my first post.

    Imported from legacy forums. Posted by Nick (had 1099 views)

    User (Old forums)
    Member
    Post count: 23064

    The solution is not use a built in stylesheet.  Create your own custom style so you can highlight the current cell however you wish.  I created a custom style to apply to my grid that looks much like the blue office 2007 theme.  Lot of work to get the gradients looking nice, but once you got it you can use it in all of your projects.  Too bad the built in office themes don’t have these flaws for current cell highlighting.

    Imported from legacy forums. Posted by Nick (had 2028 views)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.