Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
113 views
Hi. i have this scenario
In a multipage i have a radchart..i have a button to generate a pdf and send it by response.write..when i press the button..the events it's ok..the image of radchart are still visible in the selected view but when i change to other view the image is not..i have to do right click and show image to see it..why?
Petar Kirov
Telerik team
 answered on 10 Sep 2013
1 answer
111 views
For my application, I need to have the root node and it's children all populated on initial load.   Descendants are to be loaded using webservice mode.   This is all working fine, i.e. the initial load displays all the children of the root, and when expanded the children load via the webservice.

The issue I'm having is with the root node.   If after the initial load, the root is collapsed and then expanded, the webservice is still called and a second set of children are added to the root.  It seems the root, from a load-on-demand perspective, doesn't know that its children are loaded.

How can the second load be avoided?

Dave


Dave
Top achievements
Rank 1
 answered on 10 Sep 2013
1 answer
100 views
Hello,

I have created a hierarchical RADGrid which seems for the most part to be working fine. The issue that I am having is with sorting the rows in the child table. First, let me show how data is being bound:
protected void rgSalesAnalysis_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{             
            bool ByCode = rbSoldSummary.Checked;
 
            if (ByCode)
            {
                rgSalesAnalysis.MasterTableView.GetColumn("First").HeaderText = "Barcode";
                rgSalesAnalysis.MasterTableView.DetailTables[0].GetColumn("Second").HeaderText = "Location";
            }
            else
            {
                rgSalesAnalysis.MasterTableView.GetColumn("First").HeaderText = "Location";
                rgSalesAnalysis.MasterTableView.DetailTables[0].GetColumn("Second").HeaderText = "Barcode";
            }
            List<SaleAnalysisRow> analysisData = sa.GetAnalysisData(ByCode, ....)ToList();
            rgSalesAnalysis.DataSource = analysisData;
}
 
//----------------------------------------------------------------------------------------------------------------------------
 
protected void rgSalesAnalysis_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
{
            e.DetailTableView.DataSource = ((SaleAnalysisRow)e.DetailTableView.ParentItem.DataItem).Details;
}

Now when I try to sort the child table, I receive the error: Object reference not set to an instance of an object. 
     e.DetailTableView.DataSource = ((SaleAnalysisRow)e.DetailTableView.ParentItem.DataItem).Details; Line 102:       
}

Obviously the "ParentItem" is null, but I am unsure how to proceed at this point to fill that object and sort the data in the child grid.

Thank you.







Matt
Top achievements
Rank 1
 answered on 10 Sep 2013
2 answers
311 views
I had the classic situation where my site worked on the dev box, but not on the server.  Dropdowns populated with data would not post back to the server.  You'd choose an option and nothing would happen other than a page blink.

The server is 2008 R2 fully patched with .net 4.5 installed.  The site has its own IP, not using default site in IIS.  The page that was not working was default.aspx.  IIS was set to use that as default, just like out of the box.

So, I made a test page called test.aspx that just had a simple dropdown box set to autopostback.  When it changed value, the dropbox would be set to visible=false.  I just wanted to prove the postback was happening.  

When I went to the site by http://sitename.com/test.aspx it worked!  

So I set it to be the default page in IIS.  

When I went to the site by http://sitename.com my test page did not work.  It would blink when I chose a different value, but the box did not disappear.

So I went to the site directly again by http://sitename.com/test.aspx and it worked again!

Basically, the ajax is not working if the page name is not directly specified and you arrive by it being the default page in IIS.

Sample code:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="Test" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
 
            <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" />
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
                </Scripts>
            </telerik:RadScriptManager>
 
        </div>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        </telerik:RadAjaxManager>
        <br />
        <br />
        <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
            <asp:ListItem>test</asp:ListItem>
            <asp:ListItem Value="1">test1</asp:ListItem>
        </asp:DropDownList>
    </form>
    <br />
    <br />
</body>
</html>
Jonathan
Top achievements
Rank 1
 answered on 10 Sep 2013
1 answer
117 views
Hi,

I have a RadGrid, in a SharePoint 2010 Visual Web Part, bound server side using NeedDataSource event. I am trying to export the data from the grid on a button click event. The export feature works fine on the first button click, exporting all the data. The issue is that this export is breaking the functionality of all the components on the page. Nothing works on the page after the initial export. I removed all my Ajax settings so it causes a full post back, which it is doing.

When I commented out the line RadGrid1.MasterTableView.ExportToCSV(), everything works good. I mean the button click causing postback on click event and all other components work fine all the time. Adding the above line back is what is causing the issue. Am not sure what is causing this behavior. I tried adding the button as RegisterPostBackControl on the ScriptManager. But it didn't help.

Can you shed some light over this.


Thanks,
Viddy.
Vidyadhar
Top achievements
Rank 1
 answered on 10 Sep 2013
0 answers
85 views
Hi Telerik:

I Have a little Issue.

I'm working with a RadPanelBar and almost everything works fine.
The only problem that I Have is when I click on a RadPanelItem, I have the postback effect. (postback, blinking or however you call it).

How can I avoid that?

Thanks.
Guillermo
Top achievements
Rank 1
 asked on 10 Sep 2013
1 answer
138 views
I start to having problem with loading Telerik WebResource.axd:
http://localhost:54414/WebResource.axd?d=vyJgXEP_8MOd4VGCkvSPylUOVRehaA1ppV0-Q3wIHGJMlpF493Yx0CsmL6YZnuuz4Kijzq2KnHywF0tKNK1fR_4RStXj2s_UzbR0wqOh5C96OFeg...
for this reason rest of .js code does not work. In my conf file I have:
 
