How to generate a full dynamic grid with Linq and JQuery DataTable?
its my first time here so, take it easy please.
I'm using C#/ASP.NET Web Formss approch to develop the web-site. The code
below is populating a gridView, so, i would like to use this same return
to populate the DataTable, maybe using Repeater.
Declaring delegate
public delegate object ListMethod
public ListMethod listMethod;
Defining the listMethod
(Page.Master as Gestao).listMethod = listaTodos;
the listaTodos method
return usrMethods.Listar().ToList(); // Which returns a List<T>
Populating the GridView
if (!listMethod.Equals(null))
{
this.ListagemView.DataSource = listMethod();
this.ListagemView.DataBind();
}
Well, if you guys need more information, tell me about.
Most examples using Repeater & dataTables, needs to define the Columns
manually in the <HeaderTemplate>, and then defining the same amount of
<tr> in the <ItemTemplate>. The problem, in my case, is that i don't know
the amout of columns in the list, neither the names.
Thank you in advice, and really sorry for bad english.
No comments:
Post a Comment