p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   VB.NET 2002/2003 Basics (http://p2p.wrox.com/forumdisplay.php?f=76)
-   -   Refer to a cell with a DataView (http://p2p.wrox.com/showthread.php?t=52594)

bufanator January 11th, 2007 03:53 PM

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

bufanator January 11th, 2007 03:55 PM

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

bufanator January 11th, 2007 04:55 PM

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


All times are GMT -4. The time now is 03:48 PM.

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