PC Review


Reply
Thread Tools Rate Thread

How to add radio buttons into datagrid

 
 
=?Utf-8?B?TGkgUGFuZw==?=
Guest
Posts: n/a
 
      7th Dec 2005
Hi,

I want to know how to add radio buttons into a datagrid control.

Thanks
 
Reply With Quote
 
 
 
 
=?Utf-8?B?Sm91bmkgS2FycHBpbmVu?=
Guest
Posts: n/a
 
      7th Dec 2005
Hi

User TemplateColumn which contains CheckBox:
<asp:TemplateColumn>
<ItemTemplate>
<asp:CheckBox ID="Checkbox1" Runat="server" Checked='<%#
DataBinder.Eval(Container.DataItem, "[BOOL_VALUE_FIELD]") %>'
Enabled="False"/>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="chkMaksettu" Runat="server" Checked='<%#
DataBinder.Eval(Container.DataItem, "[BOOL_VALUE_FIELD]") %>'/>
</EditItemTemplate>

Instead of using DataBinder.Eval function to control CheckBox status, you
can do it in DataGrids OnItemDataBound event:
((CheckBox)e.Item.FindControl("CheckBox")).Checked = [true|false]

Hope this helps
-Joopa-
</asp:TemplateColumn>


"Li Pang" wrote:

> Hi,
>
> I want to know how to add radio buttons into a datagrid control.
>
> Thanks

 
Reply With Quote
 
 
 
 
=?Utf-8?B?Sm91bmkgS2FycHBpbmVu?=
Guest
Posts: n/a
 
      7th Dec 2005
Hello again

Maybe I also should read questions bit more carefully, you were asking about
radiobuttons NOT CHECKBOXES :-|
Sorry about that, my mistake.

-Joopa-


"Li Pang" wrote:

> Hi,
>
> I want to know how to add radio buttons into a datagrid control.
>
> Thanks

 
Reply With Quote
 
=?Utf-8?B?U2l2YSBN?=
Guest
Posts: n/a
 
      7th Dec 2005
Use template coloumns:

<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:RadioButton id="rb" Text='Caption' runat="server"/>
<ItemTemplate>
<TemplateColumn>
<Columns>

"Li Pang" wrote:

> Hi,
>
> I want to know how to add radio buttons into a datagrid control.
>
> Thanks

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET Reset Radio Button in a group of Radio Buttons Scott D Johnson Microsoft ASP .NET 1 27th Sep 2006 11:38 PM
Outlook 2007 - HTML radio buttons, submit buttons, text fields... =?Utf-8?B?bWlndWVsaXRvOTI4?= Microsoft Outlook Discussion 2 13th Sep 2006 08:20 PM
VBA: Disable Frame and Radio Buttons based on Another Radio Button Being True Mcasteel Microsoft Excel Worksheet Functions 2 29th Oct 2004 07:06 PM
Options Buttons, not Radio Buttons Bob Microsoft Access VBA Modules 1 29th Jul 2004 11:23 PM
How to add Radio buttons to datagrid David Kleyman Microsoft ASP .NET 2 14th Dec 2003 11:41 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:59 PM.