or
<telerik:RadGrid runat="server" ID="gv"PageSize="10" Skin="Office2007"AllowSorting="true" AllowMultiRowSelection="true" AllowPaging="True" ShowGroupPanel="false"HeaderStyle-HorizontalAlign="Center"AutoGenerateColumns="false" AllowAutomaticDeletes="false" AllowAutomaticInserts="false" AllowAutomaticUpdates="false"OnNeedDataSource="gvNeedDataSource" OnRowDrop="gvRowDrop"OnPreRender="gvPreRender"OnDetailTableDataBind="gvDetailTableDataBind" OnItemDataBound="gvItemDataBound"OnUpdateCommand="gvItemUpdated" OnDeleteCommand="gvDeleteCommand"OnItemInserted="gvItemInserted" OnInsertCommand="gvInsertCommand"><PagerStyle Mode="NextPrevAndNumeric"/><ClientSettings AllowRowsDragDrop="True" AllowColumnsReorder="false" ReorderColumnsOnClient="false" EnableRowHoverStyle="false"><Resizing AllowColumnResize="false" /><Selecting AllowRowSelect="true" EnableDragToSelectRows="false"/> <Scrolling AllowScroll="false" UseStaticHeaders="false"/> </ClientSettings><MasterTableView Name="gv1" CommandItemDisplay="Top" EditMode="InPlace" DataKeyNames="ID"><Columns><telerik:GridBoundColumn UniqueName="Description" SortExpression="Description" HeaderText="Description" HeaderButtonType="TextButton" DataField="Description" HeaderStyle-Width="150px" ItemStyle-HorizontalAlign="Center"></telerik:GridBoundColumn></MasterTableView></telerik:RadGrid>
Hi,
I am trying to add 'RadComboBox4_SelectedIndexChanged' function on the server side code.
But when I run the application, I am getting the following error message.
CS1061: 'ASP.relatedcombobox_aspx' does not contain a definition for 'RadComboBox4_SelectedIndexChanged' and no extension method 'RadComboBox4_SelectedIndexChanged' accepting a first argument of type 'ASP.relatedcombobox_aspx' could be found (are you missing a using directive or an assembly reference?)
My code is:
| <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RelatedComboBox.aspx.cs" Inherits="GridRadControlsWebApplication1.RelatedComboBox" %> |
| <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> |
| <!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> |
| <script language="javascript" type="text/javascript"> |
| function pageLoad() { |
| //updateCombos(); |
| } |
| function updateCombos() { |
| // initialize the global variables |
| // in this event all client objects |
| // are already created and initialized |
| var combo = $find("<%= RadComboBox1.ClientID %>"); |
| var comboSubType = $find("<%= RadComboBox2.ClientID %>"); |
| var comboReqBy = $find("<%= RadComboBox3.ClientID %>"); |
| alert("test"); |
| if (combo.get_value() == "03") { |
| comboSubType.enable(); |
| } |
| else { |
| comboSubType.disable(); |
| } |
| // add the code to populate ReqBy list |
| if (combo.get_value() == "01") { |
| var comboItem1 = new Telerik.Web.UI.RadComboBoxItem(); |
| comboItem1.set_value('01'); |
| comboItem1.set_text('01-Complainant'); |
| var comboItem2 = new Telerik.Web.UI.RadComboBoxItem(); |
| comboItem2.set_value('02'); |
| comboItem2.set_text('02 - Provider'); |
| comboReqBy.clearItems(); |
| comboReqBy.get_items().add(comboItem1); |
| comboReqBy.get_items().add(comboItem2); |
| comboItem1.select(); |
| combo.commitChanges(); |
| } |
| if ((combo.get_value() == "02") || (combo.get_value() == "03") || (combo.get_value() == "04")) { |
| var comboItem2 = new Telerik.Web.UI.RadComboBoxItem(); |
| comboItem2.set_value('02'); |
| comboItem2.set_text('02 - Provider'); |
| comboReqBy.clearItems(); |
| comboReqBy.get_items().add(comboItem2); |
| comboItem2.select(); |
| combo.commitChanges(); |
| } |
| if (combo.get_value() == "05") { |
| var comboItem1 = new Telerik.Web.UI.RadComboBoxItem(); |
| comboItem1.set_value('03'); |
| comboItem1.set_text('03 - CNA'); |
| var comboItem2 = new Telerik.Web.UI.RadComboBoxItem(); |
| comboItem2.set_value('04'); |
| comboItem2.set_text('04 - DSW'); |
| comboReqBy.clearItems(); |
| comboReqBy.get_items().add(comboItem1); |
| comboReqBy.get_items().add(comboItem2); |
| comboItem1.select(); |
| combo.commitChanges(); |
| } |
| } |
| function OnIDRTypeChanged() { |
| updateCombos() |
| } |
| function LoadReqBy(combo, eventArqs) { |
| var item = eventArqs.get_item(); |
| //countriesCombo.set_text("Loading..."); |
| comboReqBy.clearSelection(); |
| // if a IDR type is selected |
| if (item.get_index() > 0) { |
| // this will fire the ItemsRequested event of the |
| // countries combobox passing the continentID as a parameter |
| comboReqBy.requestItems(item.get_value(), false); |
| } |
| } |
| function ItemsLoaded(combo, eventArqs) { |
| if (combo.get_items().get_count() > 0) { |
| // pre-select the first item |
| combo.set_text(combo.get_items().getItem(0).get_text()); |
| combo.get_items().getItem(0).highlight(); |
| } |
| } |
| </script> |
| <body> |
| <form id="form1" runat="server"> |
| <div> |
| <telerik:RadScriptManager ID="RadScriptManager1" Runat="server"> |
| </telerik:RadScriptManager> |
| <telerik:RadComboBox ID="RadComboBox4" runat="server" AutoPostBack="true" |
| OnSelectedIndexChanged="RadComboBox4_SelectedIndexChanged"> |
| </telerik:RadComboBox> |
| <telerik:RadComboBox ID="RadComboBox1" Runat="server" AutoPostBack="true" |
| OnClientSelectedIndexChanged="OnIDRTypeChanged" > |
| <Items> |
| <telerik:RadComboBoxItem Text="01-Complaint" value="01"/> |
| <telerik:RadComboBoxItem Text="02-Survey" value="02"/> |
| <telerik:RadComboBoxItem Text="03-Sanction" value="03"/> |
| <telerik:RadComboBoxItem Text="04-Application Denials" value="04"/> |
| <telerik:RadComboBoxItem Text="05-CNA/DSW" value="05"/> |
| </Items> |
| </telerik:RadComboBox> |
| <telerik:RadComboBox ID="RadComboBox2" Runat="server"> |
| <Items> |
| <telerik:RadComboBoxItem Text="01-Licensure" value="01" /> |
| <telerik:RadComboBoxItem Text="02-License Revocation" value="02"/> |
| <telerik:RadComboBoxItem Text="03-License Denial" Value="03" /> |
| </Items> |
| </telerik:RadComboBox> |
| <telerik:RadComboBox ID="RadComboBox3" Runat="server" > |
| <Items> |
| <telerik:RadComboBoxItem Text="01-Complainant" value="01" /> |
| <telerik:RadComboBoxItem Text="02-Provider" value="02"/> |
| <telerik:RadComboBoxItem Text="03-CNA" Value="03" /> |
| <telerik:RadComboBoxItem Text="04-DSW" Value="04" /> |
| </Items> |
| </telerik:RadComboBox> |
| </div> |
| </form> |
| </body> |
| </html> |
| using System; |
| using System.Collections.Generic; |
| using System.Linq; |
| using System.Web; |
| //using System.Web.UI; |
| //using System.Web.UI.WebControls; |
| using System.Data.SqlClient; |
| using System.Configuration; |
| //using System.Data.DataTable; |
| using System.Data; |
| using Telerik.Web.UI; |
| using Telerik.Web.Design; |
| namespace GridRadControlsWebApplication1 |
| { |
| public partial class RelatedComboBox : System.Web.UI.Page |
| { |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| string test = "123"; |
| } |
| private void RadComboBox4_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e) |
| { |
| string test1 = "12345"; |
| } |
| protected void RadComboBox3_ItemsRequested(object o,RadComboBoxItemsRequestedEventArgs e) |
| { |
| // e.Text is the first parameter of the requestItems method |
| // invoked in LoadCountries method |
| LoadReqBy(e.Text); |
| } |
| protected void LoadReqBy(string IDRType) |
| { |
| string connectionString = ConfigurationManager.ConnectionStrings["SQL_AppConString_Dev"].ConnectionString; |
| SqlConnection SqlConnection = new SqlConnection(connectionString); |
| //select a country based on the continentID |
| SqlDataAdapter adapter = new SqlDataAdapter("select * from [LOOKUP_VALUES] where TABLENAME='IDR_MAIN' "+ |
| " and COLUMNNAME='REQUESTED_BY' AND ALLOWEDTYPES=@IDRType", SqlConnection); |
| adapter.SelectCommand.Parameters.AddWithValue("@IDRType", IDRType); |
| DataTable dt = new DataTable(); |
| adapter.Fill(dt); |
| RadComboBox3.DataTextField = "VALDESC"; |
| RadComboBox3.DataValueField = "VALUE"; |
| RadComboBox3.DataSource = dt; |
| RadComboBox3.DataBind(); |
| } |
| } |
| } |
Any idea??
Thanks,
Rita


