Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Changing the cusor on a web page

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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-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/…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

661 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