flex grid control

vb6 Grenada
  • 14 years ago

    hi,

    i am using flex grid control, problem is

    i want to check whether data in the particular cell is string or integer .how can i do this.

    thank u

     

  • 14 years ago

    Hi harish
     U can get the value through this msFlex.TextMatrix(i, 0) syntax.
     so u can validate usiing this IsNumeric() function

    Ex:

    If (IsNumeric(msFlex.TextMatrix(i, 0))=True) Then
        msgbox "It's Numeric"
    Else
        msgbox "It's Non Numeric"
    Endif


    I hope this will solve ur problem

    Good Luck

    Regards
    Hari K





















  • 14 years ago

    ok,i got it

    but the problem is ,for example if there are 2 colums and multiple rows

    in that the first column should only take numbers and second columan should only accept strings but

    the problem is how to give indexes to textmatrix(row,col) function

  • 14 years ago

    try using a nested loop ie

    for col = 1 to 2

       for row = 1 to (number of rows)

          ' code... textmatrix( row, col ) or something like that

       next row

    next col

  • 14 years ago

    Hi Harish
     When are you validating? Is it before put into column or After updated into msFlex?

    Before Vlidation
    Ex:

    Private Sub fncInsertFlexGrid()

    Do While Not (rs.EOF)
        With msFlex
           If (IsNumeric(Rs.Fields(0))=True) Then
              .TextMatrix(.Row,0)=Rs.Fields(0)
              .TextMatrix(.Row,1)=Rs.Fields(1)
           Else
              Exit Sub
           Endif

           .Rows=.Rows+1
           .Row=.Row+1
        End With

    Rs.MoveNext
    Loop

    End Sub

    After Updation

    Private Sub fncInsertFlexGrid()

    Dim iCount as Integer

        With msFlex

        For iCount=0 To .Rows-1

           If (IsNumeric(.TextMatrix(iCount,0))=True) Then
              'Save into DB

           Else

              Exit Sub

           Endif

      
        Next iCount  

        End With 

    End Sub


    Good Luck

    Regards
    Hari K





















































Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“PHP is a minor evil perpetrated and created by incompetent amateurs, whereas Perl is a great and insidious evil perpetrated by skilled but perverted professionals.” - Jon Ribbens