I have a datagrid, with paging. I get this error
AllowCustomPaging must be true and VirtualItemCount must be set for a
DataGrid with ID dgGal when AllowPaging is set to true and the selected
datasource does not implement ICollection.
Where would I set the Virtual Item Count?
Or do I have bigger problems than this?
Thanks!
Rudy
Thanks!!What type of object is ur Datasource ??
" datasource does not implement ICollection"
Post some code..
--
http://pathidotnet.blogspot.com
=====
vInAypAtHi
o__
--_,>/'_--
(_) \(_)
-----
"Rudy" wrote:
> Hi All!
> I have a datagrid, with paging. I get this error
> AllowCustomPaging must be true and VirtualItemCount must be set for a
> DataGrid with ID dgGal when AllowPaging is set to true and the selected
> datasource does not implement ICollection.
> Where would I set the Virtual Item Count?
> Or do I have bigger problems than this?
> Thanks!
> Rudy
> Thanks!!
Hey Vinay!
I'm using SQL, and a datagrid. If I turn "AllowCustomPaging" to true, my
data loads up, but no paging. If I set it to false, I get the error. Here
is some code.
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'PreLoad Members
Dim dbConn As New SqlConnection(ConnString)
Dim drPrev As SqlDataReader
Dim cmdGal As SqlCommand
cmdGal = New SqlCommand("Gal", dbConn)
cmdGal.CommandType = CommandType.StoredProcedure
dbConn.Open()
drPrev = cmdGal.ExecuteReader
dgGal.DataSource = drPrev
dgGal.DataBind()
drPrev.Close()
dbConn.Close()
End Sub
Private Sub dgGal_PageIndexChanged(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridPageChangedEvent Args) Handles
dgGal.PageIndexChanged
dgGal.CurrentPageIndex = e.NewPageIndex
Dim dbConn As New SqlConnection(ConnString)
Dim drPrev As SqlDataReader
Dim cmdGal As SqlCommand
cmdGal = New SqlCommand("Gal", dbConn)
cmdGal.CommandType = CommandType.StoredProcedure
dbConn.Open()
drPrev = cmdGal.ExecuteReader
dgGal.DataSource = drPrev
dgGal.DataBind()
drPrev.Close()
dbConn.Close()
End Sub
Thanks!!
Rudy
"vinay" wrote:
> What type of object is ur Datasource ??
> " datasource does not implement ICollection"
> Post some code..
> --
> http://pathidotnet.blogspot.com
> =====
> vInAypAtHi
> o__
> --_,>/'_--
> (_) \(_)
> -----
>
> "Rudy" wrote:
> > Hi All!
> > I have a datagrid, with paging. I get this error
> > AllowCustomPaging must be true and VirtualItemCount must be set for a
> > DataGrid with ID dgGal when AllowPaging is set to true and the selected
> > datasource does not implement ICollection.
> > Where would I set the Virtual Item Count?
> > Or do I have bigger problems than this?
> > Thanks!
> > Rudy
> > Thanks!!
Rudy,
I am not sure if it's valid to bind a new DataSource to a Grid in the
PageIndexChanged Event. Wouldn't this resultin an endless loop? Did you
debug your code? Where exactly does your code fail?
Greetings
Daniel
"Rudy" <Rudy@.discussions.microsoft.com> schrieb im Newsbeitrag
news:FFAE955D-AF16-4E9F-AA12-258154390E1D@.microsoft.com...
> Hey Vinay!
> I'm using SQL, and a datagrid. If I turn "AllowCustomPaging" to true, my
> data loads up, but no paging. If I set it to false, I get the error.
> Here
> is some code.
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> 'PreLoad Members
> Dim dbConn As New SqlConnection(ConnString)
> Dim drPrev As SqlDataReader
> Dim cmdGal As SqlCommand
> cmdGal = New SqlCommand("Gal", dbConn)
> cmdGal.CommandType = CommandType.StoredProcedure
> dbConn.Open()
> drPrev = cmdGal.ExecuteReader
> dgGal.DataSource = drPrev
> dgGal.DataBind()
> drPrev.Close()
> dbConn.Close()
> End Sub
> Private Sub dgGal_PageIndexChanged(ByVal source As Object, ByVal e As
> System.Web.UI.WebControls.DataGridPageChangedEvent Args) Handles
> dgGal.PageIndexChanged
> dgGal.CurrentPageIndex = e.NewPageIndex
> Dim dbConn As New SqlConnection(ConnString)
> Dim drPrev As SqlDataReader
> Dim cmdGal As SqlCommand
> cmdGal = New SqlCommand("Gal", dbConn)
> cmdGal.CommandType = CommandType.StoredProcedure
> dbConn.Open()
> drPrev = cmdGal.ExecuteReader
> dgGal.DataSource = drPrev
> dgGal.DataBind()
> drPrev.Close()
> dbConn.Close()
> End Sub
> Thanks!!
> Rudy
> "vinay" wrote:
>> What type of object is ur Datasource ??
>> " datasource does not implement ICollection"
>> Post some code..
>> --
>> http://pathidotnet.blogspot.com
>> =====
>> vInAypAtHi
>> o__
>> --_,>/'_--
>> (_) \(_)
>> -----
>>
>>
>> "Rudy" wrote:
>>
>> > Hi All!
>> > I have a datagrid, with paging. I get this error
>>> > AllowCustomPaging must be true and VirtualItemCount must be set for a
>> > DataGrid with ID dgGal when AllowPaging is set to true and the selected
>> > datasource does not implement ICollection.
>>> > Where would I set the Virtual Item Count?
>>> > Or do I have bigger problems than this?
>>> > Thanks!
>>> > Rudy
>>> > Thanks!!
Hi Dan!!
Sorry, I was goin to show where it fails, forgot.
Not sure at this point what's valid or not. I always get stuck with paging
things. Here where it fails
dbConn.Open()
> > drPrev = cmdGal.ExecuteReader
> > dgGal.DataSource = drPrev
FAIL> > dgGal.DataBind()
> > drPrev.Close()
> > dbConn.Close()
Thanks!!!
"Daniel Walzenbach" wrote:
> Rudy,
> I am not sure if it's valid to bind a new DataSource to a Grid in the
> PageIndexChanged Event. Wouldn't this resultin an endless loop? Did you
> debug your code? Where exactly does your code fail?
> Greetings
> Daniel
>
> "Rudy" <Rudy@.discussions.microsoft.com> schrieb im Newsbeitrag
> news:FFAE955D-AF16-4E9F-AA12-258154390E1D@.microsoft.com...
> > Hey Vinay!
> > I'm using SQL, and a datagrid. If I turn "AllowCustomPaging" to true, my
> > data loads up, but no paging. If I set it to false, I get the error.
> > Here
> > is some code.
> > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> > System.EventArgs) Handles MyBase.Load
> > 'PreLoad Members
> > Dim dbConn As New SqlConnection(ConnString)
> > Dim drPrev As SqlDataReader
> > Dim cmdGal As SqlCommand
> > cmdGal = New SqlCommand("Gal", dbConn)
> > cmdGal.CommandType = CommandType.StoredProcedure
> > dbConn.Open()
> > drPrev = cmdGal.ExecuteReader
> > dgGal.DataSource = drPrev
> > dgGal.DataBind()
> > drPrev.Close()
> > dbConn.Close()
> > End Sub
> > Private Sub dgGal_PageIndexChanged(ByVal source As Object, ByVal e As
> > System.Web.UI.WebControls.DataGridPageChangedEvent Args) Handles
> > dgGal.PageIndexChanged
> > dgGal.CurrentPageIndex = e.NewPageIndex
> > Dim dbConn As New SqlConnection(ConnString)
> > Dim drPrev As SqlDataReader
> > Dim cmdGal As SqlCommand
> > cmdGal = New SqlCommand("Gal", dbConn)
> > cmdGal.CommandType = CommandType.StoredProcedure
> > dbConn.Open()
> > drPrev = cmdGal.ExecuteReader
> > dgGal.DataSource = drPrev
> > dgGal.DataBind()
> > drPrev.Close()
> > dbConn.Close()
> > End Sub
> > Thanks!!
> > Rudy
> > "vinay" wrote:
> >> What type of object is ur Datasource ??
> >> " datasource does not implement ICollection"
> >> Post some code..
> >> --
> >> http://pathidotnet.blogspot.com
> >> =====
> >> vInAypAtHi
> >> o__
> >> --_,>/'_--
> >> (_) \(_)
> >> -----
> >>
> >>
> >> "Rudy" wrote:
> >>
> >> > Hi All!
> >> > I have a datagrid, with paging. I get this error
> >> >> > AllowCustomPaging must be true and VirtualItemCount must be set for a
> >> > DataGrid with ID dgGal when AllowPaging is set to true and the selected
> >> > datasource does not implement ICollection.
> >> >> > Where would I set the Virtual Item Count?
> >> >> > Or do I have bigger problems than this?
> >> >> > Thanks!
> >> >> > Rudy
> >> >> > Thanks!!
>
Hello Rudy,
and this is in which event-handler? MyBase.Load or dgGal.PageIndexChanged?
"Rudy" <Rudy@.discussions.microsoft.com> schrieb im Newsbeitrag
news:CF0F889F-14B4-4CF4-ACAB-26D9D316B682@.microsoft.com...
> Hi Dan!!
> Sorry, I was goin to show where it fails, forgot.
> Not sure at this point what's valid or not. I always get stuck with
> paging
> things. Here where it fails
> dbConn.Open()
>> > drPrev = cmdGal.ExecuteReader
>> > dgGal.DataSource = drPrev
> FAIL> > dgGal.DataBind()
>> > drPrev.Close()
>> > dbConn.Close()
>
> Thanks!!!
>
> "Daniel Walzenbach" wrote:
>> Rudy,
>>
>> I am not sure if it's valid to bind a new DataSource to a Grid in the
>> PageIndexChanged Event. Wouldn't this resultin an endless loop? Did you
>> debug your code? Where exactly does your code fail?
>>
>> Greetings
>>
>> Daniel
>>
>>
>> "Rudy" <Rudy@.discussions.microsoft.com> schrieb im Newsbeitrag
>> news:FFAE955D-AF16-4E9F-AA12-258154390E1D@.microsoft.com...
>> > Hey Vinay!
>>> > I'm using SQL, and a datagrid. If I turn "AllowCustomPaging" to true,
>> > my
>> > data loads up, but no paging. If I set it to false, I get the error.
>> > Here
>> > is some code.
>>> > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
>> > System.EventArgs) Handles MyBase.Load
>>> > 'PreLoad Members
>> > Dim dbConn As New SqlConnection(ConnString)
>> > Dim drPrev As SqlDataReader
>> > Dim cmdGal As SqlCommand
>>> > cmdGal = New SqlCommand("Gal", dbConn)
>> > cmdGal.CommandType = CommandType.StoredProcedure
>> > dbConn.Open()
>> > drPrev = cmdGal.ExecuteReader
>> > dgGal.DataSource = drPrev
>> > dgGal.DataBind()
>> > drPrev.Close()
>> > dbConn.Close()
>> > End Sub
>> > Private Sub dgGal_PageIndexChanged(ByVal source As Object, ByVal e As
>> > System.Web.UI.WebControls.DataGridPageChangedEvent Args) Handles
>> > dgGal.PageIndexChanged
>> > dgGal.CurrentPageIndex = e.NewPageIndex
>> > Dim dbConn As New SqlConnection(ConnString)
>> > Dim drPrev As SqlDataReader
>> > Dim cmdGal As SqlCommand
>>> > cmdGal = New SqlCommand("Gal", dbConn)
>> > cmdGal.CommandType = CommandType.StoredProcedure
>> > dbConn.Open()
>> > drPrev = cmdGal.ExecuteReader
>> > dgGal.DataSource = drPrev
>> > dgGal.DataBind()
>> > drPrev.Close()
>> > dbConn.Close()
>> > End Sub
>>> > Thanks!!
>> > Rudy
>>> > "vinay" wrote:
>>> >> What type of object is ur Datasource ??
>> >> " datasource does not implement ICollection"
>> >> Post some code..
>> >> --
>> >> http://pathidotnet.blogspot.com
>> >> =====
>> >> vInAypAtHi
>> >> o__
>> >> --_,>/'_--
>> >> (_) \(_)
>> >> -----
>> >>
>> >>
>> >> "Rudy" wrote:
>> >>
>> >> > Hi All!
>> >> > I have a datagrid, with paging. I get this error
>> >>> >> > AllowCustomPaging must be true and VirtualItemCount must be set for
>> >> > a
>> >> > DataGrid with ID dgGal when AllowPaging is set to true and the
>> >> > selected
>> >> > datasource does not implement ICollection.
>> >>> >> > Where would I set the Virtual Item Count?
>> >>> >> > Or do I have bigger problems than this?
>> >>> >> > Thanks!
>> >>> >> > Rudy
>> >>> >> > Thanks!!
>>
>>
>
Mybase.Load
"Daniel Walzenbach" wrote:
> Hello Rudy,
> and this is in which event-handler? MyBase.Load or dgGal.PageIndexChanged?
>
>
> "Rudy" <Rudy@.discussions.microsoft.com> schrieb im Newsbeitrag
> news:CF0F889F-14B4-4CF4-ACAB-26D9D316B682@.microsoft.com...
> > Hi Dan!!
> > Sorry, I was goin to show where it fails, forgot.
> > Not sure at this point what's valid or not. I always get stuck with
> > paging
> > things. Here where it fails
> > dbConn.Open()
> >> > drPrev = cmdGal.ExecuteReader
> >> > dgGal.DataSource = drPrev
> > FAIL> > dgGal.DataBind()
> >> > drPrev.Close()
> >> > dbConn.Close()
> > Thanks!!!
> > "Daniel Walzenbach" wrote:
> >> Rudy,
> >>
> >> I am not sure if it's valid to bind a new DataSource to a Grid in the
> >> PageIndexChanged Event. Wouldn't this resultin an endless loop? Did you
> >> debug your code? Where exactly does your code fail?
> >>
> >> Greetings
> >>
> >> Daniel
> >>
> >>
> >> "Rudy" <Rudy@.discussions.microsoft.com> schrieb im Newsbeitrag
> >> news:FFAE955D-AF16-4E9F-AA12-258154390E1D@.microsoft.com...
> >> > Hey Vinay!
> >> >> > I'm using SQL, and a datagrid. If I turn "AllowCustomPaging" to true,
> >> > my
> >> > data loads up, but no paging. If I set it to false, I get the error.
> >> > Here
> >> > is some code.
> >> >> > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> >> > System.EventArgs) Handles MyBase.Load
> >> >> > 'PreLoad Members
> >> > Dim dbConn As New SqlConnection(ConnString)
> >> > Dim drPrev As SqlDataReader
> >> > Dim cmdGal As SqlCommand
> >> >> > cmdGal = New SqlCommand("Gal", dbConn)
> >> > cmdGal.CommandType = CommandType.StoredProcedure
> >> > dbConn.Open()
> >> > drPrev = cmdGal.ExecuteReader
> >> > dgGal.DataSource = drPrev
> >> > dgGal.DataBind()
> >> > drPrev.Close()
> >> > dbConn.Close()
> >> > End Sub
> >> > Private Sub dgGal_PageIndexChanged(ByVal source As Object, ByVal e As
> >> > System.Web.UI.WebControls.DataGridPageChangedEvent Args) Handles
> >> > dgGal.PageIndexChanged
> >> > dgGal.CurrentPageIndex = e.NewPageIndex
> >> > Dim dbConn As New SqlConnection(ConnString)
> >> > Dim drPrev As SqlDataReader
> >> > Dim cmdGal As SqlCommand
> >> >> > cmdGal = New SqlCommand("Gal", dbConn)
> >> > cmdGal.CommandType = CommandType.StoredProcedure
> >> > dbConn.Open()
> >> > drPrev = cmdGal.ExecuteReader
> >> > dgGal.DataSource = drPrev
> >> > dgGal.DataBind()
> >> > drPrev.Close()
> >> > dbConn.Close()
> >> > End Sub
> >> >> > Thanks!!
> >> > Rudy
> >> >> > "vinay" wrote:
> >> >> >> What type of object is ur Datasource ??
> >> >> " datasource does not implement ICollection"
> >> >> Post some code..
> >> >> --
> >> >> http://pathidotnet.blogspot.com
> >> >> =====
> >> >> vInAypAtHi
> >> >> o__
> >> >> --_,>/'_--
> >> >> (_) \(_)
> >> >> -----
> >> >>
> >> >>
> >> >> "Rudy" wrote:
> >> >>
> >> >> > Hi All!
> >> >> > I have a datagrid, with paging. I get this error
> >> >> >> >> > AllowCustomPaging must be true and VirtualItemCount must be set for
> >> >> > a
> >> >> > DataGrid with ID dgGal when AllowPaging is set to true and the
> >> >> > selected
> >> >> > datasource does not implement ICollection.
> >> >> >> >> > Where would I set the Virtual Item Count?
> >> >> >> >> > Or do I have bigger problems than this?
> >> >> >> >> > Thanks!
> >> >> >> >> > Rudy
> >> >> >> >> > Thanks!!
> >>
> >>
> >>
>
0 comments:
Post a Comment