Solved

Changing the cusor on a web page

Posted on 2011-09-08
7
327 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
Technology Partners: 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!

 

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…

738 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