or
protected void Page_Load(object sender, EventArgs e) { ConnectionStringSettings connectionString = ConfigurationManager.ConnectionStrings["database"]; SqlConnection connection = new SqlConnection(connectionString.ConnectionString); SqlCommand command = new SqlCommand("selectDetails", connection); command.CommandType = CommandType.StoredProcedure; SqlDataAdapter dataAdapter = new SqlDataAdapter(); dataAdapter.SelectCommand = command; DataSet dataSet = new DataSet(); dataAdapter.Fill(dataSet, "info"); chart.ClientSettings.EnableZoom = true; chart.ClientSettings.ScrollMode = Telerik.Web.UI.ChartClientScrollMode.XOnly; chart.DataSource = dataSet.Tables["info"]; chart.DataBind(); }Object reference not set to an instance of an object. 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.NullReferenceException: Object reference not set to an instance of an object. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [NullReferenceException: Object reference not set to an instance of an object.] Telerik.Web.ScriptObjectBuilder.RegisterCssReferences(Control control) +182 Telerik.Web.UI.RadChart.OnPreRender(EventArgs e) +61 System.Web.UI.Control.PreRenderRecursiveInternal() +103 System.Web.UI.Control.PreRenderRecursiveInternal() +175 System.Web.UI.Control.PreRenderRecursiveInternal() +175 System.Web.UI.Control.PreRenderRecursiveInternal() +175 System.Web.UI.Control.PreRenderRecursiveInternal() +175 System.Web.UI.Control.PreRenderRecursiveInternal() +175 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496 Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.225Hello,
I have two GridTemplate columns in a Radgrid and they have two DropDownLists controls in each column. I need to update the 2nd grid column depending on the selected value from the first. I have the following code from my project:
<telerik:GridTemplateColumn UniqueName="State" HeaderText="State" SortExpression="State" HeaderStyle-Width="140px"> <ItemTemplate> <asp:Label ID="lblState" runat="server" Text='<%# Eval("State") %>'></asp:Label> <asp:DropDownList ID="ddlState" runat="server" DataTextField="State" CssClass="cadddl" OnSelectedIndexChanged="ddlState_SelectedIndexChanged" AutoPostBack="true" DataValueField="State" Style="display: none"> </asp:DropDownList> </ItemTemplate></telerik:GridTemplateColumn><telerik:GridTemplateColumn UniqueName="City" HeaderText="City" SortExpression="City" HeaderStyle-Width="140px"> <ItemTemplate> <asp:Label ID="lblCity" runat="server" Text='<%# Eval("City") %>' /> <asp:DropDownList ID="ddlCity" runat="server" DataTextField="City" CssClass="cadddl" Width="120px" DataValueField="City" Style="display: none" /> </ItemTemplate></telerik:GridTemplateColumn>#region DropDownListprotected void ddlState_SelectedIndexChanged(object sender, EventArgs e){ DropDownList ddlState = (DropDownList)sender;}#endregionI've used the "Grid / Client edit with batch server update " demo to implement the grid (http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/clienteditbatchupdates/defaultcs.aspx).
The ddlState_SelectedIndexChanged event updates the hole Grid, so i miss the earlier changes on the grid and i don't know how to find the corresponding ddlCity to the selected State.
Thanks in advance,
Tiago Gerevini Yoshioka
<head runat="server"> <title> <asp:ContentPlaceHolder ID="TitleContent" runat="server" /> </title> <telerik:RadCodeBlock runat="server"> <%= Html.MinifyStylesheet("~/Content/Site.css") %> <%= Html.MinifyStylesheet("~/Content/dark-hive-custom/jquery-ui-1.7.2.custom.css")%> <%= string.Format("<link REL='SHORTCUT ICON' HREF='{0}'>", CompilationSymbol.IsCableSolve ? Html.ResolveUrl("~/content/images/cs_icon.ico") : Html.ResolveUrl("~/content/images/id.ico"))%> </telerik:RadCodeBlock> <asp:ContentPlaceHolder ID="CssContent" runat="server"> </asp:ContentPlaceHolder></head>