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"
>
<html xmlns=
"http://www.w3.org/1999/xhtml"
>
<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.