I am trying to display a dynamic checkboxlist. I have a datatable with 4
columns.
ItemId, ItemTitle, ItemDescription, ItemUrl.
Two of these columns are required. ItemId and ItemTitie.
If for certain items the ItemUrl is present then I would like to append it
to the item Title like '[]ItemTitle (hereis ItemUrl)'. Other wise just
display the item title next to the checkbox.
Since I need this little formatting on the item title , simple
DataSource/Binding wouldn't work.
I have two options
i) Either alter the itemtitle at the ItemDataBound Event.
ii) or Make a clone of the DataTable and alter the ItemTitle column to
include the itemUrl and then bind this new DataTable to the repeater.
My questoin is which option is more efficient and why?
I would really appreciate your knowledgable input.
Thanks.
Eliyahu Goldin - 13 Dec 2007 15:35 GMT
It is not clear to me what could be the advantages of cloning. The same code
that you need to execute in the ItemDataBound event for every item will have
to execute on the datatable rows anyway.

Signature
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
>I am trying to display a dynamic checkboxlist. I have a datatable with 4
> columns.
[quoted text clipped - 16 lines]
>
> Thanks.
DotNetDev - 13 Dec 2007 16:08 GMT
After getting the clone, I would merge the two columns so ItemTitle would
also contain ItemUrl if its present and then binding would be simple.
> It is not clear to me what could be the advantages of cloning. The same code
> that you need to execute in the ItemDataBound event for every item will have
[quoted text clipped - 20 lines]
> >
> > Thanks.
Angel - 13 Dec 2007 18:37 GMT
I may not understand the problem but it sound to me you would like to alter
dynamically the second column. If I was doing it I would populate my control
programatically exercising full control over what is rendered. You might
also create SQL query that provides two columns and performs this process
dynamically at this level. Leaving you with a simple databind all over again.

Signature
aaa
> I am trying to display a dynamic checkboxlist. I have a datatable with 4
> columns.
[quoted text clipped - 16 lines]
>
> Thanks.