Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Changing the cusor on a web page

Posted on 2011-09-08
7
Medium Priority
?
350 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 41

Assisted Solution

by:Kyle Abrahams
Kyle Abrahams earned 1200 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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 800 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses

916 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