Home Forums WinForms controls Xceed Grid for WinForms A couple Grid Issues

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

    I have searched the forums several times using different keywords and still haven’t figured out a solution.

    1. If I override the grids column CellEditorManager to any other TextBox based Edit Control I seem to loose the ability to start typing and have the editor automatically activate. What do I need to do to allow my TextBox based editors start handling input when I start typing right away.

    2. Apparently you virtualize the CellViewerManager, so the “Leave” event never fires on a Control tied to a CellViewerManager. Is their some event that I can use to know when I leave a cell (I still want the “CurrentColumn” / “CurrentCell” to be the one I’m leaving) — works only if the cell value was changed (which works perfectly _if_ the cell was changed) — but I need it to fire every time I’m leaving a cell; so I can tie certain processing before the next cell is activated. CurrentCellChanged is fired when I get to the new Cell, so that doesn’t work.
    At worst case if we can’t come up with a method, can I ask that a “BeforeCellChanged” event be added to the next version?

    3. Is their someway to capture the “Tab” key while inside the editor mode; Because I would like the functionality to be Tab->Next Cell (Automatic wrapping to next line). If I am not “editing” I have managed to capture the behavior and re-route it so that:
    – Shift-Tab from the very first cell will go to the prior control.
    – Tab from the very last cell in the grid will go to the next control.
    – Shift-Tab from the first cell of a line will go to the last cell / prior line.
    – Tab inside grid will auto-wrap to the next line if it was on the last cell of that line.

    I would like to duplicate this while in edit mode. Tab by default in the grid just wraps around on the same line.

    4. Just to verify, DataRowTemplate.CellEditorDisplayConditions this only means the Editor is used instead of the Viewer to Show the data, this does NOT mean that this causes it to go into editing mode automatically correct?

    Nathan.

    Imported from legacy forums. Posted by Nathanael (had 4157 views)

    Xceed Support
    Member
    Post count: 5658

    1. I am not able to reproduce this issue. Meaning that when I set the CellEditorManager to a custom TextBox, it has the same behavior as the WinTextBox.

    e.g.,
    TextBox myTextBox = new TextBox();
    dataRowTemplate1.Cells[ 0 ].CellEditorManager = new CellEditorManager( myTextBox, “Text”, true, true );

    2. You can use the EditLeft event on the cell, it should be the wanted behavior:

    e.g.,
    private void Form1_Load( object sender, EventArgs e )
    {
    //…
    dataRowTemplate1.Cells[ 1 ].EditLeft += new EditLeftEventHandler( Form1_EditLeft );

    }
    void Form1_EditLeft( object sender, EditLeftEventArgs e )
    {
    System.Diagnostics.Trace.WriteLine( “I left the Edit mode” );
    }

    3. The get the Tab press event while in edition, you need to subscribe to the QueryInputKey event on the CellEditorManager:

    e.g.,
    private void Form1_Load( object sender, EventArgs e )
    {
    //…
    dataRowTemplate1.Cells[ 2 ].CellEditorManager.QueryInputKey += new QueryEditorInputKeyEventHandler( CellEditorManager_QueryInputKey );
    }

    void CellEditorManager_QueryInputKey( object sender, QueryEditorInputKeyEventArgs e )
    {
    if( e.KeyData == Keys.Tab )
    {
    //…
    }
    }

    4. The <a href=”http://doc.xceedsoft.com/products/Xceedgrid/Xceed.Grid~Xceed.Grid.GridControl~CellEditorDisplayConditions.html”>documentation</a&gt; on the subject might be more explicit then me.

    Imported from legacy forums. Posted by CharlesB (had 289 views)

    User (Old forums)
    Member
    Post count: 23064

    1. Hmm, this still totally fails for me (I’m running 2.3.7326.14130). If I don’t add my own editor to the cell; I can start typing while NOT in edit mode and it will automatically enter edit mode and over write the cell contents with what I type. When I use a standard TextBox (or my custom control):

    I must activate the edit mode by clicking into the cell, or causing an event that fires the enteredit on the cell/row.

    Just to verify it wasn’t my application; If you take your “RichCellEditors” C# sample application run it, just start typing in the top “Simple Textbox” it will automatically overwrite when you start typing. Quit, goto the “RichCellEditors.cs” file into the “CreateTextBoxes” routine and make the following minor changes:

    Replace:
    dataRow.Cells[“Editors”].CellEditorManager = new TextEditor();

    With:
    Xceed.Grid.Editors.CellEditorManager TextEditor;
    TextBox TextEditBox = new TextBox();
    TextEditor = new Xceed.Grid.Editors.CellEditorManager(TextEditBox, “Text”, true, true);

    dataRow.Cells[“Editors”].CellEditorManager = TextEditor;

    Then try just typing in the cell and you will see it does not “Auto-enter” edit mode. You can start the edit mode by clicking in it or hitting F2 after tabbing to it.

    Out of curiosity does it matter if I use the “Columns” CellEditorManager or the the DataRowTemplate.Cells[].CellEditorManager — I tried both ways and it didn’t make a difference. Just my code uses the Columns[] method for other things. (Any speed difference also, because I can adapt my code to use the DataRowTemplate.Cells method if their is a speed difference)

    2. No, that only catches if I’m leaving “edit” mode on a cell. It is actually easier for my purposes to catch the “CellValueChanged” event on the grid in this specific case, as CurrentRow/CurrentCell will still be pointing to the cell that caused the event.

    What I want is say I am tabbing between cells (not in edit mode) I want to be able to fire the event “before” I have left the cell (like OnLeave in a normal field). For instance the “CurrentCellChanged” has the new currentcell. I would like a “BeforeCurrentCellChanged” that get ran so that “CurrentRow” & “CurrentCell” variables of the Grid still point to the proper cell/row of the cell that is LOSING the FOCUS.

    3. Thanks, that looks like that will work!

    Would you rather I open Support issues for the above two issues; I personally like doing my support via forums so that my customers can see the resolution of them — but I need to get an answer soon on these issues. Or any work around you can come up with.

    The only work around that I can think of is to put the cells into edit mode automatically — but when I tried it I get weird other artifacts when refreshing, and trying to make sure it is in edit mode at all times. Is their any easy way to make it default to being in edit mode when the grid is entered, and when they hit “Enter”/”Esc” which exits edit mode to put it back into edit mode?

    Nathan.

    Imported from legacy forums. Posted by Nathanael (had 392 views)

    User (Old forums)
    Member
    Post count: 23064

    Btw, I didn’t realize my Dev machine was that many versions out of date. 😉 I’m pulling the latest to see if this fixes at least the first issue.

    Nathan.

    Imported from legacy forums. Posted by Nathanael (had 317 views)

    User (Old forums)
    Member
    Post count: 23064

    Pulled the Latest — no change. Modified the Sample application again just like I posted; made sure it was using the latest references version 3.6.7570.10530 assemblies.

    If I start the edit mode by clicking in the cell or hitting F2 it works. Just moving the selection box into the cell by the arrow keys and starting typing won’t auto enter edit mode.

    Nathan.

    Imported from legacy forums. Posted by Nathanael (had 896 views)

    User (Old forums)
    Member
    Post count: 23064

    Ok, I found an answer to (#1) the editor not entering AutoEdit mode — you need to have a QueryActivationChar (or QueryActivationKey) event added to your CellManagerEditor so that you can “decide” if you want to auto-enter edit mode.

    Still looking for the answer to number #2.

    Nathan.

    Imported from legacy forums. Posted by Nathanael (had 5359 views)

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