Hi, I have a radgrid which has radio buttons on the commanditemtemplate.
There are two issues with it.
1. On the pageload I cannot get the control by its name but I have to use document.getElementById with the client id. Don't know why.
2. Bigger issue is that the selection made on the radio buttons do not stick after postback.
If I move thse controls outside the grid, everything works fine though.
Appreciate your help.
Thanks,
Anil
There are two issues with it.
1. On the pageload I cannot get the control by its name but I have to use document.getElementById with the client id. Don't know why.
2. Bigger issue is that the selection made on the radio buttons do not stick after postback.
If I move thse controls outside the grid, everything works fine though.
Appreciate your help.
Thanks,
Anil
| <telerik:RadCodeBlock runat="server" ID="radCodeBlock"> |
| <script type="text/javascript"> |
| function pageLoad(sender, args) { |
| var radShowYes = document.getElementById('ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl02_ctl00_radShowHideYes'); |
| if (radShowYes.checked) |
| $find('<%=RadGrid1.ClientID %>').get_masterTableView().showFilterItem(); |
| else |
| $find('<%=RadGrid1.ClientID %>').get_masterTableView().hideFilterItem(); |
| } |
| function showFilterItem(){ |
| $find('<%=RadGrid1.ClientID %>').get_masterTableView().showFilterItem(); |
| } |
| function hideFilterItem(){ |
| $find('<%=RadGrid1.ClientID %>').get_masterTableView().hideFilterItem(); |
| } |
| </script> |
| </telerik:RadCodeBlock> |
| <telerik:RadGrid ID="RadGrid1" runat="server" Width="96%" GridLines="None" Skin="Vista"> |
| ... |
| <MasterTableView DataKeyNames="ReferralID" Width="100%" |
| CommandItemDisplay="Top" AllowFilteringByColumn="true" |
| AllowMultiColumnSorting="false" AlternatingItemStyle-BackColor="Beige"> |
| <CommandItemTemplate> |
| <div style="padding: 5px 5px;"> |
| |
| <asp:LinkButton ID="btnInitInsert" runat="server" CommandName="InitInsert" CausesValidation="false"> |
| <img style="border:0px;vertical-align:middle;" alt="" src="../Images/AddRecord.gif" />Add new Record |
| </asp:LinkButton> |
| Show filters <input id="radShowHideYes" type="radio" runat="server" name="showHideGroup" onclick="showFilterItem()" /> |
| <label for="radShowHideYes">Yes</label> |
| <input id="radShowHideNo" type="radio" runat="server" name="showHideGroup" checked="true" onclick="hideFilterItem()"/> |
| <label for="radShowHideNo">No</label> |
| Clear filters |
| <asp:ImageButton ID="btnShowAll" runat="server" ImageUrl="~/Images/CancelSmall.gif" OnClick="btnShowAll_Click" |
| Style="vertical-align: middle" /> |
| </div> |
| </CommandItemTemplate> |
| .......
<
ClientSettings>
<Scrolling AllowScroll="false" />
<ClientEvents OnFilterMenuShowing="filterMenuShowing" />
</ClientSettings>
<FilterMenu OnClientShown="MenuShowing" />
|