473,799 Members | 2,822 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

row data clickable

Hi,
i'm stuck at the point where you click on the row (or button on the row, or
better yet just a link on the row)

and have it do something.

Something like msgbox("you clicked on this")

Am I supposed to use a datarepeater, a datadeleter, a gridrepeater a
viewgiredeleter Repeater

or what?
??

Feb 3 '06 #1
1 1290
Ashe (or is that Tod?),

Personally, I prefer to use the datagrid control for any data output that is
tabular, as it provides a great deal of controllable properties. For
example, by default it uses LinButtons when you add a button column. You can
specify custom columns (called Template Columns) that hold any of the other
types of control you have in your toolbox. Commonly these would be
checkboxes, etc.

Note that it might be a bit heavy-handed to use a datagrid for very simple
lists where little or no interaction is required. A DataList or Repeater
may better suit in this case.

If you use a datagrid, then you can trap user interaction events from the
grid by using its ItemCommand event handler.

Private Sub dgOuter_ItemCom mand(ByVal source As System.Object, ByVal e As
System.Web.UI.W ebControls.Data GridCommandEven tArgs) Handles
dgOuter.ItemCom mand
'Capture events from datagrid
Dim b As LinkButton
b = e.CommandSource
If b.Text = "Details" Then
'' <your specifics here>: code goes off to do something
me.lblMyMessage ToTheUser.Text = "You clicked row: " &
me.dgOuter.Sele ctedIndex.ToStr ing
End If
End Sub

This snippet assumes your grid has at least one button column, with the
displayed text of the button being "Details", and a label control (called
lblMyMessageToT heUser) somewhere else on your form.

Note though that you cannot make it directly pop up an alert (messagebox),
as the code is being executed on the cient side. However, you could have it
change the text in a label control, as I demonstrated in the above code
example.

The .NET approach does take a bit of getting used to - I think it took me
about 2 months to really stop thinking of the client-side events first.
This isn't intended as a flame - I still think of the odd occasion where a
"Classic" way of doing things would better suit the particular problem.
However, there are usually ways around it, for example adding custom
attributes that add client-side javascript behaviours. (These would fire
before the server side handlers).

While I certainly agree that the Framework approach frequently (always?)
generates more lines of code than older platforms, I have to say that the
results are a much more capable system.

It is worth persevering with!
Al

" Ashe Sjedic" <to*******@doug hpddu.com> wrote in message
news:wc******** ************@co mcast.com...
Hi,
i'm stuck at the point where you click on the row (or button on the row,
or better yet just a link on the row)

and have it do something.

Something like msgbox("you clicked on this")

Am I supposed to use a datarepeater, a datadeleter, a gridrepeater a
viewgiredeleter Repeater

or what?
??

Feb 4 '06 #2

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

Similar topics

53
4969
by: Kerberos | last post by:
I followed Dan Cederholm's image replacement tutorial, to replace a header tag by a logo. The h1 is clickable if no CSS is applied but it I replace it by the logo, the area isn't clickable anymore when I pass the mouse over the logo. Is there a way to replace a link by an image that will still be clickable? Thanks, -- Kerberos.
31
4159
by: Greg Scharlemann | last post by:
Given some recent success on a simple form validation (mainly due to the kind folks in this forum), I've tried to tackle something a bit more difficult. I'm pulling data down from a database and populating a simple table. I'd like the table to contain 10 entries per page and have the option for the user to scroll through the pages of data without having to go back to refresh the page (I've already pulled all the info I need from the...
9
2721
by: Paul W | last post by:
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). ...
7
2643
by: Jeff Gaines | last post by:
I have spent the day learning how to use Zend Development Environment. I can now produce a list of files in a directory, filtered by extension, and apparently clickable. Unfortunately clicking on them in a browser doesn't take me to the file link. I have found examples for clickable URL's, FTP links and mailto addresses but not files. I am managing to produce output like this: <a...
3
5573
by: crazychrisy54 | last post by:
Hi there I just wondered if there is any way using GD to insert a clickable button or some clickable text into a image? It is possible to create images for buttons but what if you want a clickable button *inside* another image. I don't know if this is along the right lines but the following code puts a image inside another image. Perhaps I could then make im2 clickable or is it just not possible? Any help would be very much
0
9689
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
9550
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10269
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
10248
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7573
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
6811
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();...
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2942
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.