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

    Hello

    i’ve overrited the processcmdkey function
    and when the Enter key is pressed i use
    Me.MoveCurrentCell(HorizontalDirection.Right)
    and it works ok until it reaches que last column of the that row.
    how can i move to the 1st cell of the next row.

    thanks.

    Imported from legacy forums. Posted by rubenalves (had 8711 views)

    User (Old forums)
    Member
    Post count: 23064

    simply do this :

    Me.MoveCurrentCell(VerticalDirection.Down)
    Me.MoveCurrentCell(HorizontalDirection.Left)

    🙂

    Imported from legacy forums. Posted by Louis (had 545 views)

    User (Old forums)
    Member
    Post count: 23064

    oops, stupid mistake there, what you have to do is

    Me.MoveCurrentRow(VerticalDirection.Down)
    Me.MoveCurrentCell(HorizontalDirection.Left)

    Imported from legacy forums. Posted by Louis (had 402 views)

    User (Old forums)
    Member
    Post count: 23064

    yes
    but i do not know if i am at the last cell in that row.

    thanks

    Ruben

    Imported from legacy forums. Posted by rubenalves (had 491 views)

    User (Old forums)
    Member
    Post count: 23064

    another question

    how can i know the row position
    or if i am at the last row so i can call the addNew method?

    Thanks.

    Ruben

    Imported from legacy forums. Posted by rubenalves (had 577 views)

    User (Old forums)
    Member
    Post count: 23064

    ok this is what you want to do

    dim c as cell

    c = xcdgrid.currentcell

    c.movecurrentcell(horizontaldirection.right)

    if c is xcdgrid.currrentcell then
    ‘you were at the last cell of the row

    if gettype(xcdgrid.currentcell).isinstanceoftype(insertioncell) then
    ‘call addnew
    else
    xccdgrid.movecurrentrow(verticaldirection.down)
    xcdgrid.movecurrentcell(horizontaldirection.left)
    end if
    endif

    this should work altough i may have made typos because i dont have .net on this computer…
    should still be helpful though

    Imported from legacy forums. Posted by Louis (had 643 views)

    User (Old forums)
    Member
    Post count: 23064

    it is working now

    but when i call the
    Me.CurrentRow.AddRow

    the row does not apear.

    Thanks

    Imported from legacy forums. Posted by rubenalves (had 564 views)

    User (Old forums)
    Member
    Post count: 23064

    it is
    Me.DataRows.AddNew
    and not
    Me.CurrentRow.AddRow

    i am sory.

    Imported from legacy forums. Posted by rubenalves (had 478 views)

    Xceed Support
    Member
    Post count: 5658

    Hello,

    When you call AddNew, you need to make sure that you call EndEdit (or AddNew again) otherwise the DataRow will not be added to the grid.

    Imported from legacy forums. Posted by Jenny [Xceed] (had 877 views)

    User (Old forums)
    Member
    Post count: 23064

    I do not find the EndEdit.

    And when i call the addnew again

    the aplication aborts and says that teh column ID canot contain a null value

    Please Help.

    Thanks

    Imported from legacy forums. Posted by rubenalves (had 634 views)

    User (Old forums)
    Member
    Post count: 23064

    i have another problem

    i have derived a class from the GridControl to alter the Enter Key behavior but i lost the designer suport, i can only modify the grid in code and not in the IDE directly

    Thanks

    Imported from legacy forums. Posted by rubenalves (had 640 views)

    Xceed Support
    Member
    Post count: 5658

    Hello,

    The EndEdit method is located on the CellRow (DataRow in this case) class. For example:

    Dim row As DataRow = gridControl1.DataRows.AddNew()
    ‘ Do what you want with the row
    row.EndEdit()

    As for losing the designer support, this is normal behavior since the Grid Designer itself uses an instance of the GridControl class and not your custom class derived from the GridControl class.

    I hope this helps!

    Imported from legacy forums. Posted by Jenny [Xceed] (had 527 views)

    User (Old forums)
    Member
    Post count: 23064

    i resolved the designer control by putting the code in a seperate file.

    thanks

    Imported from legacy forums. Posted by rubenalves (had 10266 views)

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