Solved

Enable sorting on DataGrid and some other stuff

Posted on 2006-06-26
2
569 Views
Last Modified: 2008-01-09
How can I do the following in my DataGrid using VB.NET:

1) Enable sorting by ID, FirstName, LastName
2) Cache for 15 minutes
3) Display only 5 records at at ime


My code-behind (which is calling a method from my class to fill the dataset):


Imports System
Imports System.Configuration
Imports System.Data
Imports System.Data.SqlClient
Public Class WebForm1
Inherits System.Web.UI.Page


Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim da As New TestShoppingCart.User
DataGrid1.DataSource = da.GetActiveUsers
DataGrid1.DataBind()
End Sub

Private Sub DataGrid1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataGrid1.SelectedIndexChanged
End Sub

End Class
0
Comment
Question by:dba123
2 Comments
 
LVL 15

Accepted Solution

by:
justinbillig earned 300 total points
ID: 16985607
read this article from 4guysfromrolla about the asp data grid

http://aspnet.4guysfromrolla.com/articles/040502-1.aspx

it is a long read but it is well worth it and you will be well versed in the datagrid.

0
 
LVL 26

Assisted Solution

by:Rejojohny
Rejojohny earned 200 total points
ID: 16989217
have a look at www.datagridgirl.com/articles.aspx for all kinds of examples on datagrid .. it contains many examples of sorting and paging datagrids which is what u require

as for caching for 15 minutes... use cache.insert .. and set the slidingexpiration property to 15 minutes .. i do not have MSDN on this machine and so cannot give u the exact syntax ..
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now