How To Show Data In Column In Horizontal |
||
Welcome to the Zymic webmaster forums. Our forums are here to provide people the free ability to discuss a range of websites related topics such as design, development coding and marketing.
In order to post you will need to register for a zymic account or if you already have one simply login by using the form on the left.
Zymic Webmaster Forums Web Design & Development Server Side Scripting Other Languages |
||
![]() |
How To Show Data In Column In Horizontal |
||
Sep 22 2010, 11:22 AM
Post
#1
|
|
|
Newbie ![]() Group: Members Posts: 12 Joined: 14-September 10 Member No.: 156,880 |
Dear user ,
I am using grid-view in asp.net with c# .I want to show all my records in horizontal. I am using this coding how to show data in column in horizontal view because gird-view data show always in vertical view tell me this coding in asp.net with C# This post has been edited by sbglobal: Sep 22 2010, 11:24 AM |
|
|
Oct 5 2010, 11:20 AM
Post
#2
|
|
|
Newbie ![]() Group: Members Posts: 6 Joined: 19-July 10 Member No.: 149,669 |
You can make use of the DataList Control instead of the GridView Control. Make sure u specify the RepeatDirection as horizontal.
<asp:DataList ID="DataList1" runat="server" RepeatDirection="Horizontal"> <ItemTemplate> <asp:Label ID="label1" runat="server" Text='<%# Eval("colomn_name")+ " " %>'></asp:Label> </ItemTemplate> </asp:DataList> and the cs code would be as follows: SqlConnection connection = new SqlConnection("Integrated Security=true; Initial Catalog=server_name; Data Source=database_name"); protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SqlCommand command = new SqlCommand("select colomn_name from table_name order by your_id", connection); SqlDataAdapter adapter = new SqlDataAdapter(command); DataTable dtEmployees = new DataTable(); adapter.Fill(dtEmployees); DataList1.DataSource = dtEmployees; DataList1.DataBind(); } } It may help you |
|
|
![]() |
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users) |
||
| 0 Members: | ||
Forum Jump |
||
| Lo-Fi Version | Time is now: 24th May 2013 - 12:47 PM |