Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
121 views
I Dynamic Bind Delete Button in that radgrid ,
It's not properly work

System.Webforms.pagerequestmanagersevererrorexception.Invalid post back or callback arguments


Thanks,
Mohamed.
Pavlina
Telerik team
 answered on 14 Jun 2011
2 answers
90 views

 I have a link

http://gyansuraj.com?ID=5

that leads to a page that has a grid in it. I can easily print this grid using

 

 

RadGrid1.MasterTableView.ExportToWord();

 

 

 

 

 

This page leads to same grid depending on the ID that I am passing as a querystring, the data of the grid keeps changing. so if I pass http://gyansuraj.com?ID=7, the data of the grid is different.

User is asking me to consolidate all these IDS and export them in MS word as diffent pages of the same document so in the above case, I will have two pages in same document, one will be with ID=7 and another one will be with ID=5.

I am not sure how can i achieve this. i can save individual word document for each ID, but I am not sure how can i consolidate all of them.
There can be at least 100 ID so they want a MS word document that has 100 pages and each page has a grid data of different ID's.

Anjali
Top achievements
Rank 1
 answered on 14 Jun 2011
1 answer
320 views
Hello Sir,

I was trying to create a chart with scroll bar so that we can see maximum chart but when we set scroll bar is true then websites gives null reference error message and when we set scroll bar as null then it is working fine.


Please find the error message as:

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) +257
   Telerik.Web.UI.RadChart.OnPreRender(EventArgs e) +64
   System.Web.UI.Control.PreRenderRecursiveInternal() +103
   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.1


Please find the details code which i have written and help me to resolve this issue.

Thanks,
Vinod

//---------------Default aspx.vb------------------//

Imports System
Imports System.Data
Imports System.Configuration
Imports System.Collections
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls
Imports System.Data.SqlClient
Imports Telerik.Charting

 

Partial Public Class Chart_Examples_Skinning_Bars_DefaultCS
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
        If Not Page.IsPostBack Then
            RadChart1.Skin = "Default"
        End If
        PopulateSkins()
    End Sub
    Private Sub PopulateSkins()
        If Not Page.IsPostBack Then
            Dim skinsList As New ArrayList()
            skinsList.AddRange(New String() {"Black", "Default", "Hay", "Inox", "Office2007", "Outlook", "Sunset", "Telerik", "Vista", "Web20", "WebBlue", "Marble", "Metal", "Wood", "BlueStripes", "DeepBlue", "DeepGray", "DeepGreen", "DeepRed", "GrayStripes", "GreenStripes", "LightBlue", "LightBrown", "LightGreen"})
            ThumbsList.DataSource = skinsList
            ThumbsList.DataBind()
        End If
    End Sub
    Protected Sub OrientationList_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
        RadChart1.SeriesOrientation = DirectCast([Enum].Parse(GetType(ChartSeriesOrientation), OrientationList.SelectedValue), ChartSeriesOrientation)
    End Sub
    Protected Sub SubtypeDropdown_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
        RadChart1.Series(0).Type = DirectCast([Enum].Parse(GetType(ChartSeriesType), SubtypeDropdown.SelectedValue), ChartSeriesType)
        RadChart1.Series(1).Type = DirectCast([Enum].Parse(GetType(ChartSeriesType), SubtypeDropdown.SelectedValue), ChartSeriesType)
    End Sub
    Protected Overloads Overrides Sub OnPreRender(ByVal e As EventArgs)
        MyBase.OnPreRender(e)
        For Each item As ListItem In ThumbsList.Items
            item.Text = String.Format("<img src='thumbnails/{0}.gif' alt='' onclick='if(this.parentNode.click)this.parentNode.click();'/> {0}", item.Value)
        Next
    End Sub
    Protected Sub ThumbsList_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
        RadChart1.Skin = ThumbsList.SelectedValue
    End Sub

 

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

        RadChart1.ClientSettings.ScrollMode = Telerik.Web.UI.ChartClientScrollMode.XOnly
      
    End Sub

    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim connectionString As [String] = "Data Source = IN-GGS-VINOD\MSSQLSERVER1; Initial Catalog=LibraryManagementSystem;Integrated Security = True;"
        Dim selectCommand As String = "SELECT top 200 [Facility] ,[TodaysChart],[YesterdaysChart]  FROM [LibraryManagementSystem].[dbo].[Facility]"
        Dim dataAdapter As New SqlDataAdapter(selectCommand, connectionString)
        Dim table As New DataTable()
        dataAdapter.Fill(table)
        RadChart1.DataSource = table
        RadChart1.PlotArea.XAxis.DataLabelsColumn = "Facility"
        AddHandler RadChart1.DataBound, AddressOf radChart1_DataBound
        RadChart1.SeriesOrientation = ChartSeriesOrientation.Horizontal
        RadChart1.Series(0).Type = ChartSeriesType.StackedBar
        RadChart1.Series(1).Type = ChartSeriesType.StackedBar

       
     
        RadChart1.DataBind()
    End Sub
    Private Sub radChart1_DataBound(ByVal sender As Object, ByVal e As EventArgs)
        RadChart1.Series(0).DataYColumn = "TodaysChart"
        ' assign appearance related properties
        radChart1.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 300
        radChart1.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Color = System.Drawing.Color.BlueViolet
        RadChart1.PlotArea.Appearance.Dimensions.Margins.Bottom = Telerik.Charting.Styles.Unit.Percentage(20)
        RadChart1.PlotArea.Appearance.Dimensions.Margins.Left = Telerik.Charting.Styles.Unit.Percentage(20)

        RadChart1.SeriesOrientation = ChartSeriesOrientation.Horizontal
        RadChart1.Series(0).Type = ChartSeriesType.StackedBar
        RadChart1.Series(1).Type = ChartSeriesType.StackedBar

    End Sub

 

