tags:

views:

39

answers:

2

using data source we can show the data in web page. but i want that there is radio button with all rows and after accessing the radio button the given functionality works? how to do it please explain?

A: 

you need to be more clear with your question - if you already have some code then post it and then ask the how your code needs to do something specific

since the comment was amended

in ItemDataBound event

do something like (e.FindControl("controlname") as RadioButton).SelectedValue

im not quite sure if its c# or vb that you are writing in so cant be more specific at this time

PaulStack
This could have been a comment as it clearly doesn't answer what is asked here (whatever this is).
Darin Dimitrov
<columns> <asp:TemplateField> <ItemTemplate> <asp:radioButton id="rbtnSelect" runat="server" /> </ItemTemplate> </asp:TemplateField> </columns>
Using this code i add radio Button in all row now i want access the particular radio button.how to do it please tell me
please update your post instead of replying to the comment if you are adding some information about your question. your tag is in asp.net-mvc but your code is asp.net webform.
rob waminal
ok in that case you can do it via the ItemDataBound event of the grid
PaulStack
A: 

Based on your comment in the other answer I understand that you're actually using WebForms server controls with Asp.net MVC application.

Avoid mixing an matching Asp.net MVC with WebForms

Unless you're skilled in both platforms I suggest you avoid this. It will only bring you headaches in the long run. Displaying and consuming checkboxes/radiobuttons (or any List<T>) should be done differently in MVC. Check this questions (and answer) out that will help you out and show you how this can be done in pure MVC way.

It also explains what things to take care when you dynamically add these items on the client side using Javascript.

Robert Koritnik