Telerik RadGrid: grid clientside pagination - asp.net

I have a web service which returns me some data,I am massaging this data and using this as datasource for my radgrid (telerik). The datasource is quite large, and would like to paginate it. I found couple of problems when I paginate it in the server side
I have to bind the grid again for pagination, which essentially means I have to make a call to WS again to get the data. This is an expensive call for me. I would rather forgo the benefits of pagination and would display all the results in the same page, except for it would be a bit clumsy
During the postback RadGrid1.Items.Count happens to be the number of items getting paginated (25- in my case) which is expected as all the items in the datasource are not getting bound. This of course is not an issue. The real issue is that we have some checkboxes which get checked based on some business condition. We add this to our business object/DB later. So if the user has not navigated all the pages, these "checked" items do not get added as pagination limits the "Items" in the grid to those which get bound for that particular page index.
My Thoughts:
I would rather have some sort of client side pagination, where we can hide/show contents than going to the server and doing a databind every time. Though it will return all the results, the UI will not be clumsy and the grid would have "all the items" during postback
Is there a way to do it ?
If it were a regular asp.net gridView, can someone point me to a good article which would serve my purpose
Ram
PS: who else think radgrid is crazy ? (unfortunately I did not make this choice)

Recently during my project implementation (which is built with RadControls and RadGrid in particular) I found a handy example that shows how to get grid data from web service and implement paging with a single call to that web service. Check it out:
http://demos.telerik.com/aspnet-ajax/grid/examples/client/declarativedatabinding/defaultcs.aspx
Dick

[I don't have any experience in using RadGrid as well as Telerik, so this solution may/may not work for you]
Silverlight 3 has native support for pagination, you can get more info at PagedCollectionView
BRIJ MOHAN also wrote a nice tutorial on how to leverage this class as well as other cool features like column grouping.
http://weblogs.asp.net/brijmohan/archive/2009/08/01/silverlight-3-datagrid-columns-grouping-using-pagedcollectionview.aspx

Related

Is custom paging of GridView (in ASP.NET, preferably 3.5) possible without using ObjectDataSource?

See title.
Using ObjectDataSource is associated in my mind with quick demos that you can see at conferences and in video tutorials (which typically tells me "don't do it this way in production").
Also I always like to have control over what's going on and when it happens. My other problem with ObjectDataSource is that is's declarative.
Looking forward for your help and opinions.
UPDATE:
I'm retrieving only one page of results from the database and the GridView.PageCount is read-only [sic!].
Yes, you need to define an PageIndexChanged event handler to perform the actual paging of data from your source before binding to the Data Grid, same idea for sorting but with a SortCommand handler.

Facebook Wall functionality using ASP.Net

I want to create something similiar to a facebook wall on my social site. I want to store the posts in an sql database and that should be rather simple. What I am looking for is a good way to display the posts? I guess I don't even really know where to start, as I can only think of using a loop to display asp:textboxes. Which obviously is not correct.
I want there to be multiple posts displayed on the page, which should include:
the user who posted,
the text posted,
the date posted,
and if I want to get crazy...a means of deleting/editing the post.
I really have no idea of how to implement this concept, so any ideas would help greatly.
To get started, view this article from asp.net on the Repeater control, or this great article.
The Repeater control lets you databind to a list of objects, and then define one template for how that object should be displayed. Then, ASP.NET will handle showing it as many times as necessary. You can write the code-behind for dealing with delete and edit as if there were only one instance on the page.
go ahead with jquery, use a lot of ajax. for the mark up, use a repeater control with all clean html mark up (instead of server side controls which would generate a lot of unnecessary mark up quickly creating performance issues)
only populate x number of items on initial load, and then using jquery pull data as required based on user action. you can serve this data via json, decode json on client side using jquery and perform a loop which converts this json into appropriate html and injects it into the correct html element
should be simple ;-)
ASP.NET gives you lots of ways to do this. A Repeater, DataGrid, GridView are the first that come to mind. If you'd rather use ASP.NET MVC, there's always the good old foreach loop.
Additionally, check out ListView too.

Alternative UI control for large data lists instead of DropDownList

