Hi,
I have two questions here.
I am using a RADGRID and when ME.LOADComplete event is happening I run a procedure which will filter the RAD Grid - roughly about 200 rows by default from the SQL View, it then goes down to about 20 results. The query takes less than 0 seconds to run on SQL Management studio. It takes about 1-2 seconds to display the page and filter the view.
In a different window, I am returning a view which has about 17,000 rows in it and takes about 4 seconds to run in SQL Management Studio but then it takes about 14 seconds to display and filter the page. It takes about 8 seconds to load without being filtered. Both RADGRIDs has the data source set in the ASPX page but I was wondering is there not a more efficient way to filter it first and then if the user changes the filter, it will apply accordingly? The number of results would be about 400 or so. I was thinking I need to use OnNeedDataSource and filter directly from SQL instead of the programmatically way of
rgCompanyTickets.MasterTableView.FilterExpression = strFilter
rgCompanyTickets.Rebind()
My other issue is that, in the RADGRID I have added a new column so the user can check the box and when the user presses a button on the screen, it displays a RadWindow which says enter comment and click a button so that it can update the db. The issue I am facing is that when the page gets loaded from the first button click is that it is removing the state the checkboxes are in. So when I press the 2nd button, it doesn't know what rows I have selected before the post back. I believe the reason why it is doing this is due to me using the rebind statement during the filter process.
Do you know guys have any solutions or ideas about this?
<telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn" AllowFiltering="False" > <ItemTemplate> <asp:CheckBox ID="CheckBox1" runat="server" /> </ItemTemplate> <HeaderTemplate> <asp:CheckBox ID="headerChkbox" runat="server" /> </HeaderTemplate> </telerik:GridTemplateColumn>
Thanks,
Alex
​<telerik:RadTextBox ID="rtbTelefon" MaxLength="50" Width="220px" EmptyMessage="Telefon" ToolTip="Telefon" runat="server" /><telerik:RadTextBox ID="rtbEpost" MaxLength="50" Width="230px" EmptyMessage="E-postadress" ToolTip="E-postadress" runat="server" /> <asp:CustomValidatorid="AtLeastOneContact" ClientValidationFunction="AtLeastOne_ClientValidate"Display="None" ErrorMessage="Telefon <b>eller</b> e-post krävs!" SetFocusOnError="True"runat="server" />function AtLeastOne_ClientValidate(source, args) { if (document.getElementById("<%= rtbTelefon.ClientID %>").value == "" && document.getElementById("<%= rtbEpost.ClientID %>").value == "") { args.IsValid = false; } else { args.IsValid = true; }}<asp:ObjectDataSource ID="ODSNotifications" runat="server" TypeName="NotificationsFacade" SelectMethod="Get" OnSelecting="ODSNotifications_Selecting" EnablePaging="true" SelectCountMethod="GetCount" StartRowIndexParameterName="StartIndex" MaximumRowsParameterName="ItemsCount"> <SelectParameters> <asp:Parameter Name="userId" Type="Int32" /> <asp:Parameter Name="fromDate" Type="DateTime" /> </SelectParameters> </asp:ObjectDataSource> <telerik:RadDropDownList ID="RDDLNotifications" runat="server" DataSourceID="ODSNotifications" CssClass="RDDLNotifications" DataValueField="Title" DataTextField="Id" OnItemDataBound="RDDLNotifications_ItemDataBound" DropDownWidth="200px" DropDownHeight="100px" EnableVirtualScrolling="true"> <ItemTemplate> <asp:Panel ID="PNotification" runat="server" CssClass="w_n_outer" onclick="StopPropagation(event);"> <div class="w_n_inner"> <asp:Label ID="LType" runat="server" Font-Size="0.8em" /> <br /> <asp:Label ID="LTitle" runat="server" Font-Bold="true" /> <br /> <asp:Label ID="LBody" runat="server" /> </div> </asp:Panel> </ItemTemplate> </telerik:RadDropDownList>
<telerik:GridButtonColumn FilterControlAltText="Filter Files column" CommandName="ShowFiles" UniqueName="Files" ButtonType="PushButton" HeaderText="Files" Exportable="False" Text="Display"></telerik:GridButtonColumn>Protected Sub RadGrid1_ItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand Dim value As String If e.CommandName = "ShowFiles" Then Dim dataItm As GridDataItem = TryCast(e.Item, GridDataItem) value = dataItm("Location").Text & "\03 Submitted\" Process.Start("explorer.exe", value) End IfEnd Sub<telerik:GridTemplateColumn UniqueName="LinkColumn"> <ItemTemplate> <asp:LinkButton runat="server" ID="LinkButton1" CommandName="ShowFiles"></asp:LinkButton> </ItemTemplate></telerik:GridTemplateColumn>Private Sub RadGrid1_ItemDataBound(sender As Object, e As GridItemEventArgs) Handles RadGrid1.ItemDataBound If TypeOf e.Item Is GridDataItem Then Dim item As GridDataItem = TryCast(e.Item, GridDataItem) Dim row As DataRow = TryCast(item.DataItem, DataRowView).Row Dim linkButton As LinkButton = TryCast(item("Location").FindControl("LinkButton1"), LinkButton) linkButton.Text = "Location" linkButton.PostBackUrl = "#" End IfEnd SubProtected Sub RadGrid1_ItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand Dim value As String If e.CommandName = "ShowFiles" Then Dim linkButton As LinkButton = TryCast(e.CommandSource, LinkButton) Dim dataItm As GridDataItem = TryCast(e.Item, GridDataItem) value = dataItm("Location").Text & "\03 Submitted\" Process.Start("explorer.exe", value) End IfEnd Sub