Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
444 views
Hi All,

I am facing a problem related to response.BinaryWrite(), it is not working on telerik:RadPageView.
My code is as below.

ASPX:
<telerik:RadPageView ID="vXML" runat="server" CssClass="edit-area">
                    <div class="padded-container">
                        <asp:LinkButton runat="server" EnableViewState="false" class="padded-element-first" OnClientClick="clientButtonClicking();"
                            Text="Download" CommandName="XML" CausesValidation="true" ID="btnExportXML" OnCommand="btnExport_Click" />
                        <label id="btnImportXML" class="padded-element-last" style="cursor: pointer; color: #0E3D4F;
                            text-decoration: underline; display: inline" onclick='toogleDisplays("btnImportXML","divUpldXML"); return false;'>
                            Upload</label>
                        <div id="divUpldXML" style="visibility: hidden; display: inline">
                            <asp:FileUpload CssClass="padded-element-last" EnableViewState="false" runat="server"
                                ID="upldXML" />
                            <asp:RequiredFieldValidator ValidationGroup="grpInputs" ID="vldUpldXml" ControlToValidate="upldXML"
                                runat="server" ErrorMessage="PlaceholderXML is required. Enter valid PlaceholderXML."
                                Text="*" />
                            <asp:RegularExpressionValidator ValidationGroup="grpInputs" Enabled="false" ID="vldRegExpUpldXml"
                                runat="server" ErrorMessage=".xml extension only" ValidationExpression="^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))(.xml|.XML)$"
                                ControlToValidate="upldXML" />
                        </div>
                    </div>
                    <tzgcontrols:XmlView Style="width: 97%; overflow: scroll; clip: auto; word-wrap: break-word;"
                        EnableViewState="true" ID="ViewerXML" runat="server" CssClass="XmlFormat placeholder-box" />
                </telerik:RadPageView>


Javascript:

       
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            RadAjax.OnStart(
{
 
    btnExportXML: doNotUseAjax,
    btnExportXSLT: doNotUseAjax,
    btnExportXSD: doNotUseAjax
});
            var cancelAjax = false;
 
            function clientButtonClicking(sender, eventArgs) {
                debugger;
                if (eventArgs.get_item().get_value() == "postback") {
                    cancelAjax = true;
                }
            }
 
            function onRequestStart(ajaxManager, eventArgs)
            {
                alert(cancelAjax);
                alert(eventArgs.EventTarget);
                if ((eventArgs.EventTarget == "btnExportXML") && (cancelAjax)) { alert('TEST'); eventArgs.EnableAjax = false; }
                if ((eventArgs.EventTarget == "btnExportXSD") && (cancelAjax)) { eventArgs.EnableAjax = false; }
 
                //Uncomment the line below in case of a file download.
                cancelAjax = false;
            }
             
        </script>
    </telerik:RadCodeBlock>


CS:

public static void DownloadFile(HttpResponse response, Constants.DownloadFileType type, string fileName, byte[] data)
{
    using (var trace = new TraceManager("Default"))
    {
        try
        {
            response.Clear();
            response.Buffer = true;
            byte[] storage = data;
 
            switch (type)
            {
                case Constants.DownloadFileType.XML:
                    //document is xml
                    response.ContentType = "application/xml";
                    response.AddHeader("Content-Disposition", "attachment;filename=" + fileName + ".xml");
                    break;
 
                case Constants.DownloadFileType.XSLT:
                    //document is xslt
                    response.ContentType = "application/xml";
                    response.AddHeader("Content-Disposition", "attachment;filename=" + fileName + ".xslt");
                    break;
                case Constants.DownloadFileType.XSD:
                    //document is xslt
                    response.ContentType = "application/xml";
                    response.AddHeader("Content-Disposition", "attachment;filename=" + fileName + ".xsd");
                    break;
 
                case Constants.DownloadFileType.DOCX:
                    response.ContentType =
                        "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
                    response.AddHeader("Content-Disposition",
                                       "attachment;filename=" + fileName + ".docx");
                    break;
 
                case Constants.DownloadFileType.EMAIL:
                    //document is email
                    response.ContentType = "text/html";
                    response.AddHeader("Content-Disposition",
                                       "attachment;filename=" + fileName + ".html");
                    break;
 
                default:
                    //throw new Exception("Unknown Placeholder type specified.");
                    break;
            }
            response.Cache.SetCacheability(HttpCacheability.NoCache);
            response.BinaryWrite(storage);
            //response.End();
            HttpContext.Current.ApplicationInstance.CompleteRequest();
        }
        catch (Exception ex)
        {
            trace.HandleException(ex);
        }
    }
}

Please help to resolve this issue.
Dimitar Terziev
Telerik team
 answered on 07 Sep 2011
1 answer
86 views

Hi,

We are facing problems with displaced RadGrid header pop-up menu on changing the zoom level of the IE browser.

