Hi, I am using Tekerik:RadGrid and I have columns as Quantity, UnitPrice and TotalPrice.
I provide Textboxes to enter Quantity and Unit Price and upon these entry, immediately TotalPrice Label should be calculated as quantity * Unit Price.
Now, I also display the total of all the Total Price in a different Label control.
I want to know how can I write a Javascript function to attach it on "onkeyup" event of Quantity and Unit Price textboxes so that whenever there is any change in any quantity or any unit price, it calculates every thing and fills out total also.
Just for information, here is my RadGrid Control:
#####################################
| <telerik:RadGrid ID="RadGridDetails" runat="server" AllowPaging="false" |
| AllowSorting="true" AutoGenerateColumns="False" GridLines="Both" |
| OnNeedDataSource="RadGridDetails_needdatasource" Skin="Default" |
| OnItemDataBound="RadGridDetails_ItemDataBound" |
| ShowFooter="true" |
| > |
| <PagerStyle Mode="NextPrevAndNumeric" /> |
| <ClientSettings EnableRowHoverStyle="true" > |
| </ClientSettings> |
| <MasterTableView ShowHeadersWhenNoRecords="true"> |
| <Columns> |
| <telerik:GridTemplateColumn HeaderText="Row_Number" |
| SortExpression="Row_Number" UniqueName="Row_Number"> |
| <ItemTemplate> |
| <asp:Label ID="lblRow_Number" runat="server" |
| Text='<%# Bind("Row_Number")%>'></asp:Label> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn > |
| <ItemTemplate> |
| <asp:Button runat="server" ID="btnDeleteProduct" text="Delete" |
| CssClass="ButtonCSS" |
| ToolTip="Click here to delete this product" |
| CausesValidation="true" |
| OnClientClick="javascript:return confirm('Are you sure you want to delete this Product Information? ');" |
| onclick="btnDeleteProduct_Click" |
| CommandArgument='<%# |
| Eval ( "RequestInfoProductDetailID").ToString() |
| + ";" + |
| Eval ( "Row_Number").ToString() |
| %>' |
| /> |
| </ItemTemplate> |
| <FooterTemplate> |
| <asp:Button runat="server" ID="btnAddProduct" text="Add New Product" |
| CssClass="ButtonCSS" |
| ToolTip="Click here to add this new product to the list" |
| CausesValidation="true" onclick="btnAddProduct_Click" |
| /> |
| </FooterTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn HeaderText="Quantity" UniqueName="Quantity"> |
| <ItemTemplate> |
| <asp:TextBox ID="txtQty" Runat="server" MaxLength="7" |
| Text='<%# Bind("Quantity") %>' |
| onkeyup='isNumber(this)' |
| ToolTip="Enter quantity" |
| ></asp:TextBox> |
| <asp:CompareValidator ID="cvQty" runat="server" |
| Display="Dynamic" ErrorMessage="Please enter a valid quantity" |
| ControlToValidate="txtQty" Operator="DataTypeCheck" |
| Type="Integer" ></asp:CompareValidator> |
| </ItemTemplate> |
| <FooterTemplate> |
| <asp:TextBox ID="txtEnterQty" Runat="server" MaxLength="7" |
| ToolTip="Enter quantity" |
| ></asp:TextBox> |
| <asp:CompareValidator ID="cvEnterQty" runat="server" |
| Display="Dynamic" ErrorMessage="Please enter a valid quantity" |
| ControlToValidate="txtEnterQty" Operator="DataTypeCheck" |
| Type="Integer" ></asp:CompareValidator> |
| </FooterTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn HeaderText="Unit Cost" SortExpression="UnitCost" UniqueName="UnitCost"> |
| <ItemTemplate> |
| <asp:TextBox ID="txtUnitCost" Runat="server" MaxLength="10" |
| Text='<%# Bind("UnitCost") %>' |
| ToolTip="Enter Unit Cost" |
| visible="false" |
| ></asp:TextBox> |
| <asp:CompareValidator ID="cvUnitCost" runat="server" |
| Display="Dynamic" ErrorMessage="Please enter a valid amount" |
| ControlToValidate="txtUnitCost" Operator="DataTypeCheck" |
| Type="Double" ></asp:CompareValidator> |
| </ItemTemplate> |
| <FooterTemplate> |
| <asp:TextBox ID="txtEnterUnitCost" Runat="server" MaxLength="10" |
| ToolTip="Enter Unit Cost" |
| ></asp:TextBox> |
| <asp:CompareValidator ID="cvEnterUnitCost" runat="server" |
| Display="Dynamic" ErrorMessage="Please enter a valid amount" |
| ControlToValidate="txtEnterUnitCost" Operator="DataTypeCheck" |
| Type="Double" ></asp:CompareValidator> |
| </FooterTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn HeaderText="Total Cost" |
| SortExpression="TotalCost" |
| UniqueName="TotalCost"> |
| <ItemTemplate> |
| <asp:Label runat="server" ID="lblTotalCost" Text='<%# Bind("TotalCost") %>' ></asp:Label> |
| </ItemTemplate> |
| <FooterTemplate> |
| <asp:Label runat="server" ID="lblFooterTotalCost" ></asp:Label> |
| </FooterTemplate> |
| </telerik:GridTemplateColumn> |
| </Columns> |
| <EditFormSettings> |
| <PopUpSettings ScrollBars="None" /> |
| </EditFormSettings> |
| <ExpandCollapseColumn Resizable="False" Visible="False"> |
| <HeaderStyle /> |
| </ExpandCollapseColumn> |
| <RowIndicatorColumn Visible="False"> |
| <HeaderStyle /> |
| </RowIndicatorColumn> |
| </MasterTableView> |
| </telerik:RadGrid> |
| <asp:Label ID="lblSubTotal" runat="server" ></asp:Label> |
#####################################