protected void LoadDataToGrid() { DataTable dt = new DataTable(); //Set the datafield name DataColumn cl = new DataColumn("status"); dt.Columns.Add(cl); cl = new DataColumn("Item_Code"); dt.Columns.Add(cl); cl = new DataColumn("Item_Desc"); dt.Columns.Add(cl); cl = new DataColumn("Vendor_Name"); dt.Columns.Add(cl); cl = new DataColumn("Uom"); dt.Columns.Add(cl); cl = new DataColumn("Moq"); dt.Columns.Add(cl); cl = new DataColumn("Qty"); dt.Columns.Add(cl); cl = new DataColumn("Cur"); dt.Columns.Add(cl); cl = new DataColumn("Price"); dt.Columns.Add(cl); cl = new DataColumn("Total"); dt.Columns.Add(cl); cl = new DataColumn("Type"); dt.Columns.Add(cl); //Set the static data for row 1 DataRow dr = dt.NewRow(); dr[0] = ""; dr[1] = "07-11-017"; dr[2] = "PAPER PUNCHER (3 HOLES)"; dr[3] = "Internal"; dr[4] = "PC"; dr[5] = "1"; dr[6] = "1"; dr[7] = "SGD"; dr[8] = "130.00"; dr[9] = "130.00"; dr[10] = "NS"; dt.Rows.Add(dr); //Set the static data for row 2 dr = dt.NewRow(); dr[0] = ""; dr[1] = "07-09-069"; dr[2] = "BINDING STRIPS A4 (MULTI-COLOUR) (LOT OF 100/50PC) "; dr[3] = "Internal"; dr[4] = "PC"; dr[5] = "1"; dr[6] = "1"; dr[7] = "SGD"; dr[8] = "60.00"; dr[9] = "60.00"; dr[10] = "NS"; dt.Rows.Add(dr); //Set the static data for row 3 dr = dt.NewRow(); dr[0] = ""; dr[1] = "01-38-002"; dr[2] = "LAMINATING MACHINE A4, LMA400"; dr[3] = "Internal"; dr[4] = "PC"; dr[5] = "1"; dr[6] = "1"; dr[7] = "SGD"; dr[8] = "160.00"; dr[9] = "160.00"; dr[10] = "NS"; dt.Rows.Add(dr); //Set the static data for row 4 dr = dt.NewRow(); dr[0] = ""; dr[1] = "99-09-901"; dr[2] = "BOLTED CONNECTOR"; dr[3] = "Internal"; dr[4] = "PC"; dr[5] = "10"; dr[6] = "10"; dr[7] = "SGD"; dr[8] = "1.50"; dr[9] = "15.00"; dr[10] = "ST"; dt.Rows.Add(dr); //Set the static data for row 5 dr = dt.NewRow(); dr[0] = ""; dr[1] = "99-07-905"; dr[2] = "GUY STRAIN INSULATOR"; dr[3] = "Internal"; dr[4] = "PC"; dr[5] = "100"; dr[6] = "100"; dr[7] = "SGD"; dr[8] = "1.00"; dr[9] = "100.00"; dr[10] = "ST"; dt.Rows.Add(dr); //Set the static data for row 6 dr = dt.NewRow(); dr[0] = ""; dr[1] = "99-01-505"; dr[2] = "HOT LINE CLAMP"; dr[3] = "Internal"; dr[4] = "PC"; dr[5] = "500"; dr[6] = "500"; dr[7] = "SGD"; dr[8] = "2.00"; dr[9] = "1000.00"; dr[10] = "ST"; dt.Rows.Add(dr); RadGrid1.DataSource = dt; RadGrid1.DataBind(); Session.Add("dtCart", dt); }