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.Split(','));

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  
 
programming4us programming4us