Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
|
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 January 11th, 2007, 03:53 PM
Authorized User
 
Join Date: Sep 2006
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
 
Old January 11th, 2007, 03:55 PM
Authorized User
 
Join Date: Sep 2006
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
 
Old January 11th, 2007, 04:55 PM
Authorized User
 
Join Date: Sep 2006
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





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





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