TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
aadi patel
NA
53
33.4k
Runtime generate HyperlinkField in Gridview
Nov 27 2012 2:31 AM
I have gridview in my website.
I want to add multiple parameters in sqldatasource.
Passed parameters will be changed according to user selection.
So i want to add data in gridview using code and add HyperlinkField runtime.
How To assign Hyperlink field in Grid-view run time using code behind?
This is code for gridview and sqldata source,
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="EMP_ID" DataSourceID="SqlDataSource1" CssClass="Gridview">
<Columns> <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True" SortExpression="ID" />
<asp:BoundField DataField="SUBJECT" HeaderText="SUBJECT" SortExpression="SUBJECT" />
<asp:HyperLinkField DataNavigateUrlFields="ID" DataNavigateUrlFormatString="DisplayD.aspx?id={0}" DataTextField="MESSAGE" HeaderText="MESSAGE" />
<asp:BoundField DataField="DATE" HeaderText="DATE" SortExpression="DATE" ReadOnly="True" />
</Columns>
<SelectedRowStyle ForeColor="HotPink" BackColor="Snow" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:EAR_CS %>"
SelectCommand="LIST" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:SessionParameter Name="ID" SessionField="UserID" Type="Int32" /> </SelectParameters>
</asp:SqlDataSource>
Reply
Answers (
1
)
How To Add SQLDATA BASE TO C#.NET(WINDOWS FORM) APPLICATION BEFORE CREATE SETUP FILE ?
Difference between protocol in objective c and interfaces in java?