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?
??