List Info

Thread: radioButton within an ItemTemplate question




radioButton within an ItemTemplate question
country flaguser name
United States
2007-03-28 16:40:20
Hello All,

I have a datagrid that contains an ItemTemplate, which
contains a
radioButton:

  <asp:templateColumn
         HeaderText="On Clock"
         ItemStyle-horizontalAlign="center"
         ItemStyle-width="60px">

       <itemtemplate>

        <asp:radioButton
           checked=<%#
container.dataItem("on_clock")%>
           CommandName="rbOn_clock"
           runat=server/>

        </itemTemplate>

      </asp:templateColumn>


What I want to do is fire an onItemCommand event when any of
the radio
buttons is checked.

Within the datagrid I've got:

   onItemCommand="dg_ItemCommand"

Here's my dg_ItemCommand:

'------------handle the on_clock click updates---------

sub dg_itemCommand(o as Object, e as
DataGridCommandEventArgs)

 if e.CommandName = "rbOn_clock" then

  'do something, for now just redirect to time.com

    response.redirect("http://www.time.com")

  end if

end sub


When I click on any radiobutton, nothing happens, the
dg_itemCommand doesn't
fire.

Any idea's?

Thanks for the insight,

Alan




        Alan Snyder
      CTO - Technology
      office: 847.227.8669
      cell: 847.809.0514
      alansnufrontiers.com
     Nu Frontiers Enterprises, Inc.
      344 Comstock Dr.
      Elgin, IL 60123
      "Top Solutions for Top Producers"




--- List Settings ---
http://aspadvice.com/list
s/


RE: radioButton within an ItemTemplate question
country flaguser name
United States
2007-03-28 16:27:47
At a guess since I can't see the entire form, I'd bet radio
button/datagrid isn't autoposting.

John Warner


> -----Original Message-----
> From: Alan Snyder [mailto:alansnufrontiers.com] 
> Sent: Wednesday, March 28, 2007 5:40 PM
> To: aspnetaspadvice.com
> Subject: [aspnet] radioButton within an ItemTemplate
question
> 
> 
> Hello All,
> 
> I have a datagrid that contains an ItemTemplate, which
contains a
> radioButton:
> 
>   <asp:templateColumn
>          HeaderText="On Clock"
>          ItemStyle-horizontalAlign="center"
>          ItemStyle-width="60px">
> 
>        <itemtemplate>
> 
>         <asp:radioButton
>            checked=<%#
container.dataItem("on_clock")%>
>            CommandName="rbOn_clock"
>            runat=server/>
> 
>         </itemTemplate>
> 
>       </asp:templateColumn>
> 
> 
> What I want to do is fire an onItemCommand event when
any of 
> the radio buttons is checked.
> 
> Within the datagrid I've got:
> 
>    onItemCommand="dg_ItemCommand"
> 
> Here's my dg_ItemCommand:
> 
> '------------handle the on_clock click
updates---------
> 
> sub dg_itemCommand(o as Object, e as
DataGridCommandEventArgs)
> 
>  if e.CommandName = "rbOn_clock" then
> 
>   'do something, for now just redirect to time.com
> 
>     response.redirect("http://www.time.com")
> 
>   end if
> 
> end sub
> 
> 
> When I click on any radiobutton, nothing happens, the 
> dg_itemCommand doesn't fire.
> 
> Any idea's?
> 
> Thanks for the insight,
> 
> Alan
> 
> 
> 
> 
>         Alan Snyder
>       CTO - Technology
>       office: 847.227.8669
>       cell: 847.809.0514
>       alansnufrontiers.com
>      Nu Frontiers Enterprises, Inc.
>       344 Comstock Dr.
>       Elgin, IL 60123
>       "Top Solutions for Top Producers"



--- List Settings ---
http://aspadvice.com/list
s/


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )