C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » ASP.NET GridView »

Insert an Image in between Rows of a GridView using ASP.NET


Posted Date: 02 Dec 2008    Resource Type: Code Snippets    Category: ASP.NET GridView
Author: sabeer masthanMember Level: Gold    
Rating: 1 out of 5Points: 0



The Following Code Will Allow you to add images after every row in a Gridview control
Step 1:

< asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="< %$ ConnectionStrings:NorthwindConnectionString %> "
SelectCommand="SELECT [CustomerID], [CompanyName], [ContactName], [Address], [City] FROM [Customers]">
< /asp:SqlDataSource>
An entry will be added to the web.config file as shown below:
< connectionStrings>
< add name="NorthwindConnectionString" connectionString="Data Source=(local);Initial Catalog=Northwind;Integrated Security=True" providerName="System.Data.SqlClient"/>
< /connectionStrings>

Step 2:

< asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
AutoGenerateColumns="False" DataKeyNames="CustomerID" DataSourceID="SqlDataSource1"
OnRowDataBound="GridView1_RowDataBound" Font-Names="Verdana" Font-Size="Small">
< Columns>
< asp:BoundField DataField="CustomerID" HeaderText="CustomerID" ReadOnly="True" SortExpression="CustomerID" />
< asp:BoundField DataField="CompanyName" HeaderText="CompanyName" SortExpression="CompanyName" />
< asp:BoundField DataField="ContactName" HeaderText="ContactName" SortExpression="ContactName" />
< asp:BoundField DataField="Address" HeaderText="Address" SortExpression="Address" />
< asp:BoundField DataField="City" HeaderText="City" SortExpression="City" />
< /Columns>
< /asp:GridView>



Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Interview Skills  .  Images in datagrid  .  Images after every row  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Exporting Grid view or data Grid to Excel ,Formatting cells with style sheet mso-number-format
Previous Resource: Enable Disable Controls inside a GridView
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET GridView


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use