| <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"> |
| </telerik:RadAjaxLoadingPanel> |
| <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="RadTabStrip1"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="RadTabStrip1" /> |
| <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| <telerik:AjaxSetting AjaxControlID="RadMultiPage1"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="RadAjaxLoadingPanel1" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManager> |
| <script type="text/javascript"> |
| function onTabSelecting(sender, args) { |
| var foo = args.get_tab(); |
| if (args.get_tab().get_pageViewID()) { |
| args.get_tab().set_postBack(false); |
| } |
| } |
| </script> |
| <telerik:RadTabStrip ID="RadTabStrip1" runat="server" SelectedIndex="0" |
| MultiPageID="RadMultiPage1" Orientation="HorizontalTop" |
| OnTabClick="RadTabStrip1_TabClick" OnClientTabSelecting="onTabSelecting"> |
| </telerik:RadTabStrip> |
| <telerik:RadMultiPage runat="server" ID="RadMultiPage1" SelectedIndex="0" |
| Height="250px" Width="475px" BorderWidth="1" OnPageViewCreated="RadMultiPage1_PageViewCreated"> |
| </telerik:RadMultiPage> |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| if (!Page.IsPostBack) |
| { |
| AddTab(RadTabStrip1, "Tab1"); |
| AddPageView(RadMultiPage1, RadTabStrip1.FindTabByText("Tab1")); |
| AddTab(RadTabStrip1, "Tab2"); |
| //AddPageView(RadMultiPage1, RadTabStrip1.FindTabByText("Tab2")); |
| AddTab(RadTabStrip1, "Tab3"); |
| //AddPageView(RadMultiPage1, RadTabStrip1.FindTabByText("Tab3")); |
| } |
| } |
| private void AddTab(RadTabStrip tabstrip, string tabName) |
| { |
| RadTab tab = new RadTab(); |
| tab.Text = tabName; |
| tabstrip.Tabs.Add(tab); |
| } |
| private void AddPageView(RadMultiPage multipage, RadTab tab) |
| { |
| RadPageView pageView = new RadPageView(); |
| pageView.ID = tab.Text; |
| multipage.PageViews.Add(pageView); |
| tab.PageViewID = pageView.ID; |
| } |
| protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e) |
| { |
| AddPageView(RadMultiPage1, e.Tab); |
| e.Tab.PageView.Selected = true; |
| } |
| protected void RadMultiPage1_PageViewCreated(object sender, RadMultiPageEventArgs e) |
| { |
| string userControlPath = "~/WebUserControl.ascx"; |
| Control userControl = Page.LoadControl(userControlPath); |
| if (e.PageView.ID == "Tab1") |
| { |
| userControl.ID = "UserControl1"; |
| } |
| else if (e.PageView.ID == "Tab2") |
| { |
| userControl.ID = "UserControl2"; |
| } |
| else if (e.PageView.ID == "Tab3") |
| { |
| userControl.ID = "UserControl3"; |
| } |
| e.PageView.Controls.Add(userControl); |
| } |
| <telerik:RadScheduler runat="server" ShowViewTabs="false" OverflowBehavior="Expand" ColumnWidth="250px" TimelineView-NumberOfSlots="30" ID="timeline" GroupBy="Type" GroupingDirection="Vertical" DataSourceID="timelineDataSource" SelectedView="TimelineView" DataKeyField="RegulatoryResultsId" DataStartField="CreatedOn" DataEndField="ReceiveOn" DataSubjectField="Description"> |
| <ResourceTypes> |
| <telerik:ResourceType KeyField="TypeId" Name="Type" TextField="TypeName" ForeignKeyField="TypeValue" |
| DataSourceID="timelineSectionSource" /> |
| </ResourceTypes> |
| </telerik:RadScheduler> |
| <telerik:radscriptmanager runat="server" ID="ScriptManager" EnablePageMethods="True"></telerik:radscriptmanager> |
| <telerik:radscriptblock runat="server" ID="radScriptBlock"> |
| <script type="text/javascript"> |
| function openCustomerLookupWindow() |
| { |
| var txtNo = $find("<%= txtExistingCustomerSearchCustomerNo.ClientID %>"); |
| var txtCoNam = $find("<%= txtExistingCustomerSearchCompanyName.ClientID %>"); |
| var txtCPN = $find("<%= txtExistingCustomerSearchContactPerson.ClientID %>"); |
| var txtCity = $find("<%= txtExistingCustomerSearchCity.ClientID %>"); |
| var cboState = $find("<%= cboExistingCustomerSearchState.ClientID %>"); |
| var oWnd = window.radopen('../../Lookups/NavCustomerLookup.aspx?navco=<%=session("SP_SearchCustomerNavCompany")%>&no=' + txtNo.get_value() + '&conam=' + txtCoNam.get_value() + '&cpn=' + txtCPN.get_value() + '&city=' + txtCity.get_value() + '&state=' + cboState.get_value() + '',"winCustomerLookup"); |
| //oWnd.argument = combo.get_value(); |
| oWnd.Center(); |
| //oWnd.SetSize(800,500); |
| } |
| function clientShow(sender, eventArgs) |
| { |
| //var txtDate = $find("<%= txtExistingCustomerSearchCustomerNo.ClientID %>"); |
| //sender.argument = txtDate.get_value; |
| //sender.argument = document.getElementById('<%=txtExistingCustomerSearchCustomerNo.ClientID%>').innerText; |
| } |
| function clientClose(oWnd,args) |
| { |
| var txtNo = $find("<%= txtExistingCustomerSearchCustomerNo.ClientID %>"); |
| var txtCoNam = $find("<%= txtExistingCustomerSearchCompanyName.ClientID %>"); |
| var txtCPN = $find("<%= txtExistingCustomerSearchContactPerson.ClientID %>"); |
| var txtCity = $find("<%= txtExistingCustomerSearchCity.ClientID %>"); |
| var cboState = $find("<%= cboExistingCustomerSearchState.ClientID %>"); |
| //get the transferred arguments |
| var arg = args.get_argument(); |
| if(arg) |
| { |
| var CustomerNo = arg.CustomerNo; |
| var CompanyName = arg.CompanyName; |
| var ContactPersonName = arg.ContactPersonName; |
| var CustomerCity = arg.CustomerCity; |
| var CustomerState = arg.CustomerState; |
| txtNo.set_value(CustomerNo); |
| txtCoNam.set_value(CompanyName); |
| txtCPN.set_value(ContactPersonName); |
| txtCity.set_value(CustomerCity); |
| cboState.set_value(CustomerState); |
| document.getElementById('pnlCustomerInfoCustomerData').style.display = 'none'; |
| } |
| document.forms[0].submit(); |
| } |
| </script> |
| </telerik:radscriptblock> |
| <telerik:radajaxpanel runat="server" LoadingPanelID="LoadingPanel" ID="AjaxPanel" Wrap="False" EnableAJAX="False"> |
| <asp:Panel ID="pnlCustomerInfoCustomerData" runat="server"></asp:Panel> |
| </telerik:RadAjaxPanel> |
From:
Date: 6/23/2010 4:08:49 AM
Hello Don,
Thank you for contacting us.
Could you please try to use regular asp UpdatePanel instead of RadAjaxManager in your User Control and verify if the issue still persists. Also please confirm that you are placing ScriptManager control in the very top of the main page for properly ajax functioning. You could refer to the following help topic which elaborate on RadAjax and UserControls:
http://www.telerik.com/help/aspnet-ajax/ajxusercontrols.html
Also please note that the purpose of the General Feedback type of tickets is for the customers to share their opinion of our products, support, help and etc. and provide suggestions for further improvements.
The support tickets and forums are used for submitting issues you faced with our controls.
Therefore, for further tracking the problem please start a formal support ticket or a forum thread and we will address your questions as necessary.
Best wishes,
Maria Ilieva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
From: logostech
Date: 6/21/2010 5:58:42 PM
I have a UserControl that is basically just an ASP button. The control works fine and I can use the OnClick event to access asp methods. The problem seems to be when I try to get it to work with a RadAjax Manager.
This is how I have it set up in the Manager:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="btnGenerate">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="txt_Text_Message"></telerik:AjaxUpdatedControl>
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
This is how the control is placed on the page:
<
btn:Button ID="btnGenerate" runat="server" OnClick="parseHTML_btn_Click" Text="Auto-Generate"
FontBold="true" Font="Arial" FontSize="11px" ToolTip="Auto Generate Text Message from HTML Message"
OnClientClick="return confirm('This will replace your current text.');" />
Here is the non-UserControl button I was using:
<asp:ImageButton ID="btnGenerateOld" runat="server" ImageUrl="Images/auto_generate_wide.gif" onclick="parseHTML_btn_Click" OnClientClick="return confirm('This will replace your current text.');" />
The btnGenerate works fine when it is not in the RadAjaxManager, but of course it does a full page postback. When it is in the manager it does not do anything.
The btnGenerateOld that I was using works in either the RadAjaxManager or as a full postback.
I have worked with this all day and have just gotten frustrated. Please help me out.
Thanks,
Don Buck
| <%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestUI1.aspx.cs" Inherits="TestUI1" %> |
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
| <!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>Untitled Page</title> |
| <style type="text/css"> |
| html, body, form |
| { |
| margin: 0; |
| padding: 0; |
| height: 100%; /* this is the key! */ |
| font-size: 11px; |
| } |
| #main_container |
| { |
| position: absolute; |
| left: 0; |
| top: 0; |
| padding: 0; |
| width: 100%; |
| height: 100%; /* works only if parent container is assigned a height value */ |
| color: #333; |
| background-color: #83b0ec; |
| background-image: url("images/navshape.jpg"); |
| background-repeat: repeat-x; |
| } |
| #sub_container |
| { |
| padding: 0px 10px 0px 10px; |
| } |
| #site_header |
| { |
| padding-left: 30px; |
| padding-top: 30px; |
| height: 80px; |
| } |
| .RadPanelBar_Windows7 .rpLink .rpText |
| { |
| font-weight:bold; |
| font-size:13px; |
| color:#003366; |
| } |
| </style> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <asp:ScriptManager ID="ScriptManager" runat="server" EnablePartialRendering="true" /> |
| <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" /> |
| <div id="main_container"> |
| <div id="sub_container"> |
| <div id="site_header"> |
| <asp:Image ID="Image1" runat="server" BorderWidth="0" ImageUrl="~/images/ClaimShare.gif" |
| AlternateText="Claim Share" /> |
| </div> |
| <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server"> |
| <telerik:RadPanelBar runat="server" ID="RadPanelBar1" Skin="Windows7" Width="100%" ExpandMode="multipleexpandeditems" Height="100%"> |
| <Items> |
| <telerik:RadPanelItem Text="Cases" Expanded="true" ImageUrl="~/images/icons/search.png" Width="100%" ChildGroupHeight="20%"> |
| <ItemTemplate> |
| <telerik:RadComboBox ID="RadComboBox1" runat="server" Height="150px" Width="100%" |
| EnableAutomaticLoadOnDemand="True" AutoPostBack="true" Skin="Outlook" EmptyMessage="Søg" |
| DataSourceID="ObjectDataSource1" ShowMoreResultsBox="true" DataTextField="CLLH_x0020_Claim_x0020_Number" |
| DataValueField="CLLH_x0020_Claim_x0020_Number"> |
| </telerik:RadComboBox> |
| </ItemTemplate> |
| </telerik:RadPanelItem> |
| <telerik:RadPanelItem Text="New Cases" Expanded="true" ImageUrl="~/images/icons/new.png" Width="100%" ChildGroupHeight="30%"> |
| <Items> |
| <telerik:RadPanelItem> |
| <ItemTemplate> |
| <telerik:RadGrid ID="rgNewCases" runat="server" AllowSorting="True" GridLines="None" |
| DataSourceID="odsNewCases" > |
| <MasterTableView AutoGenerateColumns="False" DataSourceID="odsNewCases" DataKeyNames="CLLH_x0020_Claim_x0020_Number" |
| Width="100%"> |
| <RowIndicatorColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </ExpandCollapseColumn> |
| <ItemStyle VerticalAlign="top" /> |
| <AlternatingItemStyle VerticalAlign="top" /> |
| <Columns> |
| <telerik:GridBoundColumn DataField="CLLH_x0020_Claim_x0020_Number" HeaderText="Cllh claim nr." |
| HeaderStyle-Wrap="false" SortExpression="CLLH_x0020_Claim_x0020_Number" UniqueName="CLLH_x0020_Claim_x0020_Number" |
| HeaderStyle-Width="30%"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="Client" HeaderText="Client" SortExpression="Client" |
| UniqueName="Client" HeaderStyle-Width="35%"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="Insured_x0020_Name" HeaderText="Insured" SortExpression="Insured_x0020_Name" |
| UniqueName="Insured_x0020_Name" HeaderStyle-Width="35%"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| </MasterTableView> |
| <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True" EnablePostBackOnRowClick="true"> |
| <Selecting AllowRowSelect="true" /> |
| <Scrolling AllowScroll="True" UseStaticHeaders="True" /> |
| </ClientSettings> |
| </telerik:RadGrid> |
| </ItemTemplate> |
| </telerik:RadPanelItem> |
| </Items> |
| </telerik:RadPanelItem> |
| <telerik:RadPanelItem Text="My followups" Expanded="true" ImageUrl="~/images/icons/followup.png" Width="100%" ChildGroupHeight="30%"> |
| <Items> |
| <telerik:RadPanelItem> |
| <ItemTemplate> |
| <telerik:RadGrid ID="rgFollowUps" runat="server" AllowSorting="True" GridLines="None" |
| DataSourceID="odsDSFollowups" > |
| <ClientSettings EnablePostBackOnRowClick="true"> |
| <Selecting AllowRowSelect="true" /> |
| </ClientSettings> |
| <MasterTableView AutoGenerateColumns="False" DataSourceID="odsDSFollowups" DataKeyNames="CLLHClaimNumber" |
| Width="100%"> |
| <RowIndicatorColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </ExpandCollapseColumn> |
| <ItemStyle VerticalAlign="top" /> |
| <AlternatingItemStyle VerticalAlign="top" /> |
| <Columns> |
| <telerik:GridBoundColumn DataField="CLLHClaimNumber" HeaderText="Cllh claim nr." |
| HeaderStyle-Wrap="false" SortExpression="CLLHClaimNumber" UniqueName="CLLHClaimNumber" |
| HeaderStyle-Width="30%"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="Client" HeaderText="Client" SortExpression="Client" |
| UniqueName="Client" HeaderStyle-Width="35%"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="InsuredName" HeaderText="Insured" SortExpression="InsuredName" |
| UniqueName="InsuredName" HeaderStyle-Width="35%"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| </MasterTableView> |
| <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True" EnablePostBackOnRowClick="true"> |
| <Selecting AllowRowSelect="true" /> |
| <Scrolling AllowScroll="True" UseStaticHeaders="True" /> |
| </ClientSettings> |
| </telerik:RadGrid> |
| </ItemTemplate> |
| </telerik:RadPanelItem> |
| </Items> |
| </telerik:RadPanelItem> |
| <telerik:RadPanelItem Text="My opened cases" Expanded="True" ImageUrl="~/images/icons/star.png" Width="100%" ChildGroupHeight="20%"> |
| <Items> |
| <telerik:RadPanelItem> |
| <ItemTemplate> |
| <telerik:RadGrid ID="rgMyOpenedCases" runat="server" AllowSorting="True" GridLines="None" |
| DataSourceID="odsMyOpenCases" > |
| <ClientSettings EnablePostBackOnRowClick="true"> |
| <Selecting AllowRowSelect="true" /> |
| </ClientSettings> |
| <MasterTableView AutoGenerateColumns="False" DataSourceID="odsMyOpenCases" DataKeyNames="CLLH_x0020_Claim_x0020_Number" |
| Width="100%"> |
| <RowIndicatorColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </ExpandCollapseColumn> |
| <ItemStyle VerticalAlign="top" /> |
| <AlternatingItemStyle VerticalAlign="top" /> |
| <Columns> |
| <telerik:GridBoundColumn DataField="CLLH_x0020_Claim_x0020_Number" HeaderText="Cllh claim nr." |
| HeaderStyle-Wrap="false" SortExpression="CLLH_x0020_Claim_x0020_Number" UniqueName="CLLH_x0020_Claim_x0020_Number" |
| HeaderStyle-Width="30%"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="Client" HeaderText="Client" SortExpression="Client" |
| UniqueName="Client" HeaderStyle-Width="35%"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="Insured_x0020_Name" HeaderText="Insured" SortExpression="Insured_x0020_Name" |
| UniqueName="Insured_x0020_Name" HeaderStyle-Width="35%"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| </MasterTableView> |
| <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True" EnablePostBackOnRowClick="true"> |
| <Selecting AllowRowSelect="true" /> |
| <Scrolling AllowScroll="True" UseStaticHeaders="True" /> |
| </ClientSettings> |
| </telerik:RadGrid> |
| </ItemTemplate> |
| </telerik:RadPanelItem> |
| </Items> |
| </telerik:RadPanelItem> |
| </Items> |
| </telerik:RadPanelBar> |
| </telerik:RadAjaxPanel> |
| <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetClaimsNumberList" TypeName="CLLH.TPA.WebCommon" /> |
| <asp:ObjectDataSource ID="odsNewCases" runat="server" SelectMethod="GetNewCases" TypeName="CLLH.TPA.WebCommon" /> |
| <asp:ObjectDataSource ID="odsDSFollowups" runat="server" SelectMethod="GetFollowups" TypeName="CLLH.TPA.WebCommon" /> |
| <asp:ObjectDataSource ID="odsMyOpenCases" runat="server" SelectMethod="GetMyOpenedCases" TypeName="CLLH.TPA.WebCommon" /> </div> |
| </div> |
| </form> |
| </body> |
| </html> |
Your quick response in this regard will be highly appreciated.

