Solved

Changing the cusor on a web page

Posted on 2011-09-08
7
317 Views
Last Modified: 2012-05-12
I want to change the cursor on a web page when clicking on a row on a gridview to a wait cursor.
If I was doing the for a button, I'd use:

Button1.Attributes.add("onclick", "document.body.style.cusor='wait';"); which works fine.

Is there a equivalent for the gridview;

eg:
Gridview1.Attributes.add("onselectedindexchanged", "document.body.style.cusor='wait';"); or something?

Many thanks
0
Comment
Question by:Spike_66
  • 4
  • 2
7 Comments
 
LVL 7

Expert Comment

by:Gewgala
ID: 36503648
Maybe give this a try:

foreach (var row in GridView1.Rows)
{
    row.Attributes.Add("onclick", "document.body.style.cusor='wait';");
}

Open in new window

0
 
LVL 39

Assisted Solution

by:Kyle Abrahams
Kyle Abrahams earned 300 total points
ID: 36503723
Use the rowDataBound event instead:

 protected void gvGrid_RowDataBound(object sender, GridViewRowEventArgs e)
{
  e.Row.Add("onclick", "document.body.style.cusor='wait';");
}
0
 

Author Comment

by:Spike_66
ID: 36503754
row does not contain a definition for Attributes- so this won't work.
Sorry!
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:Spike_66
ID: 36503781
@ged325

Surely:

 protected void gvGrid_RowDataBound(object sender, GridViewRowEventArgs e)
{
  e.Row.Attributes.Add("onclick", "document.body.style.cusor='wait';");
}
0
 

Author Comment

by:Spike_66
ID: 36503807
Still doesn't appear to work- I'm using the auto-generated select button- would that matter?
0
 
LVL 7

Accepted Solution

by:
Gewgala earned 200 total points
ID: 36503872
@ged325's way should work fine,  but the problem is that "cursor" is mispelled:

e.Row.Attributes.Add("onclick", "document.body.style.cusor='wait';");

needs to be cursor
0
 

Author Comment

by:Spike_66
ID: 36503960
Mavellous (that'll teach me to copy and paste!)

I'll have to award @Gewgala points for pointing that out, I'm afraid!

Cheers guys!
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

760 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

25 Experts available now in Live!

Get 1:1 Help Now