Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
85 views
Hi

I have a problem when exporting the content in the radgrid to PDF using 'Save as PDF' option ( IE6 only ).

It showing the following error 'There was an error opening the documnet. The File Cannot be Found'.

Please give any suggestions.

Thanks in advance.

Regards
Rags

Daniel
Telerik team
 answered on 08 Oct 2009
4 answers
174 views
To simplify for you, here is (most of) the markup. As you can see it is pretty straight forward and simple, but it doesn't work:

<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    <telerik:RadSkinManager ID="RadSkinManager1" Runat="server" Skin="WebBlue">
    </telerik:RadSkinManager>
    <telerik:RadFormDecorator ID="RadFormDecorator" runat="server" DecoratedControls="All">
    </telerik:RadFormDecorator>
    <div>
        <telerik:RadGrid ID="DocumentGrid" runat="server" Width="100%" OnNeedDataSource="DocumentGrid_NeedDataSource" AllowPaging="true" AllowSorting="true" OnSortCommand="DocumentGrid_SortCommand">
        </telerik:RadGrid>
    </div>
    </form>
</body>
</html>


And the code behind:

namespace WebApplication1
{
    [Serializable]
    public class Document
    {
        public int Id { get; set; }
        public string ObjectId { get; set; }
        public string ArchiveCode { get; set; }
        public DateTime CreateTime { get; set; }
    }

    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                List<Document> documents = new List<Document>();
                DateTime theTime = DateTime.Now;
                documents.Add(new Document() { Id = 1, ObjectId = "12345", ArchiveCode = "X", CreateTime = theTime });
                documents.Add(new Document() { Id = 2, ObjectId = "12345", ArchiveCode = "Y", CreateTime = theTime.AddDays(1) });
                documents.Add(new Document() { Id = 3, ObjectId = "12346", ArchiveCode = "Y", CreateTime = theTime });

                ViewState["Documents"] = documents;

                DocumentGrid.PageSize = 3;
                DocumentGrid.AutoGenerateColumns = false;
                DocumentGrid.MasterTableView.RetrieveAllDataFields = false;
                DocumentGrid.MasterTableView.AllowMultiColumnSorting = true;

                GridSortExpression sortExpression = new GridSortExpression() { FieldName = "Id", SortOrder = GridSortOrder.Descending };
                DocumentGrid.MasterTableView.SortExpressions.AddSortExpression(sortExpression);
            }
        }

        protected void DocumentGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            DocumentGrid.Columns.Clear();
            DocumentGrid.Columns.Add(new GridBoundColumn() { DataField = "Id", HeaderText = "Id", UniqueName = "DocumentIdColumn", SortExpression = "Id" });
            DocumentGrid.Columns.Add(new GridBoundColumn() { DataField = "ObjectId", HeaderText = "ObjectId", UniqueName = "DocumentObjectIdColumn", SortExpression = "ObjectId" });
            DocumentGrid.Columns.Add(new GridBoundColumn() { DataField = "CreateTime", HeaderText = "CreateTime", UniqueName = "DocumentCreateTimeColumn", SortExpression = "CreateTime" });
            DocumentGrid.Columns.Add(new GridBoundColumn() { DataField = "ArchiveCode", HeaderText = "ArchiveCode", UniqueName = "DocumentArchiveCodeColumn", SortExpression = "ArchiveCode" });

            DocumentGrid.DataSource = (List<Document>)ViewState["Documents"];
        }

        protected void DocumentGrid_SortCommand(object source, GridSortCommandEventArgs e)
        {
            GridSortExpression sortExpr = new GridSortExpression();
            switch (e.OldSortOrder)
            {
                case GridSortOrder.None:
                    sortExpr.FieldName = e.SortExpression;
                    sortExpr.SortOrder = GridSortOrder.Descending;

                    e.Item.OwnerTableView.SortExpressions.AddSortExpression(sortExpr);
                    break;
                case GridSortOrder.Ascending:
                    sortExpr.FieldName = e.SortExpression;
                    sortExpr.SortOrder = DocumentGrid.MasterTableView.AllowNaturalSort ? GridSortOrder.None : GridSortOrder.Descending;
                    e.Item.OwnerTableView.SortExpressions.AddSortExpression(sortExpr);
                    break;
                case GridSortOrder.Descending:
                    sortExpr.FieldName = e.SortExpression;
                    sortExpr.SortOrder = GridSortOrder.Ascending;

                    e.Item.OwnerTableView.SortExpressions.AddSortExpression(sortExpr);
                    break;
            }

            e.Canceled = true;
            DocumentGrid.Rebind();
        }
    }
}

Can someone please tell me what is wrong with this code?

Sebastian
Telerik team
 answered on 08 Oct 2009
1 answer
202 views

I am trying to have a RadMenu navigate to a specific page in a specific "frame". Now the frame can be an IFrame or a RadPane, I'm not picky, just needs to work. Is there something obvious here that's preventing it from working?

What's happening is the page is being loaded into a new window.

I am using version 2009.2.821.35


<table width="100%" cellpadding="0" cellspacing="0" border="0">
<

 

tr>

 

 

 

 

    <td></td>

 

 

 

 

    <td>

 

 

 

 

        <

 

