Results 1 to 2 of 2

Thread: displaying a column from lookup table upon entering values in a datagrid column

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2002
    Posts
    145

    displaying a column from lookup table upon entering values in a datagrid column

    Hi all,

    I have a datagrid with 3 columns (userid, username, userpass). Is it possible that upon entering userid (the user will tab to the next column) , I wanted to lookup to a particular table to validate if the userid exists and if exists, display the value of username.

    Any help would be greatly appreciated.

    Marivic

  2. #2
    Junior Member
    Join Date
    Nov 2002
    Location
    New York
    Posts
    29
    I think one way would be like this:

    derive a custom data grid column: and override the edit event:

    Public Class CustomDataGridColumn
    inherits DataGridTextBoxColumn

    Public sub New()
    MyBase.New()
    End Sub

    Public Overloads Overrides Sub Edit(.... the longest version)

    MyBase.Edit
    Dim value as String = CType(GetColumnValueAtRow(source, rowNum), String)

    if Not PerformCheck(value) then
    MsgBox("Invalid ID !")
    else
    ...
    end if
    end sub

    end Class

    Then when you add your column styles use your custom class.

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