Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
41 views
Have added 30px x 30px Image to a RadPanelItem on a RadPanelBar which looks fine until I hover over the item when transparent highlight cuts through the image.  The Height attribute does not seem to increase the size of the highlight, how is this done?

Thanks Darren
Boyan Dimitrov
Telerik team
 answered on 17 Dec 2012
4 answers
87 views
Hi there

I have a radTreeView for which I save the expansion status before postback, using the dynamically generated 'expandedNodes' cookie, as is standard. However, I want to be able replace the cookie with one I have created in my server-side PreRender handler for the radTreeView control.

I can rewrite the value of the cookie OK, the problem is when I do so, and add the new cookie using the same name, the old cookie is not replaced, and I end up with two 'expandedNodes' cookies, which evidentally confuses the radTreeView, which ignores both the cookies. I want to replace the old cookie originally generated by the control, to use the server-side version generated by my code, which as far as I am aware uses the correct technique as follows:

                    Dim cookie As HttpCookie = New HttpCookie("expandedNodes")
                    cookie.Value = newcookievalue    // Setup earlier by constructing '*' delimited expansion route
                    cookie.Expires = DateTime.Now.AddDays(1)
                    Response.Cookies.Add(cookie)

after which, at the end of the PreRender handler, the Response.Cookies collection only has 1 expandedNodes cookie, the one I have just added here. But then after the postback is complete, this cookie is ADDED rather than REPLACING the existing cookie of the same name.

How can I get the radTreeView to use the new cookie, instead of the old one? That is, how can I delete the old cookie, which currently seems to be restored by the radTreeView, in addition to the cookie my code is adding. Is this a problem involving some combination of  the ExpandMode property or the Viewstate?

What would be the best approach to this issue?

Regards

Boyan Dimitrov
Telerik team
 answered on 17 Dec 2012
1 answer
92 views
Hi,
I create a server control that create programmatically a grid  with template columns, filter templates , ecc.
Evrithing works fine, but i noticed that when i introduced the MyFilterTemplate class to generate the filter items for any column, if the item (radcombobox, raddatapicker, ecc) include a clientside event then others controls outside the grid  doesn't work propertly.
For example i have a raddatepicker with a DatePopupButton visible outside the grid , after the page load if i click the popupbutton it shows the popup fine; but after an edit/insert of a value in the grid the popupbutton don't show the popup !.
So, my question is, how a programatically definition of a filter template column with clientside events may cause undesired operation of others controls..

This is the code of my filter template class... that as i said before it works perfectly on the grid.

