Protected Sub myRadGrid_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles myRadGrid.ItemDataBound If (TypeOf e.Item Is GridDataItem) Then Dim item As GridDataItem = CType(e.Item, GridDataItem) Dim options As DropDownList = DirectCast(item.FindControl("ddlModel"), DropDownList) Dim field As String = e.Item.Cells(5).Text.ToString.ToLower sql = "Select dm.intModelId, m.strmake + ' ' + dm.strModel Model from Drat_Model dm INNER JOIN Drat_Make m on m.intMakeId = dm.intMakeId Order by strModel" buildDD(sql, options) 'options.SelectedItem.Text = DirectCast(DataBinder.Eval(e.Item.DataItem, field).ToString(), String) End If End SubDataBinding: 'System.Data.DataRowView' does not contain a property with the name 'optiplex 760'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Web.HttpException: DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'optiplex 760'. Source Error: Line 95: Line 96: buildDD(sql, options) Line 97: options.SelectedItem.Text = DirectCast(DataBinder.Eval(e.Item.DataItem, field).ToString(), String) Line 98: End If Line 99: End Sub If Not IsPostBack Then rgWeightBreaks.MasterTableView.Columns(2).Visible = False rgWeightBreaks.MasterTableView.GroupByExpressions.Add(New Telerik.Web.UI.GridGroupByExpression(rgWeightBreaks.MasterTableView.Columns(2)))... <telerik:RadScriptManager ID="rsmWeightBreaks" runat="server" /> <telerik:RadSkinManager ID="rskmWeightBreaks" runat="server" ShowChooser="false" /> <telerik:RadScriptBlock runat="server" ID="rsbWeightBreaks"> <script type="text/javascript"> function onRequestStart(sender, args) { if (args.get_eventTarget().indexOf("rtbExport") >= 0) { args.set_enableAjax(false); bExporting = false; } } </script> </telerik:RadScriptBlock> <telerik:RadAjaxManager ID="ramWeightBreaks" runat="server" DefaultLoadingPanelID="ralpWeightBreaks" ClientEvents-OnRequestStart="onRequestStart" meta:resourcekey="ramWeightBreaksResource1"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="rgWeightBreaks"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="rgWeightBreaks" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="rtbWeightBreaks"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="rtbWeightBreaks" /> <telerik:AjaxUpdatedControl ControlID="rgWeightBreaks" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <telerik:RadAjaxLoadingPanel ID="ralpWeightBreaks" runat="server" meta:resourcekey="ralpWeightBreaksResource1"></telerik:RadAjaxLoadingPanel> <div style="width:800;"> <asp:Label ID="lblIntroText1" runat="server" Text="Thank you for the opportunity to quote your shipment, please click on the below gateway to view your rates." meta:resourcekey="lblIntroText1" /> <br /><br /> <asp:Label ID="lblIntroText2" runat="server" Text="The inland rates displayed below reflect the price per kilogram in US Dollars." meta:resourcekye="lblIntroText2" /> <br /><br /> <asp:Label ID="lblFuelSurchargeText1" runat="server" meta:resourcekey="lblFuelSurchargeText1"></asp:Label> <asp:Label ID="lblFuelSurchargeAmount" runat="server" /> <asp:Label ID="lblFuelSurchargeText2" runat="server" meta:resourcekey="lblFuelSurchargeText2" /> <br /><br /> <div> <asp:Label ID="lblTermsAndConditions" runat="server" meta:resourcekey="lblTermsAndConditionsResource" Text="All quotes are subject to the " /> <asp:HyperLink ID="hlTermsAndConditions" runat="server" meta:resourcekey="hlTermsAndConditionsResource" NavigateUrl="#" Text="Terms & Conditions" /> </div> <br /> </div> <telerik:RadTabStrip ID="rtsWeightBreaks" runat="server" Width="802px" meta:resourcekey="rtsWeightBreaksResource1" SelectedIndex="0"> <Tabs> <telerik:RadTab runat="server" Text="US Exports - Inland Rates" Selected="true" meta:resourcekey="RadTabResource1"></telerik:RadTab> <telerik:RadTab runat="server" Text="US Imports - Inland Rates" Selected="true" meta:resourcekey="RadTabResource2"></telerik:RadTab> </Tabs> </telerik:RadTabStrip> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td> <telerik:RadToolBar ID="rtbWeightBreaks" runat="server" OnButtonClick="rtbWeightBreaks_ButtonClick" meta:resourcekey="rtbWeightBreaksResource1"> <Items> <telerik:RadToolBarButton Text="Gateway View" CommandName="GatewayView" runat="server" Enabled="false" meta:resourcekey="RadToolBarButtonResource1"></telerik:RadToolBarButton> <telerik:RadToolBarButton Text="Airport View" CommandName="AirportView" runat="server" meta:resourcekey="RadToolBarButtonResource2"></telerik:RadToolBarButton> </Items> </telerik:RadToolBar> </td> <td> <telerik:RadToolBar ID="rtbExport" runat="server" OnButtonClick="rtbWeightBreaks_ButtonClick" meta:resourcekey="rtbExportResource1"> <Items> <telerik:RadToolBarButton Text="Export To Excel" CommandName="ExportToExcel" runat="server" meta:resourcekey="RadToolBarButtonResource3"></telerik:RadToolBarButton> </Items> </telerik:RadToolBar> </td> </tr> </table> <telerik:RadGrid ID="rgWeightBreaks" runat="server" Width="800px" CellSpacing="0" GridLines="None" meta:resourcekey="rgWeightBreaksResource1"> <MasterTableView AutoGenerateColumns="false" GroupsDefaultExpanded="false" GroupLoadMode="Client" DataKeyNames="OriginAirport, DestinationAirport, TariffNumber" ClientDataKeyNames="OriginAirport, DestinationAirport, TariffNumber" UseAllDataFields="true" EnableHeaderContextMenu="true" AllowFilteringByColumn="true"> <Columns> <telerik:GridBoundColumn HeaderText="Origin City" DataField="OrgAirportCity" HeaderStyle-Width="200px" ItemStyle-Width="200px" AllowFiltering="true" meta:resourcekey="GridBoundColumnResource1"> </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderText="Airport" DataField="OriginAirport" HeaderStyle-Width="50px" ItemStyle-Width="50px" AllowFiltering="true" FilterControlWidth="35px" ShowFilterIcon="false" AutoPostBackOnFilter="true" meta:resourcekey="GridBoundColumnResource2"> </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderText="To Gateway" DataField="DestAirportCity" HeaderStyle-Width="175px" ItemStyle-Width="175px" UniqueName="OriginCity" Groupable="true" AllowFiltering="true" meta:resourcekey="GridBoundColumnResource3"> </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderText="Transit Days" DataField="TransitDays" HeaderStyle-Width="50px" HeaderStyle-HorizontalAlign="Right" ItemStyle-Width="50px" ItemStyle-HorizontalAlign="Right" AllowFiltering="false" meta:resourcekey="GridBoundColumnResource4"> </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderText="Minimum Charge" DataField="MinimumCharge" DataFormatString="{0:C}" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" AllowFiltering="false" meta:resourcekey="GridBoundColumnResource5"> </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderText="45 kgs<br/>(100 LBS)" DataField="BreakOne" DataFormatString="{0:C}" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" AllowFiltering="false" meta:resourcekey="GridBoundColumnResource6"> </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderText="225 kgs<br/>(500 LBS)" DataField="BreakTwo" DataFormatString="{0:C}" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" AllowFiltering="false" meta:resourcekey="GridBoundColumnResource7"> </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderText="450 kgs<br/>(1000 LBS)" DataField="BreakThree" DataFormatString="{0:C}" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" AllowFiltering="false" meta:resourcekey="GridBoundColumnResource8"> </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderText="1350 kgs<br/>(3000 LBS)" DataField="BreakFour" DataFormatString="{0:C}" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" AllowFiltering="false" meta:resourcekey="GridBoundColumnResource9"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="CityAirport" HeaderText="From Airport" UniqueName="CityAirport" Groupable="true" meta:resourcekey="GridBoundColumnResource10" Display="false"> </telerik:GridBoundColumn> </Columns> <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="false" /> </MasterTableView> <GroupingSettings ShowUnGroupButton="true" /> <ClientSettings AllowExpandCollapse="true" EnableRowHoverStyle="true" AllowDragToGroup="true"> <Selecting AllowRowSelect="true" /> <Scrolling UseStaticHeaders="true" AllowScroll="true" ScrollHeight="500px"/> <Resizing AllowColumnResize="true" /> </ClientSettings> <ExportSettings OpenInNewWindow="true" ExportOnlyData="true"> <Excel Format="ExcelML" /> </ExportSettings> </telerik:RadGrid> <telerik:RadToolTip ID="rttTermsAndConditions" runat="server" TargetControlID="hlTermsAndConditions" RelativeTo="Element" Title="Terms And Conditions" Width="700px" Animation="Slide" HideEvent="LeaveTargetAndToolTip" meta:resourcekey="rttTermsAndConditionsResource"> <div style="margin:10px"> <ol>...<telerik:RadTextBox runat="server" ID="configData" TextMode="MultiLine" Width="100%" Height="300px"/><classes>
<class name="Clear Class" value="" />
<class name="Dropdown List" value="dl.list" />
<class name="Ordered List" value="ol.list" />
<class name="Ordered List (Steps)" value="ol.steps" />
<class name="Unordered List" value="ul.list" />
</classes>
This is the CSS
ul.list,
ol.list { margin-left: 1.5em; }
ul.list li,
ol.list li { margin-bottom: 0.5em; }
ul.list { list-style-type: disc; }
ol.list { list-style-type: decimal; }
ol.list ol.list { list-style-type: lower-alpha; }
dl.list dt { background: url(images/bullet.png) 0 7px no-repeat; padding-left: 10px; font-weight: bold; }
dl.list dd { padding-left: 10px; margin-bottom: 1em; }
ol.steps {
list-style-type: none;
}
ol.steps li { padding-left: 55px; margin-bottom: 0.5em; }
ol.steps li:nth-child(1) { background: url(images/olsteps-1.gif) 0 0 no-repeat; }
ol.steps li:nth-child(2) { background: url(images/olsteps-2.gif) 0 0 no-repeat; }
ol.steps li:nth-child(3) { background: url(images/olsteps-3.gif) 0 0 no-repeat; }
ol.steps li:nth-child(4) { background: url(images/olsteps-4.gif) 0 0 no-repeat; }
ol.steps li:nth-child(5) { background: url(images/olsteps-5.gif) 0 0 no-repeat; }
ol.steps li:nth-child(6) { background: url(images/olsteps-6.gif) 0 0 no-repeat; }
ol.steps li:nth-child(7) { background: url(images/olsteps-7.gif) 0 0 no-repeat; }
ol.steps li:nth-child(8) { background: url(images/olsteps-8.gif) 0 0 no-repeat; }
ol.steps li:nth-child(9) { background: url(images/olsteps-9.gif) 0 0 no-repeat; }
ol.steps li:nth-child(10) { background: url(images/olsteps-10.gif) 0 0 no-repeat; }
ol.steps li:nth-child(11) { background: url(images/olsteps-11.gif) 0 0 no-repeat; }
ol.steps li:nth-child(12) { background: url(images/olsteps-12.gif) 0 0 no-repeat; }
#navbar ul.list,
#content-list ul.list { margin: 0; list-style-type: none; }
#navbar ul.list li,
#content-list ul.list li { background: url(images/bullet.png) 0 7px no-repeat; margin: 0; padding-left: 10px; }
Yesterday, I upgraded our C# ASP.NET solution from .NET 2.0 to .NET 4.0. Other things work fine. But all auto postbacks are suppressed after that.
Our telerik controls are kind of out dated. But because of project timeline, we don’t have time to upgrade our telerik controls for now. I just checked, our RadAjax.Net2 runtime version is v2.0.50727. Out Telerik.Web.UI runtime version is also v2.0.50727.
The following is the code. As you can see with my comments, the drop down list inside the RadAjaxPanel does Not do postback after I select a different value in the list. But the drop down list outside of the RadAjaxPanel works fine.
And this problem is not just for drop down list. It’s for other controls such as radio button DateTimePicker etc. But our buttons are working fine. So it looks like it's the autoposts are suppressed.
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Position.ascx.cs" Inherits="Oaccac.WebPmi.Controls.Position" %>
<%@ Register TagPrefix="rad" Namespace="Telerik.WebControls" Assembly="RadAjax.Net2" %>
<%@ Register Src="~/Controls/TelerikAjax/LoadingPanelContent.ascx" TagPrefix="uc" TagName="LoadingPanelContent" %>
<rad:RadAjaxPanel ID="ajaxServiceOfferPanel" LoadingPanelID="ajaxServiceOfferLoadingPanel" runat="server" UseEmbeddedScripts="true" EnableOutsideScripts="true">
<!--This DropDownList does Not do post back.-->
<asp:DropDownList ID="ddlTest" runat="server" AutoPostBack="true">
<asp:ListItem>One</asp:ListItem>
<asp:ListItem>Two</asp:ListItem>
</asp:DropDownList>
</rad:RadAjaxPanel>
<!--This DropDownList does post back.-->
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="true">
<asp:ListItem>Three</asp:ListItem>
<asp:ListItem>Four</asp:ListItem>
</asp:DropDownList>
<rad:AjaxLoadingPanel ID="ajaxServiceOfferLoadingPanel" runat="server" InitialDelayTime="0">
<uc:LoadingPanelContent ID="loadingServiceOfferPanelContent" runat="server" />
</rad:AjaxLoadingPanel>