Hello All,
I have a DropDown box inside a FormView, I have and even fireing on the selected index changed, but when I try and assigning the selected value or selected item of the DropDownList to a variable I get the great error “Object reference not set to an instance of an object.”
My Code is attached
Form
| <table style="width: 100%;"> |
| <tr> |
| <td> |
| <telerik:RadGrid ID="StockAdjustmentsRadGrid" runat="server" |
| AllowPaging="True" |
| AllowSorting="True" |
| GridLines="None" |
| DataSourceID="objDsGetAllAdjustments"> |
| <MasterTableView AutoGenerateColumns="False" DataKeyNames="StockAdjustmentId" DataSourceID="objDsGetAllAdjustments"> |
| <Columns> |
| <telerik:GridBoundColumn DataField="StockAdjustmentId" DataType="System.Int32" HeaderText="Stock Adjustment Id" ReadOnly="True" SortExpression="StockAdjustmentId" UniqueName="StockAdjustmentId" /> |
| <telerik:GridBoundColumn DataField="ItemCode" HeaderText="Item Code" ReadOnly="True" SortExpression="ItemCode" UniqueName="ItemCode" /> |
| <telerik:GridBoundColumn DataField="PrintRoomName" HeaderText="Print Room" ReadOnly="True" SortExpression="PrintRoomName" UniqueName="PrintRoomName" /> |
| <telerik:GridBoundColumn DataField="Date" DataType="System.DateTime" HeaderText="Date" SortExpression="Date" UniqueName="Date" /> |
| <telerik:GridBoundColumn DataField="AdjustmentAmount" DataType="System.Decimal" HeaderText="AdjustmentAmount" SortExpression="AdjustmentAmount" UniqueName="AdjustmentAmount" /> |
| <telerik:GridBoundColumn DataField="AdjustmentReason" HeaderText="AdjustmentReason" SortExpression="AdjustmentReason" UniqueName="AdjustmentReason" /> |
| </Columns> |
| </MasterTableView> |
| <ClientSettings> |
| <Selecting AllowRowSelect="True" /> |
| </ClientSettings> |
| </telerik:RadGrid> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| <asp:FormView ID="StockAdjustmentFormView" runat="server" |
| DataKeyNames="StockAdjustmentId" |
| DataSourceID="objDsStockAdjustment" |
| DefaultMode="Insert" |
| Width="960px"> |
| <InsertItemTemplate> |
| <table style="width: 100%;"> |
| <tr> |
| <td class="MasterFilesLableCells"><asp:Label ID="ItemCodeLabel" runat="server" meta:resourcekey="ItemCodeLabel" /></td> |
| <td class="MasterFilesDataCells"> |
| <telerik:RadComboBox ID="ItemCodeRadComboBox" Runat="server" |
| DataSourceID="objDsItemNames" |
| DataTextField="ItemCode" |
| DataValueField="ItemId" |
| AppendDataBoundItems="True" |
| OnSelectedIndexChanged="ItemCodeRadComboBox_SelectedIndexChanged" |
| AutoPostBack="True" |
| CausesValidation="False"> |
| <Items> |
| <telerik:RadComboBoxItem runat="server" Selected="True" text="Select An Item" Value="-1" /> |
| </Items> |
| </telerik:RadComboBox> |
| </td> |
| </tr> |
| <tr> |
| <td class="MasterFilesLableCells"><asp:Label ID="PrintroomNamesLabel" runat="server" meta:resourcekey="PrintroomNamesLabel" /></td> |
| <td class="MasterFilesDataCells"><uc2:PrintroomNames ID="PrintroomNames1" runat="server" SelectedValue='<%# Bind("PrintRoomName") %>' /></td> |
| </tr> |
| <tr> |
| <td class="MasterFilesLableCells"><asp:Label ID="ItemCostLabel" runat="server" meta:resourcekey="ItemCostLabel" /></td> |
| <td class="MasterFilesDataCells"> |
| <asp:Label ID="LabelItemCost" runat="server" Text='<%# Bind("ItemCost") %>' /> |
| </td> |
| </tr> |
| <tr> |
| <td colspan="2"> |
| <asp:RadioButton ID="RadioButtonAdjustUp" runat="server" Text="Adjust Up" GroupName="AdjustDirection" Checked='<%# Bind("AdjustDirectionUp") %>' /> |
| <asp:RadioButton ID="RadioButtonAdjustDown" runat="server" Text="Adjust Down" GroupName="AdjustDirection" Checked='<%# Bind("AdjustDirectionDown") %>' /> |
| </td> |
| </tr> |
| <tr> |
| <td class="MasterFilesLableCells"><asp:Label ID="AdjustmentAmountLabel" runat="server" meta:resourcekey="AdjustmentAmountLabel" /></td> |
| <td><telerik:RadTextBox ID="AdjustmentAmountTextBox" runat="server" Text='<%# Bind("AdjustmentAmount") %>' Skin="Windows7" /></td> |
| </tr> |
| <tr> |
| <td class="MasterFilesLableCells"><asp:Label ID="AdjustmentDateLabel" runat="server" meta:resourcekey="AdjustmentDateLabel" /></td> |
| <td class="MasterFilesDataCells"> |
| <telerik:RadDatePicker ID="AdjustmentDateLabelRadDatePicker" runat="server" SelectedDate='<%# Bind("AdjustmentDate") %>' > |
| </telerik:RadDatePicker> |
| </td> |
| </tr> |
| <tr> |
| <td colspan="2"><asp:Label ID="AdjustmentReasonLabel" runat="server" meta:resourcekey="AdjustmentReasonLabel" /></td> |
| </tr> |
| <tr> |
| <td colspan="2"> |
| <telerik:RadTextBox ID="AdjustmentReasonTextBox" runat="server" Text='<%# Bind("AdjustmentReason") %>' Rows="5" Width="450" Height="50" TextMode="MultiLine" /> |
| </td> |
| </tr> |
| <tr> |
| <td><asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert" /></td> |
| <td align="right"><asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" /></td> |
| </tr> |
| </table> |
| </InsertItemTemplate> |
| <ItemTemplate> |
| <table style="width: 100%;"> |
| <tr> |
| <td class="MasterFilesLableCells"><asp:Label ID="ItemCodeLabel" runat="server" meta:resourcekey="ItemCodeLabel" /></td> |
| <td class="MasterFilesDataCells"><asp:Label ID="ItemNames1" runat="server" text='<%# Bind("ItemName") %>' /></td> |
| </tr> |
| <tr> |
| <td class="MasterFilesLableCells"><asp:Label ID="PrintroomNamesLabel" runat="server" meta:resourcekey="PrintroomNamesLabel" /></td> |
| <td class="MasterFilesDataCells"><asp:Label ID="PrintroomNames1" runat="server" text='<%# Bind("PrintName") %>' /></td> |
| </tr> |
| <tr> |
| <td class="MasterFilesLableCells"><asp:Label ID="ItemCostLabel" runat="server" meta:resourcekey="ItemCostLabel" /></td> |
| <td class="MasterFilesDataCells"><asp:Label ID="Label1" runat="server" Text='<%# Bind("ItemCost") %>' /></td> |
| </tr> |
| <tr> |
| <td colspan="2"> |
| <asp:RadioButton ID="RadioButtonAdjustUp" runat="server" Text="Adjust Up" Enabled="false" GroupName="AdjustDirection" Checked='<%# Bind("AdjustDirectionUp") %>' /> |
| <asp:RadioButton ID="RadioButtonAdjustDown" runat="server" Text="Adjust Down" Enabled="false" GroupName="AdjustDirection" Checked='<%# Bind("AdjustDirectionDown") %>' /> |
| </td> |
| </tr> |
| <tr> |
| <td class="MasterFilesLableCells"><asp:Label ID="AdjustmentAmountLabel" runat="server" meta:resourcekey="AdjustmentAmountLabel" /></td> |
| <td><telerik:RadTextBox ID="AdjustmentAmountTextBox" Enabled="false" runat="server" Text='<%# Bind("AdjustmentAmount") %>' Skin="Windows7" /></td> |
| </tr> |
| <tr> |
| <td class="MasterFilesLableCells"><asp:Label ID="AdjustmentDateLabel" runat="server" meta:resourcekey="AdjustmentDateLabel" /></td> |
| <td class="MasterFilesDataCells"><telerik:RadDatePicker Enabled="false" ID="AdjustmentDateLabelRadDatePicker" runat="server" Skin="Windows7" SelectedDate='<%# Bind("AdjustmentDate") %>' /></td> |
| </tr> |
| <tr> |
| <td colspan="2" class="MasterFilesLableCells"><asp:Label ID="AdjustmentReasonLabel" runat="server" meta:resourcekey="AdjustmentReasonLabel" /></td> |
| </tr> |
| <tr> |
| <td colspan="2" class="MasterFilesDataCells"> |
| <telerik:RadTextBox ID="AdjustmentReasonTextBox" runat="server" Text='<%# Bind("AdjustmentReason") %>' Skin="Windows7" Rows="5" Width="450" Height="50" TextMode="MultiLine" /> |
| </td> |
| </tr> |
| <tr> |
| <td><asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert" /></td> |
| <td align="right"><asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" /></td> |
| </tr> |
| </table> |
| </ItemTemplate> |
| </asp:FormView> |
| </td> |
| </tr> |
| </table> |
Code Behind
| Imports SBIS.FMSuite.Items.ItemMasterDAL |
| Partial Public Class StockAdjustment |
| Inherits System.Web.UI.Page |
| Protected Sub ItemCodeRadComboBox_SelectedIndexChanged(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) |
| Dim ItemId As String |
| Dim ItemCodeRadComboBox As Telerik.Web.UI.RadComboBox = CType(FindControl("ItemCodeRadComboBox"), Telerik.Web.UI.RadComboBox) |
| Dim LabelItemCost As Label = CType(FindControl("LabelItemCost"), Label) |
| If ItemCodeRadComboBox.SelectedValue.ToString IsNot Nothing Then |
| ItemId = ItemCodeRadComboBox.SelectedValue |
| Else |
| ItemId = 560 |
| End If |
| Dim ItemsAPI As New SBIS.FMSuite.Items.ItemMasterBLL |
| Dim Items As ItemsDataTable = ItemsAPI.GetItemsByItemID(ItemId) |
| Dim Item As SBIS.FMSuite.Items.ItemMasterDAL.ItemsRow = Items(0) |
| Try |
| If Item.CostingMethod = "Last cost price" Then |
| LabelItemCost.Text = Item.LastCostPrice |
| Else |
| LabelItemCost.Text = Item.AverageCostPrice |
| End If |
| Catch ex As Exception |
| LabelItemCost.Text = ex.Message.ToString |
| End Try |
| End Sub |
| End Class |
Thank you in advance