Solved

Changing the cusor on a web page

Posted on 2011-09-08
7
333 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 40

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
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
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/…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

623 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