End Class



//----------default.aspx-----------------//

<%@ Page Language="vb" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="Chart_Examples_Skinning_Bars_DefaultCS" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Charting" 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></head>
<body class="BODY">
    <form id="Form1" runat="server">
        <asp:ScriptManager ID="ScriptManager" runat="server" />
        <div id="MainPlaceHolder">
            <div id="ChartArea">
           <div id="chartOptionsPlaceholder">
                    <asp:Button ID="Button1" runat="server" Text="PopulateChart" />
                    <asp:Button ID="Button2" runat="server" Text="NewPopulateChart" />
                    <br />
                    <asp:Label ID="lblChartOrientation" runat="server" Text="Series orientation:" />
                    <asp:RadioButtonList AutoPostBack="true" ID="OrientationList" runat="server" OnSelectedIndexChanged="OrientationList_SelectedIndexChanged">
                        <asp:ListItem Text="Horizontal" Value="Horizontal" />
                        <asp:ListItem Text="Vertical" Value="Vertical" Selected="True" />
                    </asp:RadioButtonList>
                    <br />
                    <asp:Label ID="lblChartType" runat="server" Text="Additional chart types:" />
                    <asp:DropDownList AutoPostBack="true" ID="SubtypeDropdown" runat="server" OnSelectedIndexChanged="SubtypeDropdown_SelectedIndexChanged">
                        <asp:ListItem Text="Normal Bar" Value="Bar" Selected="True" />
                        <asp:ListItem Text="Stacked Bar" Value="StackedBar" />
                        <asp:ListItem Text="Stacked Bar 100" Value="StackedBar100" />
                    </asp:DropDownList>
                </div>
                <div id="chartPlaceholder">
                    <telerik:RadChart ID="RadChart1" SkinsOverrideStyles="true" runat="server"
                       Width="1038px" AutoLayout="true">
                        

                    <ClientSettings EnableZoom="false" ScrollMode=Both />
           <Series>
             <telerik:ChartSeries Name="series 1" Type="Bar">
             <Items>
             <telerik:ChartSeriesItem YValue="3" XValue="0" />
             <telerik:ChartSeriesItem YValue="3" XValue="1" />
             <telerik:ChartSeriesItem YValue="4" XValue="3" />
             <telerik:ChartSeriesItem YValue="3" XValue="3" />
             <telerik:ChartSeriesItem YValue="5" XValue="4" />
             </Items>
             </telerik:ChartSeries>
             <telerik:ChartSeries Name="series 2" Type="Bar">
             <Items>
             <telerik:ChartSeriesItem YValue="1" XValue="5" />
             <telerik:ChartSeriesItem YValue="2" XValue="4" />
             </Items>
             </telerik:ChartSeries>
             </Series>

            <PlotArea>
                <XAxis DataLabelsColumn="Code1"></XAxis>
            </PlotArea>
            <ChartTitle>
                <TextBlock Text="Previous Vs Current Period" />
            </ChartTitle>
                    </telerik:RadChart>
                </div>
            </div>
            <div id="ThumbsArea">
<asp:RadioButtonList ID="ThumbsList" AutoPostBack="true" runat="server" RepeatColumns="3"
RepeatDirection="Horizontal" OnSelectedIndexChanged="ThumbsList_SelectedIndexChanged">
                </asp:RadioButtonList>
            </div>
        </div>
        <div class="qsfClearFloat"><!-- --></div>
       
    </form>
</body>
</html>

Tsvetie
Telerik team
 answered on 14 Jun 2011
3 answers
182 views
Hi,

I am using ComboxBox with TreeView. TreeView have CheckBox and CheckChildNodes enable.

What I want to do is whatever I checked in the TreeView, I need to show in ComboBox. I only found the example that is ComboxBox with TreeView and OnClientNodeClicking. Please let me know which event i need to use to show the checked value in ComboBox.

Thanks,
Alex
Tom
Top achievements
Rank 1
 answered on 14 Jun 2011