| <script language="javascript" type="text/javascript"> |
| function cboOpening(sender, eventArgs) |
| { |
| //alert('cboOpening() called.'); |
| if (sender.get_items().get_count() <= 1) |
| sender.requestItems(sender.get_text(),false); |
| } |
| </script> |
| <telerik:RadComboBox ID="cbo" Runat="server" Height="200px" Width="400px" AutoPostBack="true" |
| EnableLoadOnDemand="false" |
| ShowDropDownOnTextboxClick="true" |
| MarkFirstMatch="true" |
| AllowCustomText="false" |
| ShowMoreResultsBox="false" |
| ItemRequestTimeout="500" |
| OnItemsRequested="cbo_ItemsRequested" EnableViewState="false" |
| OnSelectedIndexChanged="cbo_SelectedIndexChanged" |
| OnClientDropDownOpening="cboOpening"> |
| </telerik:RadComboBox> |
| protected void Page_Load(object sender, EventArgs evt) |
| { |
| if (!Page.IsPostBack) |
| { |
| cbo.Items.Clear(); |
| cbo.Items.Add(new RadComboBoxItem(some_text)); |
| cboHEs.SelectedIndex = 0; |
| } |
| } |
| public void cbo_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs evt) |
| { |
| SessionMgr.ValidateSession(); |
| LoadCBO(); |
| } |
| protected void cbo_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs evt) |
| { |
| string selectedText = cbo.Text; |
| if ((selectedText != null) && (selectedText .Trim().Length > 0)) |
| { |
| // Do some stuff... |
| } |
| } |
| protected void LoadCBO() |
| { |
| cbo.Items.Clear(); |
| foreach (Object obj in ObjectList) |
| { |
| RadComboBoxItem item = new RadComboBoxItem(obj.ToString()); |
| cbo.Items.Add(item); |
| if (_someCondition_) |
| { |
| item.CssClass = "NewOverrideClass"; |
| } |
| } |
| } |
| .RadComboBoxDropDown_CustomSkin .NewOverrideClass |
| { |
| background-image: url('image.gif'); |
| background-repeat: no-repeat; |
| background-position: top right; |
| padding: 2px 6px; |
| margin: 0 1px; |
| } |
| .RadComboBoxDropDown_CustomSkin .rcbHovered // <-- This is the default hover class |
| { |
| padding: 1px 18px 1px 5px; |
| border: 1px solid #bcd2f1; |
| background: #e7f1ff; |
| color: #0f3789; |
| } |

| Departments depts = new Departments(); |
| depts.Load(); |
| pnlbarDepartments.DataSource = depts; |
| pnlbarDepartments.DataTextField = "DisplayText"; |
| pnlbarDepartments.DataValueField = "ID"; |
| pnlbarDepartments.DataBind(); |
In Mozilla Firefox and Google Chrome on a DropDownList of a RadComboBox the list is displayed below the flash, in Internet Explorer it works correctly. Also the same thing happens with RadDatePicker
How can achieve the compatibility with Firefox and Google Chrome
<div>
<telerik:RadComboBox ID="RadComboBox1" AllowCustomText="true" runat="server">
<Items>
<telerik:RadComboBoxItem runat="server" Text="-- Select item --" />
<telerik:RadComboBoxItem runat="server" Text="Item with No Value" />
<telerik:RadComboBoxItem runat="server" Text="Item with Value=1" Value="1" />
<telerik:RadComboBoxItem runat="server" Text="Item with Value=2" Value="2" />
</Items>
</telerik:RadComboBox>
</div>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,24"
width="1000" height="78">
<param name="movie" value="header_v8.swf?button=1" />
<param name="quality" value="high" />
<param name="menu" value="false" />
<!--[if !IE]> <-->
<object data="header_v8.swf?button=1"
width="1000" height="78" type="application/x-shockwave-flash">
<param name="quality" value="high" />
<param name="menu" value="false" />
<param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer" />
</object>
<!--> <![endif]-->
</object>