Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 11th, 2007, 03:53 PM
Authorized User
Points: 54, Level: 1
Points: 54, Level: 1 Points: 54, Level: 1 Points: 54, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2006
Location: west monroe, la, USA.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default Refer to a cell with a DataView

Way system is setup:
I have a search option that filters through my datagrid into a dataview. (code below)
Private Sub txtSearch_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtSearch.TextChanged
        If txtSearch.TextLength = 1 Then
            dvDetail.RowFilter = "substring(OrderNum,1,1) = '" & txtSearch.Text & "'"
            btnUpdate.Enabled = False
            cmbOrdStat.Enabled = False
        ElseIf txtSearch.TextLength = 1 Then
            dvDetail.RowFilter = "substring(OrderNum,1,2) = '" & txtSearch.Text & "'"
            btnUpdate.Enabled = False
            cmbOrdStat.Enabled = False
        ElseIf txtSearch.TextLength = 3 Then
            dvDetail.RowFilter = "substring(OrderNum,1,3) = '" & txtSearch.Text & "'"
            btnUpdate.Enabled = False
            cmbOrdStat.Enabled = False
        ElseIf txtSearch.TextLength = 4 Then
            dvDetail.RowFilter = "substring(OrderNum,1,4) = '" & txtSearch.Text & "'"
            btnUpdate.Enabled = False
            cmbOrdStat.Enabled = False
        ElseIf txtSearch.TextLength = 5 Then
            dvDetail.RowFilter = "substring(OrderNum,1,5) = '" & txtSearch.Text & "'"
            btnUpdate.Enabled = False
            cmbOrdStat.Enabled = False
        ElseIf txtSearch.TextLength = 6 Then
            dvDetail.RowFilter = "substring(OrderNum,1,6) = '" & txtSearch.Text & "'"
            btnUpdate.Enabled = False
            cmbOrdStat.Enabled = False
        ElseIf txtSearch.TextLength = 7 Then
            dvDetail.RowFilter = "substring(OrderNum,1,7) = '" & txtSearch.Text & "'"
            btnUpdate.Enabled = True
            cmbOrdStat.Enabled = True
            cmbOrdStat.Focus()
            cmbPop()
        End If
    End Sub

My problem is once it is in the dataview I can figure out how to refer to a specific cell with in the dv.

For instance my colums are:
Ordernum, orderstatus, statusdesc,billtoname, shipdate

What I need to do is call the filtered value in column two (orderstatus)...any ideas?

**Please forgive me if I am not expressing my questions clearly...I am a new graduate and still learning.**

Thank you,
John Williams
__________________
Thank you,
John Williams
Reply With Quote
  #2 (permalink)  
Old January 11th, 2007, 03:55 PM
Authorized User
Points: 54, Level: 1
Points: 54, Level: 1 Points: 54, Level: 1 Points: 54, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2006
Location: west monroe, la, USA.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by bufanator
 My problem is once it is in the dataview I can figure out how to refer to a specific cell with in the dv.
My problem is once it is in the dataview I can't figure out how to refer to a specific cell within the dv.

Thank you,
John Williams
Reply With Quote
  #3 (permalink)  
Old January 11th, 2007, 04:55 PM
Authorized User
Points: 54, Level: 1
Points: 54, Level: 1 Points: 54, Level: 1 Points: 54, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2006
Location: west monroe, la, USA.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I found the answer but for anyone else out there here it is:

Dim Orderstat As String = CType(dvDetail(0)("OrderStatus"), String)
strOrderStat = Orderstat

You can read more on it at http://msdn2.microsoft.com/en-us/lib...3x(VS.71).aspx

Thank you,
John Williams
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Refer to Rows and Columns RayL Access VBA 3 May 23rd, 2007 09:13 AM
I need to refer a cell within a cell like =RC[ RC2 chakravarthi_os Excel VBA 1 September 24th, 2006 08:19 AM
if the cell content is a part of another cell cont sriramus Excel VBA 1 November 15th, 2005 10:20 AM
Lose cell Text when editing cell in VSFlexGrid 6 bobcratchet VB How-To 0 July 30th, 2004 09:32 AM
how to refer another form khautinh General .NET 2 March 17th, 2004 01:29 PM



All times are GMT -4. The time now is 10:55 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.