gridview paging inside the list view in aspx - asp.net

is it possible to have grid view pagging function inside a list view in asp.net.
i have two column subject and lesson.
i have more than 30 subjects and each subject contains more than 100 lesson.
i want to load the subject list and as soon as i click on any subject the lesson belong to each subject show.
as of now 100 subjects are showing, is it possible that i can have a pagging so that i can see 20 20 subject in each layout while not uploading/refreshing the whole webpage.
you can see the live page where i want to do it at
http://gvapps.zapto.org:801/studywiser/home.aspx
is there any way possible that grid view pagging works inside the list view.
though i am not the programmer i am writing this question on behalf of my programmer who is telling me its not possible to have it.
any suggestion or answer will be highly appreciated.
thank you
yasir

Related

.NET dropdownlists with huge number of items

I am working on a webpart which makes use of 5 dropdowns (each dropdown represents 'Project' table columns like projectNo, ProjectPM, ContractNo etc). The table has more than 3000 items, so when the dropdownlists are finally databound, they have more than 3000 items to load, which pretty much brings IE to a halt.
What is the best way to go about architecting a solution, so users can still make use of the dropdown list interface, may be like first rendering an empty dropdownlist and then using a modal window to first find the project number they are looking for and then set the item as selected in the dropdownlist. I am envisioning the following UI. Can anyone guide me on how I should go about solving this issue?
-------------------
|V| [SearchBtn]
-------------------
-------------------
|V| [SearchBtn]
-------------------
-------------------
|V| [SearchBtn]
-------------------
[FindProjectBtn]
Clickikng on the searchBtn basically brings up a popup window where they can search for their stuff, and when they click on the matched result, it will set the dropdownlist.
When working with dropdown lists, a good rule-of-thumb is to keep the list short so you do not experience browser performance issues. If you have thousands of items to look through you can:
Create a search component whereby the user enters a part of the project name they are searching for and display a simple grid for them to choose from.
Implement a type-ahead mechanism. The user enters the first couple of letters of what they are searching for. You can query your DB for the top 10 hits and return them via AJAX.
If you have 3000 items, then definitely drop down list will not be a right designing decision.
using any kind of repeater lists with paging, sorting and searching functions is highly recommended in your case.
but if you insist to have a kind of drop down list view then Matthew's suggestions are your answer.

How should I display datatable in multiple pages?

IN summary . I have an ASPX page. and a button. Clicking the button will load the result based on the parameter the user specified. The problem is if the result is too much, the page is too slow to load.
AS I am writing my question. basically I need suggestion as to which approach is the best practice?
OPTION 1 is it possible for the ASPX page to load in chunks and as the user scroll, more result will be displayed. if so, where do I start reading and how do I do it?
OPTION 2 fix the function behind the button to display 10 records at a time. and add another button such as next page or previous page
OPTION 3 It would be nice , if I know what I am doing, is to show progress to the user, what the code is doing . a nice progress bar.. showing loading .. 10% done, 20% done.. 100% done.. . at least the user is not just watching Internet explorer spinning icon...
ugh, Apologize as this becomes a really long post..
I have a function that loop through a datatable (DT). Lets call this function displayImages.
The DT may have 200 records. what's inside DT, is a list of filenames.
DisplayImages function, determine where the file is located and display the result into the user. The end result is HTML tag like
img src="path/filename.jpg"
I have other routines in displayimages function, but for the sake of simplicity lets just say the displayimages function only loops through DT and spits out the img src="path/filename.jpg"
The problem I am currently having is that displayimages function is too slow to complete all 200 results. And my attempt to give the user some feedback to show where the loop is at has not work very well (I don't know how to make a nice progress bar to show end user what the loop is doing inside displayimages function)
So I have this Idea of displayimages function to show only 10 records at a time. and a user then click a link button or ASPX button. page 1 , page 2 and show on, to display the next result.
I read I can use pagingdatasource. but I am wondering if there is a clever way to just loop the datatable from row 1 to 10
then row 11 to 20
and so on...
I guess my problem is how can I keep that datatable in memory so I can keep referring to it.
I do have an identifier set in the datatable if that can be any help?
Please let me know your suggestion.. Thank you
This is an ASPX website with VB.net code behind
Thanks in advance
In the end I end up with option number 2.
I am not using sql data source in my code. but I only use datatable.
so to achieve option 2 (which is to display 10 records at one time. and the user has the ability to click page 1 page 2 page 3) I use gridview and css.
Gridview is set to display 10 results at one time.
And as the gridview is irrelevant for the user I use CSS to hide all the contents. but only show the pagination row (the last row)
as I am learning to code in asp.net and vb.net I wish to be able to do option 1 or option 3.
I am hoping I will be able to learn how to do it in the near future.
Thanks!

ASP.net: Complex validation of dynamically created DropDownLists

I have a GridView with records of the database.
I create two DropDown lists dynamically for each selected item. That means, if I click select, two DropDown lists appear, the first one defines a start position, the second one a stop position. Both includes numbers (depending on how many items I have selected). If I have selected 5 items, all DropBox controls include the values 1 - 5. Everything is done by code behind.
Now I want to validate that. The stop Control shall be set to a higher one as the start control. Further more, each area that is already used, is not allowed for the next controls. E. g. if I select in the first pair of DropDown lists the area 1-5, I shall not be able to choose 2-6 with the next pair of controls.
How can I do that. I thought about javascript but that could be very tricky because everything is done with code behind. The validation controls are nice, but I don't know how to validate such a complex thing...
Any Ideas?
thank you for your answers!
I dont wont to do a async postback each time, especially because the lists shouldnt be limited during the changes. I solved it in that way:
The user clicks on save, I create a bool array for each dropdown item, then I loop through all dropdownlists in the placeholder. If there is a area from 3 - 5 I set the values with index 3-5 in my bool array to true. If one of these values is already true, there must be a wrong selection in the start/stop positions.
I think, its not a very nice way but works pretty fast and does everything I want. If someone has a better idea, please let me know... ;)
Thanks!
Stefan