private class MyFilterColumn : ITemplate
        {
            private Telerik.Web.UI.RadComboBox combo;
            private RadDatePicker _rdp;
            protected CommonParameters.GridTemplateColumnType type;
            protected string fieldvalue;
            protected string fieldtext;
 
 
            public MyFilterColumn(string Fieldvalue, string Fieldtext, CommonParameters.GridTemplateColumnType Type)
            {
                fieldvalue = Fieldvalue;
                fieldtext = Fieldtext;
                type = Type;               
            }
            public void InstantiateIn(Control container)
            {
                switch (type)
                {
                    case CommonParameters.GridTemplateColumnType.ComboOnDemand:
                        {
                            combo = new Telerik.Web.UI.RadComboBox();
                            combo.ID = String.Format("RadComboBox{0}", fieldtext);
                            combo.AppendDataBoundItems = true;
                            if (fieldvalue.Length > 0)
                                combo.DataTextField = fieldtext.Substring(fieldtext.IndexOf(".") + 1, (fieldtext.Length - (fieldtext.IndexOf(".") + 1)));
                            combo.DataValueField = fieldvalue;
                            combo.EmptyMessage = "niente";
                            combo.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Tutti"));
                            combo.Enabled = true;
                            combo.DataBound += combo_DataBound;
                            combo.DataBinding += new EventHandler(combo_DataBinding);
                            combo.OnClientSelectedIndexChanged = String.Format("ClientComboFilterSelected_{0}", fieldvalue);
                            container.Controls.Add(combo);
                        }
                        break;
                    case CommonParameters.GridTemplateColumnType.Date:
                        {
                            _rdp = new RadDatePicker();
                            _rdp.ID = "rdpf" + fieldvalue;
                            _rdp.Width = new System.Web.UI.WebControls.Unit(CommonParameters.RadDatePickerWidth);
                            _rdp.DbSelectedDate = _rdpf_DataBinding((GridItem)container.NamingContainer);
 
 
                            string script = "function ClientDataPickerFilterSelected_" + fieldvalue + "(sender,args) {var tableView=$find(\""
                            + ((GridItem)container.NamingContainer).OwnerTableView.ClientID + "\"); var date= FormatSelectedDate(sender);if (date != '') {  alert('data:' + date); tableView.filter(\""
                            + fieldvalue + "\",date,\"EqualTo\");} else { tableView.filter(\"" + fieldvalue + "\",date,\"NoFilter\");  }   }";
                            // tableView.filter(\"" + fieldvalue + "\" ,date,\"NoFilter\");
                            _rdp.ClientEvents.OnDateSelected = script;
 
                            container.Controls.Add(_rdp);
 
                        } break;
                }
            }
 
            DateTime? _rdpf_DataBinding(GridItem pGriditem)
            {
 
                if ((pGriditem).OwnerTableView.GetColumn(fieldvalue).CurrentFilterValue == string.Empty)
                {
                    return new DateTime?();
                }
                else
                {
                    return DateTime.Parse((pGriditem).OwnerTableView.GetColumn(fieldvalue).CurrentFilterValue);
                }
 
            }
 
            void combo_DataBinding(object sender, EventArgs e)
            {
                combo.DataSource = GetData();
            }
            public IList GetData()
            {
                IList mydata;
 
                using (DMWEntities ctx = new DMWEntities())
                {
                    mydata = (from c in ctx.Cli_for
                              orderby c.Denominazione
                              select new { IdFornitore = c.IdCLiFor, c.Denominazione }).ToList();
                }
                return mydata;
            }
 
            void combo_DataBound(object sender, EventArgs e)
            {
                Page page = HttpContext.Current.Handler as Page;
                Telerik.Web.UI.RadComboBox combo = (Telerik.Web.UI.RadComboBox)sender;
                GridItem container = (GridItem)combo.NamingContainer;
                string script = "function ClientComboFilterSelected_" + fieldvalue + "(sender,args) {var tableView=$find(\""
                    + ((GridItem)container).OwnerTableView.ClientID + "\");if (tableView)alert(args.get_item().get_value());tableView.filter(\""
                    + fieldvalue + "\",args.get_item().get_value(),\"EqualTo\");}";
                ScriptManager.RegisterStartupScript(page, page.GetType(), String.Format("ClientComboFilterSelected_{0}", fieldvalue), script, true);
                combo.SelectedValue = container.OwnerTableView.GetColumn(fieldvalue).CurrentFilterValue;
            }
        }
Maria Ilieva
Telerik team
 answered on 17 Dec 2012
4 answers
522 views
I have developed a module on my website with ASP.NET that is using the RadAsyncUpload control from telerik to upload a file on the server. It works fine locally on my pc but on the server it doesn't. 

I've been using IE and it doesn't give an error...when u select to upload a file the dote becomes red instead of green.
In Chrome It jam on Uploads in progress.

What could I have missed? 

Best regards
Kate
Telerik team
 answered on 17 Dec 2012
5 answers
150 views
hi guys,
i'm loading a web page into radwindow....the my code to close the radwindow is:
function GetRadWindow() {
    var oWindow = null;
    if (window.radWindow) oWindow = window.radWindow;
    else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
    return oWindow;
}
function Close() {
    GetRadWindow().close();
}
 
and i call it form code behind with this code:

Protected Sub Imgbtnclose_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles Imgbtnclose.Click
    Me.ClientScript.RegisterStartupScript(Me.GetType, "", "Close();", True)
End Sub

now in this page there's a radupload object and a custom validator objcect that i used to see the extension error and the code is:

<asp:CustomValidator ID="CustomValidator1" runat="server"
    ClientValidationFunction="validateRadUpload"
    ErrorMessage="Extension error" Font-Bold="True" ForeColor="Red"
    OnServerValidate="CustomValidator1_ServerValidate"
    ValidationGroup="carica"></asp:CustomValidator>
 
    function validateRadUpload(source, e) {
        e.IsValid = false;
        var upload = $find("<%= RadUpload1.ClientID %>");
        var inputs = upload.getFileInputs();
        for (var i = 0; i < inputs.length; i++) {
            //check for empty string or invalid extension    
            if (inputs[i].value != "" && upload.isExtensionValid(inputs[i].value)) {
                e.IsValid = true;
                break;
            }
        }
    }

all this code is ok, but when click on close button for close the radwindow, start the custom validator and start the message error. I would that when click on close button, don't start the validator code but start the code close the radwindow.

Why can i do it?

Thanks












Marin Bratanov
Telerik team
 answered on 17 Dec 2012
2 answers
257 views
Is there a way to get my FilterTemplates aligned with my header (and items)? I've aligned my headers and items left, but the filter is still stuck in the middle. Snippet, details omitted:

<MasterTableView TableLayout="Fixed">
  <Columns>
    <telerik:GridBoundColumn UniqueName=HeaderText="User Name">
      <HeaderStyle HorizontalAlign="Left"/>
      <ItemStyle HorizontalAlign="Left"/>
      <FilterTemplate>
        <telerik:RadTextBox/>
          <telerik:RadScriptBlock >
            <script type="text/javascript">
                  // filter code
            </script>
          </telerik:RadScriptBlock>
      </FilterTemplate>
    </telerik:GridBoundColumn>
  </Columns>
</MasterTableView>

Edit for clarity: Is there a way to do it declaratively?
J
Top achievements
Rank 1
 answered on 17 Dec 2012
1 answer
115 views
How can I get RadGrid into a custom layout. Is the layout (attached) to complicated for RadGrid???
Galin
Telerik team
 answered on 17 Dec 2012
1 answer
48 views
Hi

It seems every time I try to use the RadUpload controls I spend a long time getting it to run correctly, so this time I thought I would go by the book.  (as in 'Getting Started' section of RadUpload online help) but on the live server  (windows 2008 server / iis with asp.net 4.0 on this website) the progress area does not fire, even with files that take several seconds to upload. It works on the localhost but I had to use 24 Meg file to see it.

I used the smart tag in the RadProgress manager to register the RadUploadProgressArea and RadUploadModule.

Where to check now?

I have this code:

ASPX PAGE
 
<telerik:RadProgressManager ID="RadProgressManager1" Runat="server" />
    <telerik:RadUpload ID="RadUpload1" runat="server" AllowedFileExtensions=".doc,.docx,.pdf" ControlObjectsVisibility="RemoveButtons, ClearButtons, AddButton" MaxFileInputsCount="3" MaxFileSize="1100000" OverwriteExistingFiles="True" Skin="WebBlue" TargetFolder="~/members/docs" InputSize="35"></telerik:RadUpload>
     <asp:CustomValidator runat="server" ID="CustomValidator1" Display="Dynamic" ClientValidationFunction="validateRadUpload1"
    OnServerValidate="CustomValidator1_ServerValidate">       
    <span style="color:red; font-weight:bold;"><br />Invalid file: too large or not of type .doc , .docx or .pdf</span>.
</asp:CustomValidator>
     
    
    <asp:Button ID="Button1" runat="server" Text="SUBMIT" />
 
<script type="text/javascript">
        function validateRadUpload1(source, arguments) {
            arguments.IsValid = $find("<%= RadUpload1.ClientID %>").validateExtensions();
    }
</script>
    <telerik:RadProgressArea ID="RadProgressArea1" Runat="server" DisplayCancelButton="True" ProgressIndicators="TotalProgressBar, TotalProgress, RequestSize, FilesCountBar, FilesCount, SelectedFilesCount, CurrentFileName, TimeElapsed, TimeEstimated, TransferSpeed" Skin="WebBlue" Culture="en-GB">
    </telerik:RadProgressArea>
 
CODE BEHIND
 
Protected Sub CustomValidator1_ServerValidate(source As Object, e As System.Web.UI.WebControls.ServerValidateEventArgs) Handles CustomValidator1.ServerValidate
        e.IsValid = (RadUpload1.InvalidFiles.Count = 0)
End Sub
 
WEB.CONFIG
.....
 
<system.web>
 
   <httpHandlers>
       <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" />
       <add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false" />
       <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false" />
       <add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false" />
   </httpHandlers>
 
   <httpModules>
        <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" />
   </httpModules>
 
</system.web>

<system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true">
      <add name="RadUploadModule" preCondition="integratedMode" type="Telerik.Web.UI.RadUploadHttpModule" />
    </modules>
    <handlers>
      <add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" />
      <add name="Telerik_Web_UI_DialogHandler_aspx" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" />
      <add name="Telerik_Web_UI_SpellCheckHandler_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" />
      <add name="Telerik_RadUploadProgressHandler_ashx" verb="*" preCondition="integratedMode" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" />
    </handlers>
    <httpErrors>
      <remove statusCode="404" subStatusCode="-1" />
      <error statusCode="404" prefixLanguageFilePath="" path="/error404.aspx" responseMode="ExecuteURL" />
    </httpErrors>
  </system.webServer>

 
....

Plamen
Telerik team
 answered on 17 Dec 2012
1 answer
81 views
Hi,

I have a design problem with Advanced Form.

If you have smaller resolution, you won’t be able to see the Save and Cancel buttons in the Advanced Form window when creating or editing an appointment .

How can i fix the Advanced Form height and weidth for any resolution.

Thanks,
Chandu.D
Plamen
Telerik team
 answered on 17 Dec 2012
1 answer
84 views
How can i hide the textbox in radasyncupload? 
Princy
Top achievements
Rank 2
 answered on 17 Dec 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?