This is a migrated thread and some comments may be shown as answers.

Clicking on ReportViewer after selecting check boxes from RadComboBox does not cause a post back if the report is in a control.

1 Answer 20 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Erik
Top achievements
Rank 1
Erik asked on 14 Nov 2013, 05:47 AM

Clicking on ReportViewer after selecting check boxes from RadComboBox does not cause a post back if the report is in a control.

How can I make a RadComboBox cause post back when click in the report area, but only if something actually has changed in the RadComboBox?



I have 1 control with multiple rad combox with post back set to true.

I have another control with a ReportViewer.

If the reports isn’t loaded the post back works, but if a report is loaded there is no post back caused by the RadComboBox selecting in to the report viewer AREA.



Test.aspx



Partial Class test
    Inherits System.Web.UI.Page
    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        Alert.Show("Changed")
    End Sub
End Class


test.aspx



<%@ Page Language="VB" AutoEventWireup="false" CodeFile="test.aspx.vb" Inherits="test" %>
 
<%@ Register src="Options/MYfilters.ascx" tagname="MYfilters" tagprefix="uc1" %>
<%@ Register src="Options/MYReport.ascx" tagname="MYReport" tagprefix="uc2" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <table style="width: 100%;">
            <tr>
                <td>
   
                    <uc1:MYfilters ID="MYfilters1" runat="server" />
   
                </td>
            </tr>
        </table>
          <table style="width: 100%;">
            <tr>
                <td>
   
                    <uc2:MYReport ID="MYReport1" runat="server" />
   
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>


Myfilters.ascx.vb





<%@ Control Language="VB" AutoEventWireup="false" CodeFile="MYfilters.ascx.vb" Inherits="Options_MYfilters" %>
<telerik:RadComboBox ID="Company_ComboBox" runat="server" AutoPostBack="True" CheckBoxes="True"
    EnableCheckAllItemsCheckBox="True" MaxHeight="500px">
    <Items>
        <telerik:RadComboBoxItem runat="server" Text="Company_1" Value="Company_1" Checked="True" />
        <telerik:RadComboBoxItem runat="server" Text="Company_2" Value="Company_2" />
        <telerik:RadComboBoxItem runat="server" Text="Company_3" Value="Company_3" />
    </Items>
    <Localization AllItemsCheckedString="All Companies Selected" ItemsCheckedString="Select All Companies" />
</telerik:RadComboBox>




MyReport.ascx.vb



<%@ Control Language="VB" AutoEventWireup="false" CodeFile="MYReport.ascx.vb" Inherits="Options_MYReport" %>
<%@ Register Assembly="Telerik.ReportViewer.WebForms" Namespace="Telerik.ReportViewer.WebForms"
    TagPrefix="telerik" %>
<telerik:ReportViewer ID="ReportViewer1" runat="server" Style="border: 1px solid #ccc;"
    Width="100%" Height="950px">
 
</telerik:ReportViewer>




MyReport.ascx.vb



Imports Telerik.Reporting
Imports Telerik.Web.UI
 
Partial Class Options_MYReport
    Inherits System.Web.UI.UserControl
 
    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
 
        Dim reportType As Type = Type.[GetType]("CompanyQuarterlySales, ReportsClassLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null")
        Dim TheReport As IReportDocument = DirectCast(Activator.CreateInstance(reportType), IReportDocument)
        Dim instanceReportSource As New Telerik.Reporting.InstanceReportSource()
        instanceReportSource.ReportDocument = TheReport
        Me.ReportViewer1.ReportSource = instanceReportSource
 
        Me.Page.Title = "Quartely - " + reportType.Name
        Dim report As Telerik.Reporting.Report = DirectCast(instanceReportSource.ReportDocument, Telerik.Reporting.Report)
 
        report.ReportParameters("Top").Value = "10"
        report.ReportParameters("CompID").Value = "13"
        report.ReportParameters("Country").Value = "*"
        report.ReportParameters("OpCo").Value = "*"
        report.ReportParameters("Department").Value = "*"
        report.ReportParameters("Site").Value = "*"
        report.ReportParameters("StartDate").Value = "2013"
 
        Me.ReportViewer1.RefreshReport()
    End Sub
End Class

Attached is an image of what is happening.







1 Answer, 1 is accepted

Sort by
0
KS
Top achievements
Rank 1
answered on 18 Nov 2013, 07:00 PM
Hi Erik,

The report is within an iframe and the focus cannot be moved from the container to the iframe content. Click above the toolbar or anywhere beside the report, and the combo will lose the focus, then postback :) The iframe is autogenrated and injecting scripts or etc hacks to catch the keydown are not good idea.

-KS
Tags
General Discussions
Asked by
Erik
Top achievements
Rank 1
Answers by
KS
Top achievements
Rank 1
Share this question
or