D
DaMan
Ok.. I followed simple code example in MSDN for simple paging of a datagrid,
but I get Error:
AllowCustomPaging must be true and VirtualItemCount must be set for a
DataGrid with ID DataGrid1 when AllowPaging is set to true and the selected
datasource does not implement ICollection.
Why,??? I can set AllowCustomPaging and get the data, but then paging
doesn't work??HUNH??
Heres my code:
SQLDB.Open()
SQLcmd.CommandType = CommandType.StoredProcedure
SQLcmd.CommandText = "dotnet_GetData"
SqlCommandBuilder.DeriveParameters(tmpSQL.SQLcmd)
SQLcmd.Parameters(1).Value = "%"
Dim myreader As SqlDataReader = SQLcmd.ExecuteReader
myreader.Read()
DataGrid1.DataSource = myreader
With DataGrid1
.AllowPaging = True
.PagerStyle.Mode = PagerMode.NumericPages
.PageSize = 15
.PagerStyle.PageButtonCount = 15
End With
do stuff
If Not Page.IsPostBack Then
DataGrid1.DataBind()
End If
Moving the With DataGrid1 block around doesn't help??? Please help??
Thanks...
KT
but I get Error:
AllowCustomPaging must be true and VirtualItemCount must be set for a
DataGrid with ID DataGrid1 when AllowPaging is set to true and the selected
datasource does not implement ICollection.
Why,??? I can set AllowCustomPaging and get the data, but then paging
doesn't work??HUNH??
Heres my code:
SQLDB.Open()
SQLcmd.CommandType = CommandType.StoredProcedure
SQLcmd.CommandText = "dotnet_GetData"
SqlCommandBuilder.DeriveParameters(tmpSQL.SQLcmd)
SQLcmd.Parameters(1).Value = "%"
Dim myreader As SqlDataReader = SQLcmd.ExecuteReader
myreader.Read()
DataGrid1.DataSource = myreader
With DataGrid1
.AllowPaging = True
.PagerStyle.Mode = PagerMode.NumericPages
.PageSize = 15
.PagerStyle.PageButtonCount = 15
End With
do stuff
If Not Page.IsPostBack Then
DataGrid1.DataBind()
End If
Moving the With DataGrid1 block around doesn't help??? Please help??
Thanks...
KT