check box in the datagrid
-
hi, i have a checkbocxcolumn in the datagrid.. i need to select only one checkbox..and if he selects more than one checkbox...it has to show a message that .."select only one checkbox" how can i do this in asp.net
- declare one variable in Javascript 2) set it as 0 by default. 3) write the javascript code - if chk is checked then if thisvariable less than 1 then set this variable to 1 else thisvariable is 1 then show the alert("select only one checkbox") else // chk is unchecked set thisvariable to 1 4) Add this code in onclick (client-side) event of checkedbox
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
-
hi, i have a checkbocxcolumn in the datagrid.. i need to select only one checkbox..and if he selects more than one checkbox...it has to show a message that .."select only one checkbox" how can i do this in asp.net
beklo.com/rameshgoudd wrote:
i have a checkbocxcolumn in the datagrid.. i need to select only one checkbox..and if he selects more than one checkbox...it has to show a message that .."select only one checkbox"
Why don't you have a radio button in that column?
- Regards -
JON
Life is not measured by the amount of breaths we take, but by the moments that take our breath away.
-
beklo.com/rameshgoudd wrote:
i have a checkbocxcolumn in the datagrid.. i need to select only one checkbox..and if he selects more than one checkbox...it has to show a message that .."select only one checkbox"
Why don't you have a radio button in that column?
- Regards -
JON
Life is not measured by the amount of breaths we take, but by the moments that take our breath away.
Hi, in the gridview even if you put radio button then it will not solve problem. Bcoz in grdview it will vreate dynamically radiobutton. And you cant get result as you can get in simple radiobutton.
Thanks, Sun Rays To get something you must have to try once. My Articles
-
Hi, in the gridview even if you put radio button then it will not solve problem. Bcoz in grdview it will vreate dynamically radiobutton. And you cant get result as you can get in simple radiobutton.
Thanks, Sun Rays To get something you must have to try once. My Articles
Sun Rays wrote:
in the gridview even if you put radio button then it will not solve problem. Bcoz in grdview it will vreate dynamically radiobutton. And you cant get result as you can get in simple radiobutton.
But with small programming trick, you can do it.
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions
-
Hi, in the gridview even if you put radio button then it will not solve problem. Bcoz in grdview it will vreate dynamically radiobutton. And you cant get result as you can get in simple radiobutton.
Thanks, Sun Rays To get something you must have to try once. My Articles
Sun Rays wrote:
in the gridview
DataGrid
Sun Rays wrote:
if you put radio button then it will not solve problem
Did I tell that it will solve the problem? Have you ever seen in any web page having a list of check boxes in the same group, when user selects more than one prompting a message saying "don't select more than one". Don't that sort of design defeats the purpose of using Check boxes?
- Regards -
JON
Life is not measured by the amount of breaths we take, but by the moments that take our breath away.
-
Sun Rays wrote:
in the gridview
DataGrid
Sun Rays wrote:
if you put radio button then it will not solve problem
Did I tell that it will solve the problem? Have you ever seen in any web page having a list of check boxes in the same group, when user selects more than one prompting a message saying "don't select more than one". Don't that sort of design defeats the purpose of using Check boxes?
- Regards -
JON
Life is not measured by the amount of breaths we take, but by the moments that take our breath away.
Hi Guys, As I were said, in datagrid / gridview if putting radio button then that will be in templatefield. and if you know then its creating radiobutton at runtime for every row. So cant assign group in that radio button. So will you be with your radio button everytime ? :laugh: :laugh: :laugh: What now ? any doubt ?
Thanks, Sun Rays To get something you must have to try once. My Articles
-
Hi Guys, As I were said, in datagrid / gridview if putting radio button then that will be in templatefield. and if you know then its creating radiobutton at runtime for every row. So cant assign group in that radio button. So will you be with your radio button everytime ? :laugh: :laugh: :laugh: What now ? any doubt ?
Thanks, Sun Rays To get something you must have to try once. My Articles
I can understand that Using radio-button in a DataGrid will have the same effect as CheckBox. Will that be a problem if we write a JavaScript function to control the single selection of the radio-button list. There's another alternative too to sort this problem, by Adding a label and dynamically adding HTML input tag as Label Text with type as radio and runat server enabled and with the same group name. This works.
Sun Rays wrote:
So cant assign group in that radio button.
Try dynamically adding HTML Server Input Control with type radio and with the same group name.
Sun Rays wrote:
So will you be with your radio button everytime ?
Yes, when required.
- Regards -
JON
Life is not measured by the amount of breaths we take, but by the moments that take our breath away.
-
I can understand that Using radio-button in a DataGrid will have the same effect as CheckBox. Will that be a problem if we write a JavaScript function to control the single selection of the radio-button list. There's another alternative too to sort this problem, by Adding a label and dynamically adding HTML input tag as Label Text with type as radio and runat server enabled and with the same group name. This works.
Sun Rays wrote:
So cant assign group in that radio button.
Try dynamically adding HTML Server Input Control with type radio and with the same group name.
Sun Rays wrote:
So will you be with your radio button everytime ?
Yes, when required.
- Regards -
JON
Life is not measured by the amount of breaths we take, but by the moments that take our breath away.
Hi,
John Prabhu wrote:
Try dynamically adding HTML Server Input Control with type radio and with the same group name.
Have you tried for this ? Hope is works fine.... :)
Thanks, Sun Rays To get something you must have to try once. My Articles
-
Hi,
John Prabhu wrote:
Try dynamically adding HTML Server Input Control with type radio and with the same group name.
Have you tried for this ? Hope is works fine.... :)
Thanks, Sun Rays To get something you must have to try once. My Articles
Sun Rays wrote:
Have you tried for this ?
Yes, Radio-Button Column on a DataGrid is the first Design-Template which I coded few years ago...
- Regards -
JON
Life is not measured by the amount of breaths we take, but by the moments that take our breath away.
-
Sun Rays wrote:
Have you tried for this ?
Yes, Radio-Button Column on a DataGrid is the first Design-Template which I coded few years ago...
- Regards -
JON
Life is not measured by the amount of breaths we take, but by the moments that take our breath away.
Hello, I have tried all in V 2 but I didnt find ever that works like group...
Thanks, Sun Rays To get something you must have to try once. My Articles