I am using C# and ASP.NET with version 2.0 of the .NET Framework library on this particular project. We are also using the AjaxControlToolkit. The AjaxControlToolkit should have the controls available to make a descent User Interface solution to the problem I'm facing.
I have run into this in a few projects in the last year, and used different solutions in the past. The current design of the project I just picked up, is that there is an <asp:DropDownList> control and on page load a Database call is made to get a list of values. This is then bound using DropDownList's datasource. The problem is that there is 25k items returned from the database. First thing, that's not acceptable for a user to have to scroll through tens of thousands of items. But, even more importantly, is that in every browser that it is tested on (IE 7, FF 3, Safari, and Chrome) the browser completely hangs as it is propagating the dropdownlist items.
What I'm thinking is using a Modal Popup form, which an Autocomplete Extender that allows the user to drill down to a specific company. So, in the field where they have to choose a company, they click on a "select company" icon, the modal form comes up, letting them use the autocomplete extender to select an existing company. They click "Ok" and it save the value to the field.
However, I'm an old school command line/shell/terminal guy, and my ideas of acceptable UI design might be skewed (give me a command prompt on any system, and I'm good to go). I would like the advice of those in the community here as to what they think would be an acceptable solution, or if they have faced other issues like this.
I think your idea for the autocomplete extender is the best solution. I've had this problem as well (sounds similar--a project you are taking over from somebody else). The push-back often comes from the user side. They are used to being able to select from a list of items. Unfortunately as the database grows, this becomes less and less feasible.
But when you have 0.5MB of html downloaded on the page (not including the viewstate), compromises have to be made.
Why do you think you need to create modal popup? Can't you just have the extender on your data entry page?
I had to deal with the same issue. But I ended up using a combobox with paging support and auto complete. Currently this combobox happens to be from Telerik. Its a comboBox for auto complete since you can't type into a droplist.
I agree that no user is going to want to look thru 25,000 items to find the one they want. Is there some way you can limit the data so that they drill down? Like selecting a region or type of company first and then showing the ones that match?
Multiple cascading ListBoxes, each futher refining the resultset of the previous
AJAX AutoCompleteExtender

Problems migrating databinding in VB.NET from Winforms to ASP.NET 2.0

And this was supposed to be so easy...
I have existing business and data access layers that handle the retrieval and update of the data in question. These work great with the existing Winforms application (.Net V2.0)
Now, in trying to write a new web-based UI, I'm running into all sorts of problems (last time I wrote asp.net code was in 1.1). Specifically, I can't data bind a text box to a business object. Oh, sure there's the ObjectDataSource but that wants to know how to do CRUD operations on the data.
What I'm looking for is something that acts like the classic binding objects so that, in my code, it's as simple as retrieving the object and doing a a refresh. The data component like FormView and DetailsView are so generic-looking that it's ridiculous. The existing application would have tabbed dialogs, text boxes grouped by panels, etc.
On top of that, I have a directive to use master pages and unless one control causes it, I can't seem to get the content section to expand. I can't just put a text box below the bottom of Content1 and have it re-size the content section - which gives me the same results as an earlier question I posted when the footer wasn't being pushed down - relative position solved that but doesn't seem to solve it with placing small text boxes in the area.
What I want is fairly simple. Something like:
bindingobject.datasource = businessdataobject
bindingobject.refresh
...and have the text boxes refresh with the new values. Likewise to have businessdataobject properties updated as the user enters new data.
I was able to do this with the GridView (grdRequests.DataSource = lstRequests) by making a list of asp:BoundField tags inside the <Columns> collection of the GridView.
Am I tilting at windmills here?
Why don't you give the Patterns and Practices (1) ObjectContainerDataSource a try? It's part of the Web Client Software Factory which is available (2) here.
I've used it a few times, it gives you the ODS-style design experience (design time binding) but full control over how you provide the data source. You just implement the events you are interested in (e.g. Selecting event). It also has server side paging and sorting support so it's quite useful for GridViews.
It might not be flexible enough for what you aretrying to achieve, but it's probably worth checking out if only as a PoC.
[ (1) http://www.codeplex.com/websf/Wiki/View.aspx?title=Object%20Container%20DataSource ]
[ (2) http://www.codeplex.com/websf ]

ASP.net AJAX Search

I am looking for an example of using ASP.net AJAX to show a 'live' filtering of a repeater control based on what is being typed into a textbox. I have seen stuff using the Web Client Software Factory but am more interested in something that doesn't require an additional library.
The asp.net ajax control toolkit has one here.
If you don't like that one, searching google for "Ajax Autocomplete" gives lots of decent looking results, unless I am mistaking what it is you want to do.
I think you're a little confused as to what AJAX entails. If you want the filtering to interface with the server control's datasource, then it would not by definition be AJAX.
Live filtering a databound control the way you want is ill-advised, I think. For each iteration you'd have to re-bind the control, which would create a tremendous amount of overhead.
You'll need to find a way to do this client-side, with javascript. It could simply hide items within the repeater-created markup as they are filtered out, although how exactly this would be accomplished depends entirely on what html you're generating with the repeater.

Resources