If we change the IE browser’s zoom level to E.g. 200%, the RadGrid’s header menu (the pop-up on right click of the header) pop’s up away from its expected position and sometimes also goes off the screen. We expect the pop-up menu to pop-up right below the mouse pointer.

Also the header menu shows the correct text the first time, but goes blank the second time. Snapshots of these scenarios are attached along with.

Do you have a fix for the Grid Header pop-up menu to work as expected even after an IE zoom?

Tsvetoslav
Telerik team
 answered on 07 Sep 2011
1 answer
75 views
Dear Sirs,
we are using Telerik's RadScheduler Ajax Control in our web application.
We need to add two DropDownLists to the Appointment's View (Edit/Insert) and manage the event of index changed (cascading lists).
Is it possibile? How can we do that?
Many thanks in advance.
Best Regards.
Sergio
Peter
Telerik team
 answered on 07 Sep 2011
3 answers
112 views
Hi,

We have a Rad Combo box in a jQuery lightbox (using Superbox script) which creates a modal popup. In IE8, when the dropdown displays, you can't see any of the list items - it just shows the background. The data is there, as you can select them - but the dropdown part appears transparent with no text showing.

We've tried setting the zIndex ridiculously high but didn't have any effect. Only happens in IE8. Firefox, Chrome are fine.

Do you have any ideas what this could be?

Many thanks
Clare
Dimitar Terziev
Telerik team
 answered on 07 Sep 2011
1 answer
86 views
Dear Telerik,

Could you please advice me if it is possible to locate the time column of the RadScheduler in the right side of the control? Is it possible to put it both in the left and in the right?

Thank you very much,

- Stepan.
Peter
Telerik team
 answered on 07 Sep 2011
1 answer
97 views
Hey Guys,

Got a scenario here where I want to change the GroupBy on my Scheduler resources.
I want to do this for two reasons:
1. I have resource filters, and when all filters are off, and the scheduler tries to render grouped, empty views, it gives a javascript error.
2. I only want groupby set to my (single) resource when in Day view - I want to turn off for Weekly and Monthly.

Now if I tap into OnNavigationCommand I can set this and it works great - however the "More" link in monthly view does not fire OnNavigationCommand and this leaves grouping turned off when it switches back to Day view.

I guess I have two questions here:
Q1 How can I trap the "more" button and change the GroupBy without causing a "not allowed in data binding phase" error?
and
Q2 Is there a way to suppress the empty-grouped by errors? (If Q1 is answered then I'll simply turn groupBy off when no records present)

thanks
Peter
Telerik team
 answered on 07 Sep 2011
5 answers
90 views
Hi,

 How can i validate resource of Type Dropdown so that it should not apply the 0 index value for insertion. i have a resource Task whose values are shown in dropdown box for insertion or updation. it shows value at top with '-' or blank value. i need to validate that value so that it should be selected or there is any other way like blank value never shows up at the top. i am sending screen shot or resource  for better understanding,



Thanks 
Peter
Telerik team
 answered on 07 Sep 2011
3 answers
133 views

Hello,

I'm using a RadListView inside an UpdatePanel. When I click on a LinkButton and, from the code behind, it executes:

 

 

 

this.lstSkills.InsertItemPosition = RadListViewInsertItemPosition.LastItem;

 

 

 

this.btnShowSkillInsert.Visible = false;

 


it doesn't access to the InsertItemPosition in the RadListView lstSkills, it is just not showing anything until another event is handled, then it appears the content of the InsertItem.

Any idea of what could happen?

Thanks in advance!
Stanislav Velikov
Telerik team
 answered on 07 Sep 2011
5 answers
135 views
Hello,

When I use the radAsyncUpload in a div which scroll, the control doesn't scoll (see attached file)
How can I make him scrolling?


Thank you in advance !
Peter Filipov
Telerik team
 answered on 07 Sep 2011
21 answers
1.8K+ views
Hi,

i am using radgrid for asp.net ajax.

this is my client side event on pageindexchanged,

function

Confirm(PageChange)

 

{

 

       var

PageChangeValue=document.getElementById(PageChange).value;

 

 

        if(PageChangeValue == 1)

 

         {

 

             if(confirm("WARNING: Any unsaved changes will be lost. Do you want to save your work? \n Press OK to stop and save (You must use the save button). \n Press Cancel to continue without saving.")== false)

 

             {

                  document.getElementById(PageChange).value=0;

 

              }

 

         else

 

                {

 

                  return false;

 

                }

         }

 

}
if the confirmation is ok then only it will go to next page.
but when i click on the next page, it fires the clientside script, opens the confirmation dialog box and didnt wait for the confirmation. automatically it goes to the next page.

both clientside and serverside pageindexchanged event fired simultanouesly.

before that in radgrid for asp.net control , this functionality works fine.

how to solve this issue.

thanks,

Veli
Telerik team
 answered on 07 Sep 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?