Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - CheckList & GridView Problems.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CheckList & GridView Problems.

 Post Reply Post Reply
Author
davidshq View Drop Down
Senior Member
Senior Member


Joined: 29 July 2003
Location: United States
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote davidshq Quote  Post ReplyReply Direct Link To This Post Topic: CheckList & GridView Problems.
    Posted: 27 February 2006 at 6:49am
I've got a GridView thats bound to a table. It displays contents fine. But then I have created a CheckList that is supposed to filter what results show up in the GridView. However, I keep getting the message:

'System.Data.DataRowView' does not contain a property with the name 'ID'

Whenever I click the CheckBox and submit the term I'm searching for. But the weird thing is - I know ID exists, b/c it shows up just fine when I don't apply the filter.
Here is the vb code:

Partial Class LoggedIn_SearchGames
    Inherits System.Web.UI.Page
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
        If Me.IsPostBack = False Then
            SqlDataSource1.SelectParameters.Add(New Parameter("varQuery", TypeCode.String))
            SqlDataSource1.SelectParameters("varQuery").DefaultValue = "dodgeball"
            SqlDataSource1.SelectParameters.Add(New Parameter("varUserName", TypeCode.String))
            SqlDataSource1.SelectParameters("varUserName").DefaultValue = Profile.UserName
            SqlDataSource1.SelectParameters.Add(New Parameter("varTitle", TypeCode.Int16))
            SqlDataSource1.SelectParameters("varTitle").DefaultValue = 0
            SqlDataSource1.SelectParameters.Add(New Parameter("varDescription", TypeCode.Int16))
            SqlDataSource1.SelectParameters("varDescription").DefaultValue = 0
            SqlDataSource1.SelectParameters.Add(New Parameter("varDangers", TypeCode.Int16))
            SqlDataSource1.SelectParameters("varDangers").DefaultValue = 0
            SqlDataSource1.SelectParameters.Add(New Parameter("varVariants", TypeCode.Int16))
            SqlDataSource1.SelectParameters("varVariants").DefaultValue = 0
            SqlDataSource1.SelectParameters.Add(New Parameter("varSource", TypeCode.Int16))
            SqlDataSource1.SelectParameters("varSource").DefaultValue = 0
            SqlDataSource1.SelectParameters.Add(New Parameter("varCount", TypeCode.String))
            SqlDataSource1.SelectParameters("varCount").DefaultValue = 0
            GridView1.Visible = True
            MultiView1.Visible = True
            MultiView1.ActiveViewIndex = 0
        End If
    End Sub
    Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles GridView1.RowDataBound
        ' Sets null cells to more pretty values.
        If e.Row.RowType = DataControlRowType.DataRow Then
            If IsDBNull(e.Row.DataItem("Popularity2")) Then
                e.Row.Cells(3).Text = "-"
            End If
            If IsDBNull(e.Row.DataItem("Popularity")) Then
                e.Row.Cells(4).Text = "-"
            End If
            If IsDBNull(e.Row.DataItem("LastPlayedDate")) Then
                e.Row.Cells(5).Text = "Never"
            End If
        End If
        ' Changes numeric value to text value for presentation purposes.
        If e.Row.RowType = DataControlRowType.DataRow Then
            Select Case e.Row.Cells(6).Text
                Case 1
                    e.Row.Cells(6).Text = "Active Inside"
                Case 2
                    e.Row.Cells(6).Text = "Semi-Active Inside"
                Case 3
                    e.Row.Cells(6).Text = "Inactive Inside"
                Case 4
                    e.Row.Cells(6).Text = "Chair Game"
                Case 5
                    e.Row.Cells(6).Text = "Active Outside"
                Case 6
                    e.Row.Cells(6).Text = "Semi-Active Outside"
                Case 7
                    e.Row.Cells(6).Text = "Inactive Outside"
                Case 8
                    e.Row.Cells(6).Text = "Water Game"
                Case 9
                    e.Row.Cells(6).Text = "Messy Game"
                Case 10
                    e.Row.Cells(6).Text = "Trick "
            End Select
        End If
    End Sub
    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
     &n
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.