Telerik RadScheduler - select multiple resources

I'm using Telerik scheduler to display a Timeline view of meetings. The resources derive from the Person class, and they are Advocate, and Legislator.
On the Y axis, I am listing Advocates, and on the X axis, I am listing blocks of time in one hour increments.
When I double click an appointment, the Edit Appointment modal dialog pops up and lists Advocates and Legislators.
Since meetings will have multiple advocates and possibly multiple legislators in attendance, I would like to have a checkbox list inside the resource dropdowns on the edit screen. Is there any way to accomplish this?
I believe this will allow me to solve one problem in that, if Peter Pan and Homer Simpson both are to attend the same meeting, clicking the meeting in the row for either of those two advocates will display 'Peter Pan' in both instances (or sometimes '-', not yet sure where that comes from) rather than 'Homer Simpson' where I open up the meeting from his row.
If it is not possible to introduce checkboxes to the resources list, can you suggest an alternate way around the ultimate issue in the above paragraph? Thanks in advance.
Telerik supports the adding of a listbox to support what you are trying to do. On the Scheduler itself add the code below that mimics your field names that your advocates are pulling from in your DB:
<ResourceTypes>
<telerik:ResourceType DataSourceID="SqlDataSource2" ForeignKeyField="Adv_AdvocateID"
KeyField="Adv_AdvocateID" Name="Advocate" TextField="Adv_FullName" AllowMultipleValues="true" />
</ResourceTypes>
The next step is to populate the resources using a custom provider. See this program here for a great project in which you can see resource population in action. Using the SchedulerDBProvider class you can then adjust their example to more represent your fields and populate the appointments accordingly with your desired ResourceTypes.
In terms of getting that particular drop down to have multiple selections via checkboxes you would most likely have to define your own custom advanced template. This route allows you to take a UserControl and use that as the edit view for your appointments. There's a demo that displays all of this (including source code) right here.
However, having that RadComboBox there might not even be the ideal approach to take. What about just a simple list of checkboxes? This demo shows off how a very simple declaration for the RadScheduler can achieve this functionality. Additionally, there is some code-behind (both in C# and VB.NET) that shows off how you can customize the text on each appointment, which might be helpful in the case that you're referring to.

Dropdownlist - number of display element

I have dropdownlist on my webpage.
When I click it the list with all items is expanded. But this list is very long.
How can I change it to achievie a list with (e.g.) 5 displayed items and with a scrollbar next to them.
If it is not possible, how can I do it with ListBox? I know it is Rows property there but can I declare how many rows is display all the time not after expanding the list.
This control, will, of course be rendered on the page as a standard <select> control.
With these, the height of the list once its dropped down is determined by the browser, and you have no control over this. You'll notice when the list approaches the foot of the page, the browser will implement the scrollbar as you suggested, but not with the number of items you maybe want.
My only suggestion would be to investigate the options offered by some client-side drop down add-ins. You may be able to find some jQuery ones that will help.
A simple google search for "jquery dropdowns" yielded this article as the top result: 38 jQuery And CSS Drop Down Multi Level Menu Solutions. If you can't find something here then there are also plenty similar sites in the search results.
I think this post provides you with a couple of different solutions to your problem.
http://blogs.msdn.com/b/rakkimk/archive/2011/05/02/dropdownlist-html-select-vertical-scrollbar-number-of-items.aspx

Resources