|
-
Nov 13th, 2002, 03:08 AM
#1
Thread Starter
Addicted Member
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
-
Nov 13th, 2002, 10:00 AM
#2
Junior Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|