datagrid error message

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • William Gower

    #1

    datagrid error message

    I am getting the following error message when I try to load my page

    AllowCustomPagi ng must be true and VirtualItemCoun t must be set for a
    DataGrid with ID DataGrid1 when AllowPaging is set to true and the selected
    datasource does not implement ICollection.

    Sub Page_Load()
    BindDataGrid()
    end Sub

    Sub BindDataGrid
    Dim strConnection As String = "Provider=Micro soft.Jet.OLEDB. 4.0;"
    strConnection += "Data Source=C:\MyBea rHug.mdb;"

    Dim strSQL As String = "Select firstname,lastn ame,businessnam e from
    artists order by lastname;"
    Dim objConnection As New
    System.Data.Ole Db.OleDbConnect ion(strConnecti on)
    objConnection.O pen()

    Dim objCommand As New System.Data.Ole Db.OleDbCommand (strSQL,
    objConnection)
    DataGrid1.DataS ource = objCommand.Exec uteReader()
    DataGrid1.DataB ind()
    end sub sub

    PageIndexChange d(sender as Object, e As DataGridPageCha ngedEventArgs)
    DataGrid1.Curre ntPageIndex = e.NewPageIndex
    BindDataGrid()
    end sub

    allowpaging is set to true
    onpageindexedch ange is set to pageindexchange d
    pagerstyle is set to nextprev



  • Cor Ligthert

    #2
    Re: datagrid error message

    Hi William,

    I did look at your problem (when you send next time to general groups or and
    languages groups tell it is webform).

    On first sight I did see nothing strange, however there is a problem, there
    are two newsgroups where this problem is often in as I have seen.

    microsoft.publi c.dotnet.framew ork.aspnet
    microsoft.publi c.dotnet.framew ork.aspnet.data gridcontrol

    You can try it there.

    And please send one message to both newsgroups. (crossposting) and not two
    messages one by one.

    I hope this helps anyhow?

    Cor


    Comment

    • Cor Ligthert

      #3
      Re: datagrid error message

      Hi William,

      I did look at your problem (when you send next time to general groups or and
      languages groups tell it is webform).

      On first sight I did see nothing strange, however there is a problem, there
      are two newsgroups where this problem is often in as I have seen.

      microsoft.publi c.dotnet.framew ork.aspnet
      microsoft.publi c.dotnet.framew ork.aspnet.data gridcontrol

      You can try it there.

      And please send one message to both newsgroups. (crossposting) and not two
      messages one by one.

      I hope this helps anyhow?

      Cor


      Comment

      Working...