GridView binding with Arraylist
Hi Guys,
I have bound gridview with an ArrayList and now i want to display the content of arraylist inside the TextBox using Template Column.
Like.
ArrayList objArrFname = new ArrayList();
objArrFname.Add("File 1");
objArrFname.Add("File 2");
GridView1.DataSource = objArrFname;
GridView1.DataBind();
---------------------------------------
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:TextBox ID="abcd" runat="server" Text=''></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
---------------------------------------------------
I could have done it using RowDataBound event of GridView. But i do not want to move on Code-Behind file for Solution.
I just wanna confirm that what should i write in Text property of TextBox
<asp:TextBox ID="abcd" runat="server" Text=''></asp:TextBox>
If we were using DataTable/DataSet then we can write
Text = '<%# Eval("ColumnName") %>'
Thanks & Regards
Pankaj Bahuguna
__________________
Thanks
-Pankaj Bahuguna
|