Posted on: 1/3/2014 1:54:38 AM | Views : 777

Hi,

i have a datatable and a gridview.
when i bind the dt, the datas are not shown. if i set the auto columns to true then the data will be shown.
everything was programatically populate. how to i bind dt to gridview if auto columns are set to false?
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"> </asp:GridView> For i As Integer = 0 To fields.Count - 1 If header = True Then dt.Columns.Add(fields(i)) Else 'populate datatable columns dt.Columns.Add() End If Dim temfield As New TemplateField 'populate gridview columns temfield.HeaderTemplate = New DataGridTemplate(ListItemType.Header) GridView1.Columns.Add(temfield) Next For i As Integer = 0 To fie ...

Go to the complete details ...