German Wear Discount Shop - Click Here Write for Dotnet-friends and earn for your each submission [Dot]Net-Friends
Skip Navigation Links
Home
Latest
Fast Code
Articles
Tutorials
Online Resources
Forums
Login   | Hi, Guest


Merg cells in the Gridview, use gridview Paging ability

Written by kamal on Jun 24, 2007
replace your DataList with Gridview if you need paging

Explanation:

You are looking for the Datalist pagging hun? If you dont need the Datalist Columns Property then we will suggest you to use Gridview instead. Gridview have its own built-in pagging. Here we are going to present an example of how can you embed your Gridview in to your page and use it's Pagging.

Datalist list can be discribe as a one column Gridview. Use ItemTemplate of the Gridview and embed ur all Datalist Html code inside the same Column. yeah and dont forget to disable the AutoGenerateColumns.

<asp:GridView ID="GridView1" runat="server" AllowPaging="True" PageSize="1" AutoGenerateColumns="False" DataKeyNames="vid" DataSourceID="SqlDataSource1" GridLines="None" ShowHeader="false">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<div class="vedio">
<div class="heading"><%
# Eval("title") %>div>
<br /> <%# Eval("subtitle") %><br />
<br />
<div align="center"> <%
# Server.HtmlDecode(Eval("embedvalue").ToString()) %>div>
div>
ItemTemplate>
asp:TemplateField>
Columns>
asp:GridView>
div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:YourConnectionString %>"
SelectCommand="SELECT * FROM [Videos]">asp:SqlDataSource>

You can watch a live demo in here: Live Demo

Visitors/Readers Comments
(for questions please use The Forum)



shailendra

 

plz tell me more about the grid view control

plz each functionality of gridview send on my email id----     

10/03/2008 04:53:20 UTC




Add your Comments

Name:  
Message:
Note: For faster response please use Forums >> for your questions instead of the comments area! (Admin)