D
Dobedani
Dear All,
I would like to use a Repeater to show data - mostly large volumes
from a database - in a comma delimited format. VS.NET documentation
mentions this as one of the uses of the Repeater! Actually, the idea
is that users can save the output of a request as CSV file on their
desktop. For that reason, I stripped my aspx of all html and left only
the first line:
<%@ Page language="c#" Codebehind="csv.aspx.cs" etc. %>
I hope to be able to add the repeater on the fly, like in the
following:
Repeater rptData = new Repeater();
this.Controls.Add(rptData);
However, it appears impossible to edit the templates in the code. I
tried assigning strings to the HeaderTemplate and ItemTemplate, but I
got:
Cannot convert type 'string' to 'System.Web.UI.ITemplate' even when I
tried to cast my strings.
I am now thinking that to create a server control derived from
Repeater is the way forward. Am I right? How to go about it? And what
should the ItemTemplate look like? I hope to avoid databinding with
DataBinder.Eval because that will make the page terribly slow.
Moreover, the number of columns is variable (max. 13). I hope somebody
can help me. TIA
Kind regards,
Dobedani
Wageningen
The Netherlands
I would like to use a Repeater to show data - mostly large volumes
from a database - in a comma delimited format. VS.NET documentation
mentions this as one of the uses of the Repeater! Actually, the idea
is that users can save the output of a request as CSV file on their
desktop. For that reason, I stripped my aspx of all html and left only
the first line:
<%@ Page language="c#" Codebehind="csv.aspx.cs" etc. %>
I hope to be able to add the repeater on the fly, like in the
following:
Repeater rptData = new Repeater();
this.Controls.Add(rptData);
However, it appears impossible to edit the templates in the code. I
tried assigning strings to the HeaderTemplate and ItemTemplate, but I
got:
Cannot convert type 'string' to 'System.Web.UI.ITemplate' even when I
tried to cast my strings.
I am now thinking that to create a server control derived from
Repeater is the way forward. Am I right? How to go about it? And what
should the ItemTemplate look like? I hope to avoid databinding with
DataBinder.Eval because that will make the page terribly slow.
Moreover, the number of columns is variable (max. 13). I hope somebody
can help me. TIA
Kind regards,
Dobedani
Wageningen
The Netherlands