Reputation: 331
as i wanna format my grid view as it is only showing data like this,
john
Adam
Morkel
Kalis
.
.
.
.
i wanna show them in this way ,
john Kalis .
.
Adam Chris .
. .
morkel . .
my code after attaching data sorce,
GridView1.DataSource = dt;
GridView1.DataBind();
hopes for your Suggestions thanks in Advance
Upvotes: 1
Views: 454
Reputation: 5485
I think you have to use DataList
instead of gridview
check these examples
http://www.packtpub.com/article/working-with-asp-dot-net-datalist-control
Edit:
.aspx
<ItemTemplate>
<ul>
<li> <%# Container.DataItem %></li>
</ul>
</ItemTemplate>
</asp:DataList>
.cs
List<string> ss = new List<string>();
ss.Add("john");
ss.Add("Adam");
ss.Add("Morkel");
ss.Add("Kalis");
ss.Add("Chris");
DataList1.DataSource=ss;
DataList1.DataBind();
Upvotes: 0
Reputation: 18797
You're better off using a DataList control.
for your multi row/multi column need, take a look at "Step 3: Displaying Data in a Multi-Column, Multi-Row Table" at http://www.asp.net/web-forms/tutorials/data-access/displaying-data-with-the-datalist-and-repeater/showing-multiple-records-per-row-with-the-datalist-control-vb
Upvotes: 1