about farpoint cell event

Posted by: wwu-sec on 8 September 2017, 12:30 pm EST

  • Posted 8 September 2017, 12:30 pm EST

    Dear farpoint team:

    i'm busy with a harsh project, we have to resort to farpoint spread winform 2.5(visual studio 2005)

    i'm work under vb.net programming IDE...



    we need to implment some function to control certain column cell, if user click any cell in such column, then rapidly into edit mode, further more, when lostfocus to cell, need to check whether value is Compliant certain rules, any good advices?

    thanks a lot

    '------------

    'following is some snippet

    Private Sub grid_parent_CellClick(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.CellClickEventArgs) Handles grid_parent.CellClick, grid_parent.CellDoubleClick



    'for detect grid_parent header(cell) lost and in focus status

    Static last_clicked_row As Integer = -1

    Static last_clicked_column As Integer = -1

    Debug.Print("cell clicked column:" + CStr(e.Column))

    '---------------

    Dim grid_columns As Integer = Me.grid_parent.ActiveSheet.ColumnCount

    '---------------



    Dim current_row As Integer = e.Row

    Dim current_column As Integer = e.Column



    If (grid_columns > 1) Then

    If (last_clicked_column = -1) Then



    last_clicked_row = e.Row

    last_clicked_column = e.Column





    If (last_clicked_column = 0) Then

    SetEDisAbleF1_4_5_6_9_10(False)

    Else

    SetEDisAbleF1_4_5_6_9_10(True)

    End If

    ElseIf (current_column = 0 AndAlso last_clicked_column = current_column AndAlso last_clicked_row = current_row) Then 'user click same column

    Debug.Print("column 0 getfocus and exactly same cell")

    SetEDisAbleF1_4_5_6_9_10(False)

    ElseIf (current_column = 0 AndAlso last_clicked_column = current_column AndAlso last_clicked_row <> current_row) Then

    Debug.Print("getfocus but different row")

    'SetEnableDF1_4_5_6_9_10(False)

    ElseIf (current_column = 0 AndAlso last_clicked_column <> current_column) Then

    Debug.Print("jumped in")

    SetEDisAbleF1_4_5_6_9_10(False)

    ElseIf (current_column <> 0 AndAlso last_clicked_column = 0) Then

    Debug.Print("lostfocus different column")

    SetEDisAbleF1_4_5_6_9_10(True)

    End If

    End If



    last_clicked_row = current_row

    last_clicked_column = current_column

    End Sub
  • Replied 8 September 2017, 12:30 pm EST

    by the way, if anyone reply my post, would I get instance mail message ?



    i mean if somebody give me answer, with mail inform
  • Replied 8 September 2017, 12:30 pm EST

    Hello,


    There is an Enable Email button at the top of the thread. If you check this, then you will be nothified of any changes made to this thread.


    I would suggest using the LeaveCell event to notify you of the user leaving a cell. You can add validation code in this event and if the validation fails, you can set the e.Cancel parameter to True to keep the user from leaving the cell.

  • Replied 8 September 2017, 12:30 pm EST

    thank you scotts , you really farpoint master
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels