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
Installation of MS SQL 2005 (Recovering after a crash)
Excel 2010 - Matched record then cell value
How to close linq to sql connection in database access layer
Wrap text on the outside of a DIV tag?
How to forward mails from one mail box to multiple mail boxes
Antivirus recommendations
NT system generated accounts
Why does a differant computer name come up when I ping an IP address?
How SQL injection work?
VB.NET 2008 Dynamically Add Forms Controls Based on Directories and Files