Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / December 2007

Tip: Looking for answers? Try searching our database.

DataTable and Repeater Control, performance question?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DotNetDev - 13 Dec 2007 15:28 GMT
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.