473,396 Members | 1,860 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,396 software developers and data experts.

Make cells in Table webcontrol 'clickable'?

I'm using a Table webcontrol to display a 'grid' to the user. Various cells
should be 'clickable' by the user (to run javascript). How can I make this
happen? (currently I use the background cell color to indicate to the user
which cells are clickable).

(I think I could achieve this by adding an image (with attached hyperlink)
to each clickable cell but since this is a large table (7 x 30) I think this
might be a slow solution).

Thanks,

Paul.
Nov 18 '05 #1
9 2705
Alternatively place a div inside the tablecell and you can handle the onclick
events.
HTH
srini

"Paul W" wrote:
I'm using a Table webcontrol to display a 'grid' to the user. Various cells
should be 'clickable' by the user (to run javascript). How can I make this
happen? (currently I use the background cell color to indicate to the user
which cells are clickable).

(I think I could achieve this by adding an image (with attached hyperlink)
to each clickable cell but since this is a large table (7 x 30) I think this
might be a slow solution).

Thanks,

Paul.

Nov 18 '05 #2
Thanks. So would I add the DIV by adding a Literal control to the tablecell
(which I'm familiar with)?
If so, what would actually be inside the DIV? - I don't want to display any
text in the cells. I tried the following but it didn't work:

<div> onclick="myfunc(1,1)"</div>

I don't believe there's a DIV web control - have I missed it?

Paul.

"srini" <sr***@discussions.microsoft.com> wrote in message
news:EC**********************************@microsof t.com...
Alternatively place a div inside the tablecell and you can handle the
onclick
events.
HTH
srini

"Paul W" wrote:
I'm using a Table webcontrol to display a 'grid' to the user. Various
cells
should be 'clickable' by the user (to run javascript). How can I make
this
happen? (currently I use the background cell color to indicate to the
user
which cells are clickable).

(I think I could achieve this by adding an image (with attached
hyperlink)
to each clickable cell but since this is a large table (7 x 30) I think
this
might be a slow solution).

Thanks,

Paul.

Nov 18 '05 #3
System.Web.UI.WebControls.Panel.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Paul W" <qq*@qqq.com> wrote in message
news:uq**************@TK2MSFTNGP14.phx.gbl...
Thanks. So would I add the DIV by adding a Literal control to the tablecell (which I'm familiar with)?
If so, what would actually be inside the DIV? - I don't want to display any text in the cells. I tried the following but it didn't work:

<div> onclick="myfunc(1,1)"</div>

I don't believe there's a DIV web control - have I missed it?

Paul.

"srini" <sr***@discussions.microsoft.com> wrote in message
news:EC**********************************@microsof t.com...
Alternatively place a div inside the tablecell and you can handle the
onclick
events.
HTH
srini

"Paul W" wrote:
I'm using a Table webcontrol to display a 'grid' to the user. Various
cells
should be 'clickable' by the user (to run javascript). How can I make
this
happen? (currently I use the background cell color to indicate to the
user
which cells are clickable).

(I think I could achieve this by adding an image (with attached
hyperlink)
to each clickable cell but since this is a large table (7 x 30) I think
this
might be a slow solution).

Thanks,

Paul.


Nov 18 '05 #4
On Fri, 1 Oct 2004 09:14:48 -0400, "Paul W" <qq*@qqq.com> wrote:
Thanks. So would I add the DIV by adding a Literal control to the tablecell
(which I'm familiar with)?
Yes.
If so, what would actually be inside the DIV? - I don't want to display any
text in the cells. I tried the following but it didn't work:

<div> onclick="myfunc(1,1)"</div>
No, it would need to look like this:
<div onClick="myfunc(1,1)"> ... </div>
I don't believe there's a DIV web control - have I missed it?
Not that I know of. I believe System.Web.UI.LiteralControl (as you
stated above) should get you what you want. Personally, I use
System.Web.UI.HtmlControls.HtmlGenericControl, but your way should
work as well.
Paul.

--
Thanks,
Chris Simmons
ne***************@netchris.com
Nov 18 '05 #5
I'm familiar with panels, but not sure exactly what you intend. Should I add
a panel control to the tablecell's control collection?
What exactly do I first put in the panel?

Thanks,

Paul.
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
System.Web.UI.WebControls.Panel.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Paul W" <qq*@qqq.com> wrote in message
news:uq**************@TK2MSFTNGP14.phx.gbl...
Thanks. So would I add the DIV by adding a Literal control to the

tablecell
(which I'm familiar with)?
If so, what would actually be inside the DIV? - I don't want to display

any
text in the cells. I tried the following but it didn't work:

<div> onclick="myfunc(1,1)"</div>

I don't believe there's a DIV web control - have I missed it?

Paul.

"srini" <sr***@discussions.microsoft.com> wrote in message
news:EC**********************************@microsof t.com...
> Alternatively place a div inside the tablecell and you can handle the
> onclick
> events.
> HTH
> srini
>
> "Paul W" wrote:
>
>> I'm using a Table webcontrol to display a 'grid' to the user. Various
>> cells
>> should be 'clickable' by the user (to run javascript). How can I make
>> this
>> happen? (currently I use the background cell color to indicate to the
>> user
>> which cells are clickable).
>>
>> (I think I could achieve this by adding an image (with attached
>> hyperlink)
>> to each clickable cell but since this is a large table (7 x 30) I
>> think
>> this
>> might be a slow solution).
>>
>> Thanks,
>>
>> Paul.
>>
>>
>>



Nov 18 '05 #6
add a client side onclick to the td/th (cell)

cell.Attributes.Add("onclick","doCilck(this);");

"Paul W" <qq*@qqq.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I'm using a Table webcontrol to display a 'grid' to the user. Various cells should be 'clickable' by the user (to run javascript). How can I make this
happen? (currently I use the background cell color to indicate to the user
which cells are clickable).

(I think I could achieve this by adding an image (with attached hyperlink)
to each clickable cell but since this is a large table (7 x 30) I think this might be a slow solution).

Thanks,

Paul.

Nov 18 '05 #7
Hi Paul,

You wer asking:
I don't believe there's a DIV web control - have I missed it?
A System.Web.UI.WebControls.Panel object renders a div on the client.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Paul W" <qq*@qqq.com> wrote in message
news:eY**************@TK2MSFTNGP12.phx.gbl...
I'm familiar with panels, but not sure exactly what you intend. Should I add a panel control to the tablecell's control collection?
What exactly do I first put in the panel?

Thanks,

Paul.
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
System.Web.UI.WebControls.Panel.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Paul W" <qq*@qqq.com> wrote in message
news:uq**************@TK2MSFTNGP14.phx.gbl...
Thanks. So would I add the DIV by adding a Literal control to the

tablecell
(which I'm familiar with)?
If so, what would actually be inside the DIV? - I don't want to display

any
text in the cells. I tried the following but it didn't work:

<div> onclick="myfunc(1,1)"</div>

I don't believe there's a DIV web control - have I missed it?

Paul.

"srini" <sr***@discussions.microsoft.com> wrote in message
news:EC**********************************@microsof t.com...
> Alternatively place a div inside the tablecell and you can handle the
> onclick
> events.
> HTH
> srini
>
> "Paul W" wrote:
>
>> I'm using a Table webcontrol to display a 'grid' to the user.

Various >> cells
>> should be 'clickable' by the user (to run javascript). How can I make >> this
>> happen? (currently I use the background cell color to indicate to the >> user
>> which cells are clickable).
>>
>> (I think I could achieve this by adding an image (with attached
>> hyperlink)
>> to each clickable cell but since this is a large table (7 x 30) I
>> think
>> this
>> might be a slow solution).
>>
>> Thanks,
>>
>> Paul.
>>
>>
>>



Nov 18 '05 #8
Wonderful. Thanks.

"bruce barker" <no***********@safeco.com> wrote in message
news:uB*************@tk2msftngp13.phx.gbl...
add a client side onclick to the td/th (cell)

cell.Attributes.Add("onclick","doCilck(this);");

"Paul W" <qq*@qqq.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I'm using a Table webcontrol to display a 'grid' to the user. Various

cells
should be 'clickable' by the user (to run javascript). How can I make
this
happen? (currently I use the background cell color to indicate to the
user
which cells are clickable).

(I think I could achieve this by adding an image (with attached
hyperlink)
to each clickable cell but since this is a large table (7 x 30) I think

this
might be a slow solution).

Thanks,

Paul.


Nov 18 '05 #9
Except not all browsers support client-side onclick events for a table
cell...
Nov 18 '05 #10

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

Similar topics

2
by: Sugapablo | last post by:
Can anyone help me out with some code to change three table cells (<td>) when one is hovered over? I have a calendar grid where each day is made up of three table cells and I want all three to...
1
by: sam | last post by:
Hi, I want to use style on the grids of table. Currently it use default style of the html table, in which the grid size appeared very thick. How can I change the "thick" style of the default...
3
by: Yeah | last post by:
Through CSS, is there a way to change the color of a table cell on a hover? By the way, the cell also contains a link - the text link and table cell mouseover should both be clickable to the link's...
6
by: Bill | last post by:
I am trying to figure out how to do page layouts using tables (obviously not my background). If I have, say, a 5x5 table defaulting to20px wide per cell, why can't I make the cell in, for example,...
5
by: ruca | last post by:
Hi, Can anyone give me examples of how can I hightlight cells of my datagrid? I know that I must use ItemBound event and probably JavaScript. The thing is that I have a anual calendar,...
3
by: wolfing1 | last post by:
In several of my pages I need to show an area with a background image and HTML text in certain places. The restrictions I have is that I can't use javascript or CSS positioning like 'float', so I...
3
by: xzzy | last post by:
I am stuck on how to make a screen whose fields are created at runtime so it can 'morf'' to meet the needs of the current situation. Using <table id="Table1" runat="server"> </table> and using...
0
by: sandysam | last post by:
Hi, I am new to ASP. I would like to get the database data on to my HTML form as table and make every row of that table clickable. I also would like to show the same data in a drop down box. When I...
3
by: chris f | last post by:
In my table (ASP.NET 2) that is dynamically generated I have a cell that initially will only display N rows of text and hide the rest. (This is so that the rows have a small height and I can...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.