Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
59 views
Hai,

I have a Radwindow like this :

<telerik:RadWindowManager ID="RadWindowManager1" ShowContentDuringLoad="false" VisibleStatusbar="false"
                                                        ReloadOnShow="true" runat="server" Skin="Web20" Style="z-index: 20002" >
                                                        <Windows >
                                                            <telerik:RadWindow ID="RadWindowPopup"
                                                                EnableShadow="true" DestroyOnClose="true" Visible="true"
                                                                Behaviors="Resize, Close, Maximize"
                                                                VisibleOnPageLoad="false" runat="server" Title="Local Item Request" Skin="Web20">
                                                            </telerik:RadWindow>
                                                        </Windows>
                                                       
                                                    </telerik:RadWindowManager>

In Code behind, I have called this radwindow like this :

if (!ClientScript.IsStartupScriptRegistered("popupWindow"))
                     System.Web.UI.ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "popupWindow", "showWindow();", true);

showWindow() javascript is

 

function showWindow() {

 

 

var varMealOrderID = document.getElementById('ctl00_CphMaster_hidMealOrderId').value;

 

 

var oWnd = radopen('FKMS_CTRL_Local_Item_Request.aspx?MealOrderId=' + varMealOrderID + '&popup=true' + '&Mode=NEW', 'RadWindowPopup');

 

oWnd.setSize(1100, 750);

oWnd.moveTo(75, 50);

 

}


This code works fine in my local development computer. But When I hosted in a server, it is showing the following javascript error in the radopen portion of showWindow() method.

Microsoft JScript runtime error: Object doesn't support this property or method

Please help me.
Marin Bratanov
Telerik team
 answered on 28 Jun 2011
