I know I must be doing something wrong here, but cannot figure out what it is.
Scenario:
I've got an ajaxified radGrid. It has a link button within one of the columns. I've added a conditionalpostback for this link button so when it fires it does a regular postback. but when the link button is pressed, the ItemCommand event gets fired twice for some reason. on clicking the linkbutton, i'm showing/hiding panels. Also, the grid exists within a user control, if that would make any difference.
any help is appreciated.
Scenario:
I've got an ajaxified radGrid. It has a link button within one of the columns. I've added a conditionalpostback for this link button so when it fires it does a regular postback. but when the link button is pressed, the ItemCommand event gets fired twice for some reason. on clicking the linkbutton, i'm showing/hiding panels. Also, the grid exists within a user control, if that would make any difference.
any help is appreciated.
| <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"> |
| <script type="text/javascript"> |
| function conditionalPostback(sender, eventArgs) { |
| debugger; |
| if (eventArgs.get_eventTarget().indexOf("lbtnViewInfo") > -1) { |
| eventArgs.set_enableAjax(false); |
| } |
| } |
| </script> |
| </telerik:RadScriptBlock> |
| <telerik:RadAjaxManager ID="ramSearch" runat="server"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="rgGrid"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="rgGrid" LoadingPanelID="RadAjaxLoadingPanel1" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| <ClientEvents OnRequestStart="conditionalPostback" /> |
| </telerik:RadAjaxManager> |
| <telerik:RadGrid ID="rgGrid" runat="server" Width="100%" ShowStatusBar="False" |
| AutoGenerateColumns="False" PageSize="10" EnableViewState="true" AllowSorting="True" AllowMultiRowSelection="False" AllowPaging="True" Visible="true"> |
| <MasterTableView Width="100%" DataKeyNames="IDNumber" AllowMultiColumnSorting="False"> |
| <NoRecordsTemplate><div class="noRecords">Your search criteria did not return any results, or you did not first select any criteria to search on.</div> |
| </NoRecordsTemplate> |
| <Columns> |
| <telerik:GridTemplateColumn UniqueName="FullName" SortExpression="FullName" HeaderText="Student Name" HeaderButtonType="TextButton" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Center"> |
| <ItemTemplate> |
| <asp:LinkButton ID="lbtnViewInfo" Font-Underline="true" runat="server" CausesValidation="false" CommandName="ViewInfo" Width="100%" Text='<%#Eval("FullName") %>' /> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| </telerik:GridBoundColumn> |
| </Columns> |
| </MasterTableView> |
| </telerik:RadGrid> |
| Private Sub rgGrid_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles rgGrid.ItemCommand |
| Select Case e.CommandName |
| Case "ViewInfo" |
| panelInfo.Visible = True |
| pnlsearch.Visible = False |
| pnlGrid.Visible = False |
| Case Else |
| Exit Sub |
| End Select |
| End Sub |