1 answer
140 views
Hello Telerik Team

I'm using RadControl version : 2011.1.315.35 (for ASP.NET AJAX). I am using the Radgrid control also.
I have a simple problem. I just want to load record in Radgrid control on selection of a value in Radcombobox.
Here is the code,

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using Telerik.Web.UI;

public partial class GridDemo2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        using (SqlConnection con1 = new SqlConnection(ConfigurationManager.ConnectionStrings["connect"].ConnectionString))
        {
            using (SqlDataAdapter sda1 = new SqlDataAdapter())
            {
                string qry = "select * from Categories";
                sda1.SelectCommand = new SqlCommand(qry, con1);
                DataTable dt = new DataTable();

                con1.Open();
                try
                {
                    sda1.Fill(dt);
                    RadGrid1.DataSource = dt;
                }
                catch (Exception ex) {
                }
                finally
                {
                    con1.Close();
                }
            }
        }
    }
    protected void RadComboBox1_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        if (IsPostBack)
        {
            using (SqlConnection con1 = new SqlConnection(ConfigurationManager.ConnectionStrings["connect"].ConnectionString))
            {                
              using (SqlDataAdapter sda1 = new SqlDataAdapter())
            {
              string qry = "select * from Categories where Category_Name = '" + RadComboBox1.SelectedValue.ToString() + "'";
                sda1.SelectCommand = new SqlCommand(qry, con1);
                DataTable dt = new DataTable();

                con1.Open();
                try
                {
                    sda1.Fill(dt);
                    RadGrid1.DataSource = dt;
                }
                catch (Exception ex) {
                }
                finally
                {
                    con1.Close();
                }
            }

        }
    }
}


In this example I have taken a radcombobox which is bind to Categories table and datafield value is category name.
I want to fill the rad grid when radcombobox value is selected. I am passing that value in the query and on that query i want to load that 
record in the radgrid. I am not able to bind the data to radgrid.

If I am wrong in coding then please help me out.

Thanks in advance.

Regards
Anagha






Dimitar Terziev
Telerik team
 answered on 14 Jun 2011
2 answers
83 views
I have an aspx page that has some labels above a radgrid.  Is there a way I can export the page content to Excel including the labels and the radgrid vs. just exporting the grid to Excel?

Mike
Top achievements
Rank 1
 answered on 14 Jun 2011
1 answer
63 views
i have created a page with a grid and allowed paging on that grid.

when i click "next page", it goes to page 2, and when i click next again it goes back to page 1 and so on.

Please let me know how to handle this.
Vasil
Telerik team
 answered on 14 Jun 2011
3 answers
77 views

I have an issue where the RadListBox overlaps the buttons in IE6.  It's fine in IE7 and IE8.  Please see the attached screenshots. 

I have the width of the RadListBox control set to "280px", but it just seems to get ignored in IE6.  Does anyone know how to resolve this?

  

 

<telerik:RadListBox ID="RadListBox1" runat="server" Width="280px" Height="300px"
 SelectionMode="Multiple" AllowTransfer="true" TransferToID="RadListBox2" AutoPostBackOnTransfer="true"

 

  AllowReorder="true" OnDropped="RadListBox1_Dropped" OnTransferred="RadListBox1_Transferred"

 

AutoPostBackOnReorder="false" EnableDragAndDrop

="true">

 

 

Dimitar Terziev
Telerik team
 answered on 14 Jun 2011
1 answer
124 views
How can I  change the calendar  button size in RadDateTimePicker  because css not working on this control.
Please help me



Thanks
Jaichand Sahany
Princy
Top achievements
Rank 2
 answered on 14 Jun 2011
1 answer
89 views
Hello,

I have a question regarding data binding a RadGrid that is hosted in a "long" list of GridTableViews and RadGrids.

The scenarios is this:
1. We have hierarchy of 4 levels . All levels are representing by a business object that has a property holding a collection of the next level. (Let's say firstLevel->secondLevel and so on).

Example:
'class FirstLevel
{
type ID;
SecondLevel[] SecondLevels;
}'
2. The last level (forthLevel) has in it's signature 2 collections. (firstSubLevel, secondSubLevel).

Example:
'class ForthLevel
{
type ID;
FristSubLevel[] FirstSubLevels;
SecondSubLevel[] SecondSubLevels;
}'

Because displaying 5 levels as "successive" grids might be hard for a user to follow we decided the two sub-levels  to be displayed in a RadMultiPage control (just as in the RadGrid demo http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/nestedviewtemplate/defaultcs.aspx ) . To do this,  after a long list of (DetailTables as GridTableView), we try to set the last one's  NestedViewTemplate.

The problem I am facing is that I don't seem to find a way to bind the two "sub-level" RadGrid controls to the right data. Please keep in mind that all this data is coming as a collection of business objects.

How can I achieve this ?

Thank you,
Stefan
Tsvetoslav
Telerik team
 answered on 14 Jun 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?