5 answers
340 views
Hi all:
    I try to display the file ( txt, image , PDF , word..etc format) using tooltip. ( just like the sameple
http://demos.telerik.com/aspnet-ajax/tooltip/examples/targetcontrolsandajax/defaultvb.aspx)

the issue is that when I mouse over the record, I got the following error : "RadTootipManager response error. ...the message received from server could not parsed..."

what I did is to read the files then use the response.write to generate the file content.please see code below:

'on parent page which has tooltip with it
  
    Private Sub UpdateToolTip(ByVal elementID As String, ByVal panel As UpdatePanel)
        Dim ctrl As Control = Page.LoadControl("WidgetControls/WidgetSupportDocument.ascx")
        panel.ContentTemplateContainer.Controls.Add(ctrl)
        Dim details As WidgetSupportDocument = DirectCast(ctrl, WidgetSupportDocument)
        details.SupportDocumentID = elementID
        details.DisplayData()
  
    End Sub


on WidgetSupportDocument.ascx control:
Public Sub DisplayData()
      Dim dsData As DataSet
      Dim strFileName As String
      Dim byteData() As Byte
      Dim strDocumentType As String
      Dim arrSplit() As String
      'load data from database
      dsData = LoadData(Me.SupportDocumentID)
      byteData = CType(dsData.Tables(0).Rows(0).Item("FileContent"), Byte())
      arrSplit = Split(dsData.Tables(0).Rows(0).Item("Filename").ToString, ".")
      intLastValue = arrSplit.Length
      strDocumentType = arrSplit(intLastValue - 1)
      SetControlData(strDocumentType, byteData)
  End Sub
  Private Sub SetControlData(ByVal strDocumentType As String, ByVal byteView() As Byte, Optional ByVal strFileName As String = "")
      Dim strContentType As String = String.Empty
      Select Case UCase(strDocumentType)
          Case "HTML", "HTM"
              strContentType = "text/HTML"
          Case "BMP"
              strContentType = "image/BMP"
          Case "JPG"
              strContentType = "image/JPEG"
          Case "GIF"
              strContentType = "image/GIF"
          Case "PDF"
              strContentType = "application/pdf"
          Case "XLS"
              strContentType = "application/vnd.ms-excel"
          Case "DOC"
              strContentType = "application/msword"
          Case "TXT", "LOG"
              ' .txt file (such as a report tab delimited export) should open inline rather then directly in the browser 
              If strFileName = "" Then
                  strFileName = "ViewDocument.txt"
              End If
              With Response
                  .ClearContent()
                  .ClearHeaders()
                  strContentType = "text/unknown"
                  .AddHeader("Content-Length", CType(byteView.Length, String))
                  .AddHeader("Content-Disposition", "inline; filename=" & strFileName)
              End With
          Case Else
      End Select
      If strContentType.Length > 0 Then
          With Response
              .Clear()
              .ContentType = strContentType
              .BinaryWrite(byteView)
              .Flush()
          End With
      Else
          Response.Write("<font color='red'>The selected attachement cannot be displayed. </font>")
                End If
  End Sub


Thanks
Helena
Marin Bratanov
Telerik team
 answered on 28 Jun 2011
1 answer
138 views
Hi,

We are using Q3 2010 and have a RadImage control that is throwing the following error - but only on production.

Exception information:
Exception type: ArgumentException
Exception message: The provided binary data may not be valid image or may contains unknown header

If I debug the same image in development, no errors are displayed/thrown. Our production environment and development operate in integrated mode and have the following handler entry

      <add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" />

The error only occurs for a handful of images, but when it happens, it brings the entire page down. How can I test whether the data coming from sql is a valid image and catch this condition ahead of time? I have a try catch surrounding everything, but it does not appear to have an impact. I am guessing that the image control is outputting content that ends up corrupting the html output. Any thoughts welcome.
Iana Tsolova
Telerik team
 answered on 28 Jun 2011
1 answer
39 views
My issue is that when I modify my aspx page, ranging anything from adding a div tag to a simple br tag, it will result in the design view hiding all controls of my page, and it's master page. The only thing that would remain visible is the main master page.

My setup:

MenuMaster.master
-> NavBar.master
-> default.aspx

I am running VS2010 version 10.0.303019.1 with RadControls for ASP.NET AJAX version 2011.1.519 
Vasil
Telerik team
 answered on 28 Jun 2011
1 answer
72 views
Please consider this request for a new feature to be added to the RadComboBox. We would like to see a property called "Mode" added. It would have two options; Normal and Label. The default value would be Normal as to not break previous implementations.

Use Case:

When using a RadComboBox on a FormView with view/edit/insert/delete functions, there is no easy way to show the selected item text of the RadComboBox in a Label look & feel without complex JavaScript/CSS or adding code. It would be awesome if we could just set a property called Mode="Label" which caused the RadComboBox to display a Label instead of the combobox. It would use the same css as the rest of the labels on the page. When in Label mode, the control presented to the user would not allow the user to change any values, nor see any look & feel of a combobox. The user would see it as a standard label. 

Currently, we have to put both a label and a combobox in our item template of the FormView. Then set combobox visible=false, and add a SelectionChanged event to the combobox (we use binding) which sets the text value of the label. Lot's of work and extra code just so we can show the user the value of the combobox in Label format! We tried the JavaScript/CSS method, but had other issues and was not sure it would interfere with our other CSS changes in the future. 

Thank you for the consideration.
Kalina
Telerik team
 answered on 28 Jun 2011
1 answer
136 views
Hi,

in an scenario with a master page with the Radajaxmanager control and a content page with a grid i never get the Ajaxrequestdelegate event reach, in this case RadAjaxManager1_AjaxRequest, thanks a lot

the code behind of the content page:

       protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                RadAjaxManager AjaxManager = (RadAjaxManager)this.Master.FindControl("RadAjaxManager1");
                //                RadAjaxManager AjaxManager = RadAjaxManager.GetCurrent(Page);
                AjaxManager.AjaxSettings.AddAjaxSetting(AjaxManager, RadGridClientes);
                AjaxManager.AjaxSettings.AddAjaxSetting(RadGridClientes, RadGridClientes);
                AjaxManager.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(RadAjaxManager1_AjaxRequest);
            }

        }

        protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
        {
            if (e.Argument == "Rebind")
            {
                RadGridClientes.MasterTableView.SortExpressions.Clear();
                RadGridClientes.MasterTableView.GroupByExpressions.Clear();
                RadGridClientes.Rebind();
            }
            else if (e.Argument == "RebindAndNavigate")
            {
                RadGridClientes.MasterTableView.SortExpressions.Clear();
                RadGridClientes.MasterTableView.GroupByExpressions.Clear();
                RadGridClientes.MasterTableView.CurrentPageIndex = RadGridClientes.MasterTableView.PageCount - 1;
                RadGridClientes.Rebind();
            }
        }