telerik:RadMenu ID="RadMenu1" runat="server" Skin="Black" Width="1000px" OnItemClick="RadMenu1_ItemClick">

 

 

 

        <Items>

 

 

 

            <telerik:RadMenuItem runat="server" NavigateUrl="home.aspx" Text="Home" Target="Main">

 

 

 

            </telerik:RadMenuItem>

 

 

 

            <telerik:RadMenuItem runat="server" NavigateUrl="Portfolio.aspx" Text="Portfolio" Target="Main">

 

 

 

            </telerik:RadMenuItem>
        </Items>

 

 

         </

 

telerik:RadMenu>
    </td>
</tr>
 <tr>

 

 

 

 

 

    <td></td>

 

 

 

 

    <td>

 

 

    

 

<iframe id="Main" runat="server" src="Home.aspx" ></iframe>

 

 

 

 

    </td>

 

 

 

 

</tr>
</table>

Thanks,

 

 

 

 

Paul
Telerik team
 answered on 08 Oct 2009
1 answer
154 views
Hi,
I'm using the latest official version of ASP.NET Ajax  and I use IE8.0.
Please check the following demo :
http://demos.telerik.com/aspnet-ajax/toolbar/examples/functionality/righttoleft/defaultcs.aspx
as you see the controls (RadToolBarDropDown and RadToolBarSplitButton ) has been used to demonstrate the right to left functionality, but they don't render properly.
just change your demo and move the RadToolBarDropDown or RadToolBarSplitButton from the last to the beginning of toolbar and instead of short names like  Left,center,Right or Red Blue,Green use longer names.
the if you click on them, you will see that some portion of items the items truncated on the screen.

if you compare it with http://demos.telerik.com/aspnet-ajax/toolbar/examples/functionality/itemtypes/defaultcs.aspx you will find that the starting point of popup menu is wrong, means for this one when you click on RadToolBarDropDown or RadToolBarSplitButton the popup menu starts from left to right ( it aligned from the text portion toward down arrow image which is right) .
For http://demos.telerik.com/aspnet-ajax/toolbar/examples/functionality/righttoleft/defaultcs.aspx example we expect the right behavior ( It should be aligned from the text portion toward the down arrow image)  bu as you can see the popup menu always render from left to right ( from down arrow image toward text portion )

Thanks





Yana
Telerik team
 answered on 08 Oct 2009
3 answers
191 views
hi,

I have to reorder items in the radgrid by using drag and drop. A solution provided in exisiting forum thread was using data tables. I can reorder items but this is only temporarily. As all the processing is done in data table. What i want is when my data is updated in data table it should be updated in actual database from where i am getting the data (through sqldatasource). I am using a c# version. Please help in it. I will be very thankful.

Cheers, Ali
Sebastian
Telerik team
 answered on 08 Oct 2009
3 answers
270 views
how would i turn the cell value red when the value in that cell is a negative number. thanks.
Daniel
Telerik team
 answered on 08 Oct 2009
1 answer
112 views
Hi,

 Am using rad chart.i want to export my image in local system.

Am using following code


           
                System.IO.MemoryStream ms1 = new System.IO.MemoryStream();
                this.chartPie.Save(ms1, System.Drawing.Imaging.ImageFormat.Png);
                this.Page.Response.Clear();
                this.Page.Response.ClearHeaders();
                this.Page.Response.AddHeader("Content-disposition", "attachment; filename=PieChart.png");
                this.Page.Response.AddHeader("Content-type", "image/png");
                this.Page.Response.BinaryWrite(ms1.ToArray());
                this.Page.Response.End();
          
    

The chart is getting saved while running in local.while running my project through IIS, i am getting "object reference error".
I gave all permissions to folders and also IIS.Even setting all permissions, i am getting the same error.

Thanks for any help,


Giuseppe
Telerik team
 answered on 08 Oct 2009
1 answer
98 views
Is there a way to selectively draw line graph connector lines? In other words, to draw some lines between data points, and not draw others?
Giuseppe
Telerik team
 answered on 08 Oct 2009
1 answer
88 views
I'm not even sure this is possible, but here it goes...

I have a rad splitter with 3 panes in it (A, B and C). Pane "A" gets a treeview loaded into it dynamically, with handlers assigned to it at runtime, etc during the pageload. Pane "B" has a panel in it that loads user controls based on which node in the treeview you click.

I add at runtime the ajax setting to update the panel in pane "B" when the tree is interacted with, like this:

        RadAjaxManager1.AjaxSettings.AddAjaxSetting(Tree, UPanel) 
        RadAjaxManager1.AjaxSettings.AddAjaxSetting(Tree, Tree) 

It's cool and everything works, HOWEVER -

I don't really want to update the Tree every time. I only really want to update it on certain events (like selecting an item from a tree context menu) but not on others (selecting a node), however I do want update the "UPanel" control when I select a node.

How could I implement this? I'm familiar with the RequestStart and RequestEnd handlers of the AjaxManager, but I'm not seeing a clear strategy to get to where I want.

Any suggestions would be appreciated!

Sebastian
Telerik team
 answered on 08 Oct 2009
2 answers
59 views
Dear's
I use in my page RadAjaxLoadingPanel control
and this page contain user controls, these user control when run the RadAjaxLoadingPanel
does not declare the javascript variables.

how I can fix this problem ??
Jihad
Top achievements
Rank 1
 answered on 08 Oct 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?