<handlers><br>      <remove name="ChartImage_axd"/><br>      <remove name="Telerik_Web_UI_SpellCheckHandler_axd"/><br>      <remove name="Telerik_Web_UI_DialogHandler_aspx"/><br>      <remove name="Telerik_RadUploadProgressHandler_ashx"/><br>      <remove name="Telerik_Web_UI_WebResource_axd"/><br>      <add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd"  type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode"/><br>      <add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode"/><br>      <add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" preCondition="integratedMode"/><br>      <add name="CrystalImageHandler.aspx_GET" verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" preCondition="integratedMode"/><br>      <add name="ChartImage_axd" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" preCondition="integratedMode"/><br>      <add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" preCondition="integratedMode"/><br>      <add name="Telerik.ReportViewer.axd_*" path="Telerik.ReportViewer.axd" verb="*" type="Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=7.1.13.612, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" preCondition="integratedMode"/><br>    </handlers>

and also:
<httpHandlers><br>      <add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource" validate="false"/><br>      <add path="Telerik.Web.UI.DialogHandler.aspx" verb="*" type="Telerik.Web.UI.DialogHandler" validate="false"/><br>      <add path="Telerik.RadUploadProgressHandler.ashx" verb="*" type="Telerik.Web.UI.RadUploadProgressHandler" validate="false"/><br>      <add path="CrystalImageHandler.aspx" verb="GET" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><br>      <add path="ChartImage.axd" verb="*" type="Telerik.Web.UI.ChartHttpHandler" validate="false"/><br>      <add path="Telerik.Web.UI.SpellCheckHandler.axd" verb="*" type="Telerik.Web.UI.SpellCheckHandler" validate="false"/><br>      <add path="Telerik.ReportViewer.axd" verb="*" type="Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=7.1.13.612, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE" validate="true"/><br>      <add path="ScriptResource.axd" verb="GET,HEAD"  type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/><br>    </httpHandlers>
I have looking in :
http://www.telerik.com/help/aspnet-ajax/introduction-web-resources-troubleshooting.html

I have no idea where to start.

Thins in advance.
Genady Sergeev
Telerik team
 answered on 10 Sep 2013
2 answers
262 views
I have an attachment column that, in edit mode, allow to upload and save attachment in a folder named "Allegati".
<telerik:GridAttachmentColumn FileName="attachment" FilterControlAltText="Filter columnAllegati column" HeaderText="Allegati" UniqueName="columnAllegati" Visible="False">
               </telerik:GridAttachmentColumn>
With this snippet (thanks to Princy for it), when a file is uploaded a link is generated and it is visible inside the record when it is in edit mode. See picture attached.
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
    {
        //Generate links of attachments inside folder "Allegati" visible when in edit mode
        if (e.Item is GridEditableItem && e.Item.IsInEditMode)// Check if the Grid is in EditMode
        {
            GridEditableItem edit = (GridEditableItem)e.Item;
            DirectoryInfo dir = new DirectoryInfo(@"C:\Users\Pink\Documents\Visual Studio 2012\Projects\ManagDoc_Framework\Test1_managDoc\Test1_managDoc\Allegati");// path of the target folder where your  files are stored
 
            DirectoryInfo[] subDirs = dir.GetDirectories();
            FileInfo[] files = dir.GetFiles(); //Getting the files inside the Directory
            foreach (FileInfo fi in files) //To loop through all files for setting each file as HyperLink
            {
                HyperLink lktest = new HyperLink(); //Add HyperLink Column
                lktest.ID = "lnk" + Guid.NewGuid(); //Setting Unique IDs
                lktest.Text = fi.Name.ToString(); //Get the File name
                lktest.NavigateUrl = "#";
                lktest.Attributes.Add("Onclick", "ViewCheck('" + fi.Name + "')"); // Calling the JS event
                //Adding the HyperLink to EditForm
                edit["columnAllegati"].Controls.Add(lktest);
                edit["columnAllegati"].Controls.Add(new LiteralControl("<br>"));
            }
        }
    }
The above feature works very well and I am happy of the result I got thanks to the help of this forum members.
Now what I would like to achieve is to show for each record only the links of the uploaded files relevant that particular record.
I mean If I load an attachment named "Mickey Mouse" from record A, and an attachment named "Donald duck" from record B, when I open record A I would like to see only the link to Mickey Mouse and when I open record B I would like to see only the link to Donald Duck.
Like in this forum, each thread shows links to the own attachments.
How can I achieve that?
Felice
Top achievements
Rank 1
 answered on 10 Sep 2013
3 answers
188 views
I'm not sure how to do this. 

I tried
<style type="text/css" >
        .trtxt
        {
             HoveredStyle-Font-Bold: true; 
        
    </style>
 
 
<telerik:RadTextBox ID="rtxtCity" runat="server" MaxLength="25" CssClass="trtxt"   >
                        </telerik:RadTextBox>

   

but the effect did not work.
Any suggestions?

 

 

 

 

 

 

Jack Voss
Top achievements
Rank 1
 answered on 10 Sep 2013
1 answer
54 views
I would like to add a dropdown to my radEditor toolbar which looks exactly like the "BackColor" EditorSplitButton.  It will set the background color for all the content rather than just selected text.

This article gives me a good idea on how to add the dropdown:
http://demos.telerik.com/aspnet-ajax/editor/examples/customdropdowns/defaultcs.aspx

And I believe I can set the background like this:

var style = editor.get_contentArea().style;
var val = args.get_value();

style.backgroundImage = "none";

style.backgroundColor = val;


The above is all working great, all I need is the markup to make the custom EditorSplitButton look just like the BackColor one.  I still need the default BackColor dropdown as well so I don't want to just overwrite the functionality for that command.


Ianko
Telerik team
 answered on 10 Sep 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?