ASP .NET Data grid binding question.

Hi I have a data grid which I bind a data table of 8 rows to via setting the grid's datasource with a Databind() statement.

Problem is, during the data bound event for the grid there are only 5 grid arguments.  Can someone explain why this is and what could be causing the grid to drop the other 3 rows during processing?  Any steps in the right direction would be great.

kapes13Asked:
Who is Participating?
 
chrisrbloomCommented:
Gridview is the replacement for DataGrid.

The GridView control can be bound to a data source control (such as the SqlDataSource control or ObjectDataSource control) or to any data source collection that implements the System.Collections.IEnumerable interface, such as System.Data.DataView, System.Collections.ArrayList, System.Collections.Generic.List(Of T), or other collection types.
0
 
chrisrbloomCommented:
did you check the pagesize of the gridview?

0
 
chrisrbloomCommented:
I am assuming you meant GridView rather than DataGrid (older .net control).


<asp:GridView ID="GridView1" runat="server" PageSize="10">
</asp:GridView>

Open in new window

0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
kapes13Author Commented:
Nope, it's a DataGrid, as I looked in my ASPX source file, maybe I should use a Gridview?  Too much bouncing around to keep focus on these controls!
0
 
chrisrbloomCommented:
Depends on what version of .NET you are running.  GridView is the successor to DataGrid.

see this article:  http://msdn.microsoft.com/en-us/library/05yye6k9.aspx

Either way, both controls have the "PageSize" property you can set.
0
 
kapes13Author Commented:
Thanks for that, I might try a Gridview as used in other projects but can you bind a DataTable directly to the Gridview, thought I wrestled with that for a few but not sure.
0
 
kapes13Author Commented:
Well I have to rewrite all the custom columns for a GridView, so just going to stick to DataGrid for now and see about the binding array because of the data I have to pull into the custom controls at binding.  Just can't get why GridArguments has a different count than DataTable.  Probably something simple I overlooked.
0
 
kapes13Author Commented:
Paging manipulation does not help in this case.  I know it is the indexing, but I can't grasp what is going on in the DataGrid Arguments that limits the number of rows after I bound the DataTable to them, should be equal.

Have to come back to this tomorrow.  If anyone has any ideas or can post a sample (with custom columns in DataGrid) might knock this out.

Thanks.
0
 
kapes13Author Commented:
Okay I got back to this with an open mind and together with Chris taking time to assist and myself going over his materials I discovered that I could omit my bind event and allow the definition of my custom columns to receive the data directly during the DataBind.  All is well!  Moving on and thank you!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.