Hi all:
I have a web application where I need the RadGrid to populate with data based on a selection from a DropDown list box. The grid also needs to have paging so I followed the samples on the Telerik site and used OnNeedDataSource to enable the paging. The issue is that when I make a selection from the drop down list, the OnNeedDataSource is called twice, and it doesn't even read the correct value from the drop-down, it always returns 0 as the Selected Index.
I think it has something to do with the OnNeedDataSource being called as part of page load, and so the postback from the drop-down fires the method, but I don’t understand why it runs twice.
Has anyone had any experience with this and know how I can fix this? OR can anyone make a suggestion for a better idea? The selections in the drop-down are dynamic and loaded at run-time, and then what is selected from the drop-down determines what data loads in the RadGrid.
Thanks.
John.
| <telerik:RadToolBar ID="RadToolBar1" runat="server" |
| style="display:block; float: none" CssClass="SeparatedButtons" |
| Skin="MyToolbarSkin" EnableEmbeddedSkins="False" |
| onbuttonclick="RadToolBar1_ButtonClick" OnClientButtonClicked="HandleExport"> |
| <CollapseAnimation Duration="200" Type="OutQuint" /> |
| <Items> |
| <telerik:RadToolBarButton runat="server" CommandName="LIJST.REFRESH" ImageUrl="../Pics/refresh.png" Text="Refresh" Value="REFRESH" ></telerik:RadToolBarButton> |
| <telerik:RadToolBarButton runat="server" CommandName="LIJST.FILTER" ImageUrl="../Pics/filter.png" Text="Filter" Value="FILTER" ></telerik:RadToolBarButton> |
| <telerik:RadToolBarButton runat="server" Value="rtbbSearch" CssClass="rightAligned" PostBack="False" > |
| <ItemTemplate> |
| <asp:Panel runat="server" ID="pnlSearchBlok" DefaultButton="cmdSearchTB" > |
| <table align="right" > |
| <tr valign="top"> |
| <td> |
| <asp:Label ID="lblZoekenOp" runat="server" Text="Zoeken op" CssClass="DHStandard"></asp:Label> |
| </td> |
| <td> |
| <asp:DropDownList ID="cboSearchFieldsTB" runat="server" CssClass="DHStandard"> |
| </asp:DropDownList> |
| </td> |
| <td> |
| <asp:DropDownList ID="cboSearchOperatorsTB" runat="server" Width="90px" CssClass="DHStandard"> |
| </asp:DropDownList> |
| </td> |
| <td> |
| <asp:TextBox ID="txtSearchValueTB" runat="server" CssClass="DHStandard"></asp:TextBox> |
| </td> |
| <td> |
| <asp:ImageButton ID="cmdSearchTB" runat="server" ImageUrl="../Pics/search2.png" CommandName="SEARCH" onclick="cmdSearchTB_Click" /> |
| </td> |
| <td> |
| <asp:CheckBox ID="cbAlterateView" runat="server" oncheckedchanged="cbAlternatief_CheckedChanged" AutoPostBack="true"/> |
| </td> |
| </tr> |
| </table> |
| </asp:Panel> |
| </ItemTemplate> |
| </telerik:RadToolBarButton> |
| </Items> |
| </telerik:RadToolBar> |
RadScheduler1_AppointmentInsert(
object sender, SchedulerCancelEventArgs e)
doesnt seem to allow me access anythjing othere than the apppointment information.
| <Telerik:RadPane runat="Server" ID="leftPane" Scrolling="None"> |
| <div style="padding:10px 0px 10px 10px;"> |
| <Telerik:RadScheduler Culture="en-GB" runat="server" ID="RadScheduler1" Skin="Office2007" EnableEmbeddedSkins="True" |
| ShowFooter="true" DayStartTime="08:00:00" DayEndTime="21:00:00" |
| TimeZoneOffset="00:00:00" OverflowBehavior="Expand" SelectedView="MonthView" Height="100%" |
| TimelineView-UserSelectable="false" OnNavigationComplete="RadScheduler1_NavigationComplete" |
| OnAppointmentDelete="RadScheduler1_AppointmentDelete" |
| OnAppointmentUpdate="RadScheduler1_AppointmentUpdate" OnAppointmentInsert="RadScheduler1_AppointmentInsert" |
| FirstDayOfWeek="Monday" LastDayOfWeek="Friday" CustomAttributeNames="customTitle" OnClientAppointmentEditing="OnClientAppointmentEditing" |
| OnClientAppointmentMoveStart="OnClientAppointmentMoveStart" ShowAllDayRow="true" OnFormCreated="RadScheduler1_FormCreated" |
| MinimumInlineFormWidth="300" MinimumInlineFormHeight="150"> |
| <AppointmentTemplate> |
| <asp:Label ID="lblTitle" runat="server"><%# Eval("customTitle") %></asp:Label> |
| </AppointmentTemplate> |
| <InlineInsertTemplate> |
| <div id="InlineInsertTemplate"> |
| <table width="100%"> |
| <tr> |
| <td align="right">Note</td> |
| <td> |
| <asp:TextBox ID="txtboxNote" runat="server" TextMode="MultiLine" Width="100%" Height="50px"></asp:TextBox> |
| </td> |
| </tr> |
| <tr> |
| <td align="right">Appointment Type</td> |
| <td> |
| <asp:DropDownList ID="ddlCalendarTypes" runat="server"></asp:DropDownList> |
| </td> |
| </tr> |
| <tr> |
| <td colspan="2" align="right"> |
| <table> |
| <tr> |
| <td> |
| <asp:LinkButton ID="InsertButton" runat="server" CommandName="Insert" > |
| <asp:Image runat="server" ID="imgInsert" ImageUrl="Images/ok.gif" AlternateText="insert" /> |
| </asp:LinkButton> |
| </td> |
| <td> </td> |
| <td> |
| <asp:LinkButton ID="CancelButton" runat="server" CausesValidation="False" CommandName="Cancel"> |
| <asp:Image runat="server" ID="imgCancel" ImageUrl="Images/cancel.gif" AlternateText="cancel" /> |
| </asp:LinkButton> |
| </td> |
| </tr> |
| </table> |
| </td> |
| </tr> |
| </table> |
| </div> |
| </InlineInsertTemplate> |
| </Telerik:RadScheduler> |
| </div> |
| </Telerik:RadPane> |