473,770 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

GridView/DataGrid via JavaScript?

Hi,

i am working at .NET Web-Application (c# codebehind) and i have placed on my
web-site a GridView, aka DataGrid (that works as Server control). This
GridView generated following code in HTML-source:

<asp:GridView ID="GridView1" runat="server">
</asp:GridView>

Is there a way to "reach" a GridView (or a GridView-Row) via Javascript? For
example to change its BackColor, something like:

GridView1.BackC olor="blue";

or

GridView1.Rows[0].BackColor="blu e";

but with JavaScript?

Please help...

Thanks!
Sep 22 '06 #1
1 1878
pApAk wrote:
This GridView generated following code in HTML-source:
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>
I guarantee that is not the generated html. Instead, that's the generated
asp code or whatever.
Load the age in your browser and view source. You'll find what you need.
Is there a way to "reach" a GridView (or a GridView-Row) via
Javascript? For example to change its BackColor
Probably. But the generated html/xhtml/js from .NET is so horrible that I
wouldn't even want to try to touch it.

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
Sep 22 '06 #2

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

Similar topics

1
2047
by: chrismichaelgardner | last post by:
Has anyone figured out how to get rid of the "doPostback" Javascript errors on Safari. I have a simple page with one gridview. When a row is selected, Safari hangs and the Javascript console reports an "invalid return type on doPostback". All I'm doing is running a standard select call (nothing fancy). I've tried disabling viewstates for both the page and gridview. I've also tried renaming the form (someone said Javascript may not...
3
4106
by: Seagull Ng | last post by:
Hello all, I am doing my web-based reporting tool in ASP.Net 2.0 using Visual Web Developer 2005. I try to export my populated gridview to Excel spreadsheet but what I got is just a blank spreadsheet with only <div></div> tag in the first cell. Can anyone tell me what actually is the problem? Thanks in advance.
3
3285
by: Simon Harvey | last post by:
Hi all, Can anyone tell me what the easiest way to achieve a collapsable panel area in a datagrid is? Do I need to find a third party panel control or does the datagrid/gridview somehow support this functionality inherently? Many thanks to anyone who can advise Simon
0
1283
by: Maarten | last post by:
Hi all, I have a datagrid (GridView) with questions where the user has to make a choice (yes or no questions) But for some questions there are rules, like if you choose (yes or no) for some questions I need to skip 1 or more questions. e.g. Q1. Do you..... Y | N
6
1367
by: InK_ | last post by:
Hi, All! I need to accomplish such functionality: A data row should be highlighted with the other color if cursor is over it. I also have the old code from asp which uses <tr onmouseover="colorrow(this,'#EEEEEE');" onmouseout="colorrow(this,'#FFFFFF');"> for every row of a table.
6
2326
by: GaryDean | last post by:
I liked the DataGrid because I was familiar in walking through it to do custom filling and retrieval of data in cases where standard binding wouldn't do the job. I read somewhere that the object model is the same for the datagrid and the gridview. But as I begin to try to manually load a gridview I notice that there is no such thing as a GridViewItem as there was a DataGridItem. So, it's not the same. Are there any articles or...
7
5382
by: GaryDean | last post by:
I'm trying to load a GridView up with data manually, in code. I'm not using any datasource. Using this code.... ArrayList myRowArrayList; GridViewRow myGVR = new GridViewRow(0,0,DataControlRowType.DataRow, DataControlRowState.Normal); TableCell myCell = new TableCell(); TextBox myTextbox = new TextBox(); myTextbox.Text = "hello world"; myCell.Controls.Add(myTextbox);
7
17319
by: =?Utf-8?B?cGF0cmlja2RyZA==?= | last post by:
Hi all! I have a gridview inside a datagrid (nested) for which (gridview) the rowcommand is not raised in order to delete a row from the grid! I also tried OnRowCommand="method", didn't work either! Does anyone know how can I make this work? Thanks in advance!
2
2116
by: Blasting Cap | last post by:
I've got a gridview (that I converted over from a datagrid, which had been working properly), that is doubling up the number of rows returned. When it was running as a datagrid, the same code sent back the proper number of rows. The only thing different I am doing is to display the number of rows returned in the footer of the gridview. The Bindgrid is as follows: Sub BindGrid() Session("reportlevel") = Session("availabilityrptlevel")
0
9617
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10254
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10099
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7451
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3607
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.