|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Dynamic generation of a tablefor a table in the <HeaderTemplate> and finish it up in the <FooterTemplate>. However, i'd like to dynamically create it and i wonder how i can do so. How can i produce "a half" of HtmlTable? Or should i rather aim for dynamically creating the whole asp:Repeater part? How can i do that wisely (i.e. smoothly)? -- Regards K Viltersten ---------------------------------------- May all spammers die an agonizing death; have no burial places; their souls be chased by demons in Gehenna from one room to another for all eternity and beyond.
Show quote
Hide quote
On Jul 2, 8:02 pm, "K Viltersten" <t***@viltersten.com> wrote: Why don't you use <asp:table> then? Or a gridview?> In my asp:Repeater, i'm starting a mark-up > for a table in the <HeaderTemplate> and > finish it up in the <FooterTemplate>. > However, i'd like to dynamically create it > and i wonder how i can do so. > > How can i produce "a half" of HtmlTable? > Or should i rather aim for dynamically > creating the whole asp:Repeater part? How > can i do that wisely (i.e. smoothly)? > > -- > Regards > K Viltersten > ---------------------------------------- > May all spammers die an agonizing death; > have no burial places; their souls be > chased by demons in Gehenna from one room > to another for all eternity and beyond. >> In my asp:Repeater, i'm starting a mark-up I'm not sure how that helps. Please elaborate.>> for a table in the <HeaderTemplate> and >> finish it up in the <FooterTemplate>. >> However, i'd like to dynamically create it >> and i wonder how i can do so. >> >> How can i produce "a half" of HtmlTable? >> Or should i rather aim for dynamically >> creating the whole asp:Repeater part? How >> can i do that wisely (i.e. smoothly)? > > Why don't you use <asp:table> then? Or a > gridview? -- Regards Konrad Viltersten -------------------------------- May all spammers die an agonizing death; have no burial places; their souls be chased by demons in Gehenna from one room to another for all eternity and beyond.
Show quote
Hide quote
On Jul 3, 12:17 am, "K Viltersten" <t***@viltersten.com> wrote: Hi Konrad,> >> In my asp:Repeater, i'm starting a mark-up > >> for a table in the <HeaderTemplate> and > >> finish it up in the <FooterTemplate>. > >> However, i'd like to dynamically create it > >> and i wonder how i can do so. > > >> How can i produce "a half" of HtmlTable? > >> Or should i rather aim for dynamically > >> creating the whole asp:Repeater part? How > >> can i do that wisely (i.e. smoothly)? > > > Why don't you use <asp:table> then? Or a > > gridview? > > I'm not sure how that helps. Please elaborate. > > -- > > Regards > Konrad Viltersten > -------------------------------- > May all spammers die an agonizing death; > have no burial places; their souls be > chased by demons in Gehenna from one room > to another for all eternity and beyond. ASP.NET has few other controls to generate tables - GridView and Table http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.table.aspx http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.aspx So, instead of modifying a list from Repeater, you can build a table using GridView, or Table controls. If for any reason you need to have a Repeater, do following: <%@ Import Namespace="System.Data" %> <asp:Repeater id="cdcatalog" runat="server"> <HeaderTemplate> <table border="1" width="100%"> <tr> <th>Title</th> <th>Artist</th> <th>Company</th> <th>Price</th> </tr> </HeaderTemplate> <ItemTemplate> <tr> <td><%#Container.DataItem("title")%> </td> <td><%#Container.DataItem("artist")%> </td> <td><%#Container.DataItem("company")%> </td> <td><%#Container.DataItem("price")%> </td> </tr> </ItemTemplate> <FooterTemplate> </table> </FooterTemplate> </asp:Repeater> Hope this helps > ASP.NET has few other controls to generate <snip>> tables - GridView and Table > http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.table.aspx > http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.aspx > So, instead of modifying a list from > Repeater, you can build a table using > GridView, or Table controls. > If for any reason you need to have a Repeater, > do following: > <%@ Import Namespace="System.Data" %> > <asp:Repeater id="cdcatalog" runat="server"> > <HeaderTemplate> > <table border="1" width="100%"> > <tr> I'd need to change the style of the table dynamically, from code behind. In order to do so, i need to run it on server BUT then i get problems because when run on server, the control/element (table) musn't span accross multiple templates... Sight... :( Suggestions? (Yes, i'm required to use asp:Repeater.) -- Regards K Viltersten ---------------------------------------- May all spammers die an agonizing death; have no burial places; their souls be chased by demons in Gehenna from one room to another for all eternity and beyond.
Show quote
Hide quote
On Jul 3, 11:51 am, "K Viltersten" <t***@viltersten.com> wrote: <HeaderTemplate>> > ASP.NET has few other controls to generate > > tables - GridView and Table > >http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.tab... > >http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gri... > > So, instead of modifying a list from > > Repeater, you can build a table using > > GridView, or Table controls. > > If for any reason you need to have a Repeater, > > do following: > > <%@ Import Namespace="System.Data" %> > > <asp:Repeater id="cdcatalog" runat="server"> > > <HeaderTemplate> > > <table border="1" width="100%"> > > <tr> > > <snip> > > I'd need to change the style of the table > dynamically, from code behind. In order to > do so, i need to run it on server BUT then > i get problems because when run on server, > the control/element (table) musn't span > accross multiple templates... Sight... :( > > Suggestions? > (Yes, i'm required to use asp:Repeater.) > > -- > Regards > K Viltersten > ---------------------------------------- > May all spammers die an agonizing death; > have no burial places; their souls be > chased by demons in Gehenna from one room > to another for all eternity and beyond. <table style="<%=TableStyle%>"> </HeaderTemplate> >> Suggestions? Got it. Thanks.>> (Yes, i'm required to use asp:Repeater.) > > <HeaderTemplate> > <table style="<%=TableStyle%>"> > </HeaderTemplate> -- Regards Konrad Viltersten -------------------------------- May all spammers die an agonizing death; have no burial places; their souls be chased by demons in Gehenna from one room to another for all eternity and beyond.
Other interesting topics
Referencing to LinkButton in Gridview TemplateField
progress indicator long running proc NO Button click Help with C# using popup pox Space or comment between the lines can affect the program When does IsReusable Property get interrogated? Deleting table row in table grid using ASP.NET MVC System.InvalidCastException was unhandled by user code double click reaches to inline code Using LINQ with multiple conditions (&&) How detect if page is requested from other page or a fresh request |
|||||||||||||||||||||||