473,387 Members | 1,440 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Help with GridView jumping.

I am new to asp.net.

I have a grid view that is bound to a dataview.
I have used a small javascript to select the rows in the gridview see
below:-

<script language="javascript" type="text/javascript">

var oldgridSelectedColor;

function setMouseOverColor(element) {

oldgridSelectedColor = element.style.backgroundColor;
element.style.backgroundColor='silver';
element.style.cursor='hand';
element.style.textDecoration='underline';
}

function setMouseOutColor(element) {

element.style.backgroundColor=oldgridSelectedColor ;
element.style.textDecoration='none';
}

</script>

Protected Sub DefaultGridView_RowDataBound(ByVal sender As Object,
ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles
DefaultGridView.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.Attributes("onmouseover") =
"javascript:setMouseOverColor(this);"
e.Row.Attributes("onmouseout") =
"javascript:setMouseOutColor(this);"
e.Row.Attributes("onclick") =
ClientScript.GetPostBackClientHyperlink(DefaultGri dView, "Select$" &
CStr(e.Row.RowIndex))
End If
End Sub

This works fine.
The problem I am having is that when an item is selected the grid view
changes size and the header column text jumps around.
I can set a fixed width to the gridview but this doesn't stop the
columns changing shape/size.
Is there an easy way to resolve this?

Sep 26 '07 #1
0 1157

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

28
by: Tim_Mac | last post by:
hi, i'm new to .net 2.0, and am just starting to get to grips with the gridview. my page has autoEventWireUp set to true, which i gather is supposed to figure out which handlers to invoke when...
1
by: Miguel Dias Moura | last post by:
Hello, I have a GridView in my page which is created in runtime. It works fine. My page has 2 Asp Buttons: - The HIDE button makes GridView.Visible = False; - The SHOW button makes...
0
by: Aws | last post by:
My crazy GridView !! I am using Visual Studio 2005, I have a problem with my GridView. I have one access .mdb table and when I update a record on the table EVERYTHING is perfect. I made a Web...
8
by: Greg Lyles | last post by:
Hi all, I'm trying to develop an ASP.NET 2.0 website and am running into some real problems with what I thought would be a relatively simple thing to do. In a nutshell, I'm stuck on trying to...
4
by: Bill | last post by:
Say I want to pull a bunch of records from a contacts database into a gridview and one of the fields contains an email address. Now suppose I want to make that email address clickable by putting it...
0
by: trint | last post by:
I hope I can explain this clearly enough to get help. I have three gridviews that need to work from each other to display like a java verticle menu (just in the way it appears). GridView1 is...
0
by: LiamLiamLiam | last post by:
G'day all. I having a problem with my formview. I'll ty to explain my situation as best as i can. I have a page with a search field at the top which is just a simple asp:textbox. Below that i...
0
by: sharonrao123 | last post by:
hello all, I have a parent gridview company and in this one a nested gridview people, Is it possible to allow the user to select one row or multiple rows from the people gridview using a check box...
0
by: joelgarcia007 | last post by:
I really hope someone can help me with this because it's really driving me crazy. I need to dynamically display multiple data tables on a page so I am using a Repeater to do so and in the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.