Using C#
Table
ID Name
001 Ra开发者_如何学Pythonja
002 Ramu
003 Ravi
004 Sajuee
Detail View Code:
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" Height="50px" Width="125px" AllowPaging="True" EnableViewState="False">
<Fields>
<asp:BoundField DataField="ProductName" HeaderText="Product" SortExpression="ProductName" /> <asp:BoundField DataField="vehiclename" HeaderText="Category" ReadOnly="True" SortExpression="vehiclename" /> <asp:BoundField DataField="platecode" HeaderText="Supplier" ReadOnly="True" SortExpression="platecode" /> <asp:BoundField DataField="inscom" HeaderText="Qty/Unit" SortExpression="inscom" /> <asp:BoundField DataField="inedate" HeaderText="Price" SortExpression="inedate" /> </Fields>
</asp:DetailsView>
When i run the code, Details View is Displaying First ID, First Name from the table.
Detail View Displaying like this
ID 001
Name Raja
Link: 1 2 3 4
But when i click the link2 it showing errors as "The DetailsView 'DetailsView1' fired event PageIndexChanging which wasn't handled."
Details View is not displaying all the data.
How to solve this issue.
Need C# code Help
If you aren't using a DataSource control (like SQLDataSource), you have to handle the PageIndexChanging event, and rebind the datasource with the underlying data. Otherwise, the data source control handles all those events for you.
HTH.
精彩评论