in the content page aspx file:


<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">



    <telerik:RadGrid ID="RadGridClientes" runat="server">
    </telerik:RadGrid>

                <telerik:RadButton Text="Cancelar" runat="server" ID="Cancelar" OnClientClicked="refreshGrid">
                </telerik:RadButton>

   <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function refreshGrid(arg) {
            if (!arg) {
                $find("<%= RadAjaxManager.GetCurrent(this.Page).ClientID %>").ajaxRequest("Rebind");
            }
            else {
                $find("<%= RadAjaxManager.GetCurrent(this.Page).ClientID %>").ajaxRequest("RebindAndNavigate");
            }
        }
    
    </script>
    </telerik:RadCodeBlock>
</asp:Content>
Genti
Telerik team
 answered on 28 Jun 2011
1 answer
154 views
I have looked at every example I could find on client-side binding the RadGrid with virtual scrolling and I cannot make it work.
I am using the following Javascript code for binding.
var grid = $find("radgrid1");
                    var mtv = grid.get_masterTableView();
                    mtv.set_dataSource(DATA); //data is coming from a JSON object
                    mtv.dataBind();

What usually happens, is that all of the data in my dataObject is loading and since there are a large number of records the browser freezes. I've tried to use the DataBinding events for the client-side and server side, but they never seem to fire.
I can't use a webservice for this issue.

Thanks.
Shinu
Top achievements
Rank 2
 answered on 28 Jun 2011
1 answer
323 views
Greetings,

I am working on a project in VS 2010 and decided to install the latest Telerik update. (Telerik.Web.UI_2011_1_519_Dev.zip).  After the install my Telerik toolbox is missing.

Any help is appreciated.
Biliana Ficheva
Telerik team
 answered on 28 Jun 2011
1 answer
241 views
Hi There,

I'm using a RadAsyncUpload Control to upload documents into one of my systems.

The problem is occurring after the User selects a File to be uploaded. Normally, the user selects the file, and eventually the Dot beside the file name becomes green and the file can now be committed to the upload. In some of these cases, the user is prompted to enter a Username/Password after selecting files. After entering their login information, the Prompt disappears then reappears. This continues to happen and in some cases the Dot beside the file name turns Red.

My application is using Windows Authentication, but the prompt would not accept the users' logins. I'm going to go ahead and assume that that isn't the login it is looking for.

Is there a way to disable this on the RadAsyncUpload? Some users have no problems, but some are blocked from adding files.

Best Regards,

Landon
Shinu
Top achievements
Rank 2
 answered on 28 Jun 2011
1 answer
600 views
Dear All,

Please help ...
I have a GridTemplateColumn with Checkbox as below
<telerik:GridTemplateColumn UniqueName="Exist" DataField="Exist" HeaderText="Exist">
                <HeaderStyle Width="37px"/>
                <ItemTemplate>
             <asp:CheckBox id="CheckBox1" checked='<%# IF(Eval("Exist") is DBNull.Value, False, Eval("Exist")) %>' OnCheckedChanged="ToggleRowSelection" AutoPostBack="true" runat="server"></asp:CheckBox>
                </ItemTemplate>
</telerik:GridTemplateColumn>
I have added the following code in grid_ItemDataBound event, because of I want to prompt confirm when user click to Checked/UnChecked
chk.Attributes.Add("onclick", "return confirm('Are you sure?')")

Now this only do OnClick, but not fire OnCheckedChanged event.
Any idea to do both when checkedchanged, Please ?

Thanks and best regards
Naunton
Top achievements
Rank 1
 answered on 28 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?