•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 363,826 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,302 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 312 | Replies: 6
![]() |
I have an xml documents that I need to bind using a repeater. This is to be a "preview" of a few rows of data with a "view more" link to see them all. Is it possible to do this using just one xml document? the xml file has about 15 items, but I only want to bind the first 4 or 5. Can this be done declaratively or do I have to make a new document that is a subset of the original and bind to that? seems pretty wasteful, but I cannot for the life of me find a way to stop databinding after X rows on any of the data controls!
any ideas? thanks!
any ideas? thanks!
You are somebody, just as I am somebody... but in the end, when you REALLY think about it, we are all nobody...
well I ended up cheating and using a gridview control. I set the paging to true with a pagesize of 5 and then made the pager invisible.
I know it's not ideal because 1) gridview renders a table, and I wanted a list and of course 2) GridView is clientside paging, meaning it read all of the data instead of the first X rows and stopping...
BUT, it works, for now, until I find a more efficient solution. suggestions are still appreciated!
thanks
I know it's not ideal because 1) gridview renders a table, and I wanted a list and of course 2) GridView is clientside paging, meaning it read all of the data instead of the first X rows and stopping...
BUT, it works, for now, until I find a more efficient solution. suggestions are still appreciated!
thanks
You are somebody, just as I am somebody... but in the end, when you REALLY think about it, we are all nobody...
•
•
Join Date: Oct 2007
Location: Bristol, UK
Posts: 1,121
Reputation:
Rep Power: 3
Solved Threads: 46
I have found a link which may be of some use to you SelArom:
Some of the W3Schools tutorials are very good and this is an example of such!
Good luck and hope this helps!
Some of the W3Schools tutorials are very good and this is an example of such!
Good luck and hope this helps!
If you have a quality, be proud of it and let it define you. Add it to the world!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
thank you for the link. I am actually pretty familiar with the repeater controls and how to use them, but this is a special operation that I've not seen done before.
I do want to bind to a list but what I want to do is STOP binding after say 5 rows.
It seems like it would be more logical to just limit the data retrieved from the xml file. I know how to do this with a dataview if the data was coming from a dataset or database, but i'm using the xmldatasource which is a text file. I'm thinking I'd have to make my own class to bind to by reading the xml node by node until I hit the limit.
unless anyone else has any ideas! thanks
I do want to bind to a list but what I want to do is STOP binding after say 5 rows.
It seems like it would be more logical to just limit the data retrieved from the xml file. I know how to do this with a dataview if the data was coming from a dataset or database, but i'm using the xmldatasource which is a text file. I'm thinking I'd have to make my own class to bind to by reading the xml node by node until I hit the limit.
unless anyone else has any ideas! thanks
You are somebody, just as I am somebody... but in the end, when you REALLY think about it, we are all nobody...
•
•
Join Date: Oct 2007
Location: Bristol, UK
Posts: 1,121
Reputation:
Rep Power: 3
Solved Threads: 46
Hmm I guess you could do what you originally intended and make a new file that is a subset of the original with the 5 or so items you wish to bind. although I understand your concern about this as it does seem somewhat un-elegant. Let me know your thoughts on this...
If you have a quality, be proud of it and let it define you. Add it to the world!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
well I think loading the whole thing into memory and cheating with the paging is doing the trick for now. the list is thankfully not so long that loading the whole thing into memory for just a few rows will be overtaxing resources. if I ever find a better way I'll report back.
if anyone else ever has an idea, please do the same
if anyone else ever has an idea, please do the same
You are somebody, just as I am somebody... but in the end, when you REALLY think about it, we are all nobody...
•
•
Join Date: Oct 2007
Location: Bristol, UK
Posts: 1,121
Reputation:
Rep Power: 3
Solved Threads: 46
OK sorry that i could not help more, not had much experience with using xml datasources. Maybe someone with more will reply.
If you have a quality, be proud of it and let it define you. Add it to the world!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
Other Threads in the ASP.NET Forum



Linear Mode