Results 1 to 3 of 3

Thread: String value from column in grid

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2003
    Posts
    93

    String value from column in grid

    I'm tring to do something that I thought would be fairly simple until ....... oops I remembered I was trying to do it in .NET. I have a grid (Ultragrid from Infragistics) I have te grid working just fine. When the user enters a new row I would like to place the data entered in a particular field into a string. I'm very new to .NET and I seem to be more and more clueless as each day passes. Here is the code I have so far:

    Private Function ValidLastName(ByVal e As Infragistics.Win.UltraWinGrid.BeforeCellUpdateEventArgs) As Boolean
    If e.NewValue = "" Then
    MessageBox.Show("You must enter a last name before continuing")
    e.Cancel = True
    Return False
    Else
    Return True
    strLast = e.NewValue(ToString)
    End If
    End Function

    When I debug to check the values & hover over e.NewValue(ToString) it shows: e.NewValue = "Name" {String}
    I just want the strLast to be able to be populated with the value in the grid.

    I have dim'ed strLast at the beginning of the class. I'm missing something & can't figure out what I'm doing. Any help please?

    Thanks,
    Corinne

  2. #2
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Dublin (Ireland)
    Posts
    304
    Dont know the particular control you refer to but if it is derived from the basic datagrid class, in he datagrid class, I would use as follows:

    dim currow as integer.
    dim thisname as string
    currow = datagrid1.currentrowindex
    thisname = DataGrid1.Item(currow, 0)
    if trim(thisname).length = 0 then
    your error code

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2003
    Posts
    93
    Thanks for your suggestion, I'll try that.

    Corinne

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width