Wrox Programmer Forums
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 13th, 2005, 10:47 PM
Friend of Wrox
 
Join Date: Sep 2004
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Anantsharma Send a message via Yahoo to Anantsharma
Default Data Value tracing Grid

Hi Programmers,

Well I am in process to develope a Windows App in VB.NET.

I need to display some records (80-90 thousand rows) in a Grid. On the form, there will be a Textbox where user will type something. Typing anything here will have to trace the item in a particular column of grid and the moment user finds the required record, he will hit enter and the value from a columm from selected/traced record will be captured in a variable. I have done this a lot with VB6 using a class file and module and DbGrid control. You must be aware that the DbGrid of VB6 is bound to a recordset. Moving inside recorset, automatically moves a record pointer in DbGrid.

In VB.NET, DataGrid is also bound control. Can someone just give me an idea to open my wings towards this task.

I am looking for HOW TO logic and flow.

Hope you got my point !!!

Cheers...Anant
__________________
B. Anant
 
Old April 27th, 2005, 04:28 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 142
Thanks: 0
Thanked 2 Times in 2 Posts
Default

You'd have to use the keypress event

    
Code:
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
Code:
    End Sub


Set the datasource of the datagrid to be a dataview. Every time a key is pressed, amend the RowFilter property of the dataview to be whatever has been typed in the textbox, for example:
Code:
dv.RowFilter=string.format("LastName='{0}'",textbox1.text)
Think this will do the trick. As for 'saving the values in a variable on enter', just trap the Leave event of the textbox and grab the first row of the dataview:
Code:
selectedRow=dv.Item(0)





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to sort data in a data grid? zaheerabbas.sk ASP.NET 1.0 and 1.1 Basics 3 April 10th, 2007 02:37 PM
Export data from data grid to excel pomoc VB.NET 2002/2003 Basics 0 December 16th, 2005 03:11 PM
Export data from data grid to Excel pomoc Visual Basic 2005 Basics 0 December 16th, 2005 02:56 PM
trying to load db data into data grid itsajourney Beginning VB 6 2 June 7th, 2005 12:05 PM
About data grid Asteroid ASP.NET 1.0 and 1.1 Basics 4 December 9th, 2004 05:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.