Advertisement

01.16.2008 at 12:00AM PST, ID: 23086311
[x]
Attachment Details

vb.net datagrid row select

Asked by pearlym in Visual Studio .NET 2003

Tags: microsoft, vb.net, 2003

i have a datagrid populated by a dataset
i want to check for a particular row in the dataset. if the exact number exist then select that row other wise show me the nearest match ie if i type 7001 and there is no record matching 7001 then it should select 700

My Code is attached below            
       Dim tt As Integer
                    tt = grdac_chart.CurrentRowIndex
                    grdac_chart.UnSelect(tt)
                    dtEmployee.PrimaryKey = New DataColumn() {dtEmployee.Columns("accountref")}
                    dtEmployee.DefaultView.Sort = "accountref"
                        If dtEmployee.Rows.Contains(txtNo.Text) Then
                            Dim init_rows As Integer
                            init_rows = ProductData.Tables(0).DefaultView.Find(txtNo.Text)
                            grdac_chart.CurrentRowIndex = init_rows
                            grdac_chart.Select(init_rows)
                        End IfStart Free Trial
[+][-]01.16.2008 at 12:05AM PST, ID: 20669950

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.16.2008 at 12:43AM PST, ID: 20670083

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.16.2008 at 09:37AM PST, ID: 20674052

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Visual Studio .NET 2003
Tags: microsoft, vb.net, 2003
Sign Up Now!
Solution Provided By: angelIII
Participating Experts: 1
Solution Grade: A
 
 
[+][-]05.22.2008 at 02:54AM PDT, ID: 21622298

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]05.26.2008 at 05:29AM PDT, ID: 21646050

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628