Microsoft
Software
Hardware
Network
Question : How do i bind List<String> to GridView
How do i bind string array to gridview
//Code
string[] myKewords = {"One","Two","Three"};
List<String> keywords = new List<String>(MyKeywords.Sp
lit(','));
gdvKeywords.DataSource = keywords;
gdvKeywords.DataBind();
//HTML
<asp:GridView ID="gdvKeywords" runat="server" AutoGenerateColumns="false
">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<%# Eval("Keyword") %>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
I don't know how to bind?
thanks in advance
Answer : How do i bind List<String> to GridView
HTML
--------
<asp:GridView ID="gdvKeywords" runat="server" AutoGenerateColumns="true"
>
</asp:GridView>
Code
--------
string[] MyKeywords = { "One", "Two", "Three" };
gdvKeywords.DataSource = MyKeywords;
gdvKeywords.DataBind();
Random Solutions
IM (OCS 2007) not getting connected thru Blackberry..
Cold Fusion Oracle Stored Procedures with Ref Cursor
Host CPU % vs top Load
OSX Leopard 10.5 Deploy Studio - machine keeps restarting
Switching over Wan
cannot drop statistics in sql server
How to change language when installing ms-office 2010
Disable Spanning Tree Adtran Netvanta 1234
Declaring variables in stored porcedure
query question