Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
193 views

Hi, I have a radmenu and I want to remove the default gray background-image (PFA sample image), I tried few ways but that is also removing the arrows from the submenu, I want the arrows to be present, I only want the gray background image to be removed, below is the custom css.

Also please let me know how to change the arrow color for the Radmenu_Default skin

.RadMenu_Default, .RadMenu_Default .rmRootGroup, .RadMenu_Default a.rmLink {
font-size: 16px !important;
color: #ebe3e3 !important;
border: 0px !important;
background-color: #8F0800 !important;
background-image: none !important;
}

.RadMenu_Default .rmLink:hover, .RadMenu_Default .rmFocused,
.rmLink .RadMenu_Default .rmSelected, .RadMenu .rmGroup .rmItem a.rmLink,
.RadMenu_Default a.rmExpanded, .RadMenu_Default a.rmExpanded:hover, .RadMenu_Default .rmGroup {
background-color: #C12610 !important;
background-image: none !important;
background-position: 0px 0px !important;
border: 0px !important;
}

Ivan Zhekov
Telerik team
 answered on 23 Nov 2015
1 answer
132 views

Hi Team,

DatePicker values are getting copied from one row to other when selected to edit in RadGrid BatchEdit model.

First, I clicked in DatePicker column in first row and clicked in DatePicker column in second row. The value of DatePicker in first row is getting copied to DatePicker in second row.

I am having following code in BatchEditOpened event, here I am just trying to set minimum date for StartDate datepicker.

function BatchEditOpened(sender, args) {

switch (args.get_columnUniqueName()) {

   case "StartDate":
      var dtStartDate = $find($telerik.$("[id$='dtStartDate']").attr("id"));                       
        if (dtStartDate.get_selectedDate()) {
           var minDate = new Date(dtStartDate.get_selectedDate());
           minDate.setDate(minDate.getDate());
           dtStartDate.set_minDate(minDate);
         }

       break;

}

Please let me know why it is copying value instead of just setting minimum date. If I remove code in BatchEditOpened, it is not copying values.

Konstantin Dikov
Telerik team
 answered on 23 Nov 2015
1 answer
156 views

Hi 

I have a Rad grid. that give me a filter expression like '([Status] = 'Completed')'.But RadFilter.Load Settings() need 'AAEAAAD/////AQAAAAAAAAAQAQAAAAMAAAAKCQIAAAAJAwAAABACAAAAAgAAAAkEAAAACQUAAAAMBgAAAFhUZWxlcmlrLldlYi5VSSwgVmVyc2lvbj0yMDEzLjMuMTExNC40MCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj0xMjFmYWU3ODE2NWJhM2Q0BQMAAAAmVGVsZXJpay5XZWIuVUkuUmFkRmlsdGVyR3JvdXBPcGVyYXRpb24BAAAAB3ZhbHVlX18ACAYAAAAAAAAADAcAAABNU3lzdGVtLldlYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFBAAAABJTeXN0ZW0uV2ViLlVJLlBhaXICAAAABUZpcnN0BlNlY29uZAICBwAAAAgIAQAAAAgIAAAAAAEFAAAABAAAAAkIAAAACQkAAAABCAAAAAQAAAAGCgAAACJSYWRGaWx0ZXJFcXVhbFRvRmlsdGVyRXhwcmVzc2lvbmAxBgsAAAANU3lzdGVtLlN0cmluZxAJAAAAAgAAAAkMAAAABg0AAAAGU3RhdHVzBAwAAAAcU3lzdGVtLkNvbGxlY3Rpb25zLkFycmF5TGlzdAMAAAAGX2l0ZW1zBV9zaXplCF92ZXJzaW9uBQAACAgJDgAAAAIAAAACAAAAEA4AAAAEAAAACQ8AAAAGEAAAAAlDb21wbGV0ZWQNAgUPAAAAG1N5c3RlbS5XZWIuVUkuSW5kZXhlZFN0cmluZwEAAAAGX3ZhbHVlAQcAAAAGEQAAAAVWYWx1ZQs=' this kind of data but i can not get it from view. so please help me to How i get This kind of data From radgrid Or how i load the RadFilter using the Filter expression like '([Status] = 'Completed')' 
thanks you

Viktor Tachev
Telerik team
 answered on 23 Nov 2015
1 answer
59 views

Hi,

I used RadTreelist on my web forms with load on demand functionality to bind a lot of items. It works fine except one issue.

When i expand from 1st to 3rd level, it's fine. But when i try to expand 4th level item, child item of 4th level doesn't appear correctly.

If 4th level item has 10 child items, when i expand the 4th item, just appear 1~2 child item only.

I checked http://demos.telerik.com/aspnet-ajax/treelist/examples/databinding/loadondemand/defaultcs.aspx demo page. But i can't find 5th level items or more.

How can i fix it? Please help me.

Thanks.

Viktor Tachev
Telerik team
 answered on 23 Nov 2015
1 answer
204 views

May have encountered a bug with validation on RadMaskedTextbox with RequiredFieldValidator, where the textbox remains invalid despite a valid input being entered.

Steps to replicate:

- Enter a complete, valid number

- Click outside of textbox

- Click back into textbox and delete some numbers

- Click outside of textbox to get the validation message

- Now enter a complete, valid number again - still treated as invalid and error message remains displayed.

 Link to video screencast

 

Markup:

 

<h4>Telephone:</h4>
 
<telerik:RadMaskedTextBox ID="tbTelephone" runat="server" Width="164px" Skin="Silk" Mask="###########" RequireCompleteText="true" />
 
<asp:RequiredFieldValidator ID="rfvTelephone" runat="server" Display="Dynamic" CssClass="validation" Text="*Required" ControlToValidate="tbTelephone" />

 

Maria Ilieva
Telerik team
 answered on 23 Nov 2015
1 answer
269 views

Hi all,

How would I go about showing/hiding the CommandItem for a detail table from an external button in the code behind.Our webapp has a set of "new", "edit" & "save" buttons created in a masterpage which are enable/disabled based on the users access rights. I want to be able to allow a user to create a new record within a radgrid at both the master table and detail table level. I can enable the CommandItem for the master table but i cant do it for the detail tables. I've tried looping through the NestedTableView items but on a rebind the grid doesn't change

 

Thanks Matt

 

 

Eyup
Telerik team
 answered on 23 Nov 2015
1 answer
109 views

I have a problem with firefox, I'm using this event(OnClientCommandExecuting) to cancel some(not all) shortcuts and works perfectly with chrome, when i try with firefox works very well with the shorcuts, except for the Shift+Enter  when i press this key combination in firefox the event is not even fired, could you help me please?

 

function OnClientCommandExecuting(editor, args)
{
     var liTag = editor.getSelectedElement();
     var commandName = args.get_commandName();
 
     .....
}

Ianko
Telerik team
 answered on 23 Nov 2015
6 answers
526 views
I have the following code.

  <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" HeaderStyle-Width="50" EditImageUrl="~/images/edit.gif" /> 
 
more....grid.......code  
 
<EditFormSettings UserControlName="~/controls/Edit.ascx" EditFormType="WebUserControl">  
    <EditColumn UniqueName="EditCommandColumn1">  
    </EditColumn> 
</EditFormSettings> 

How do I pass the parameters in the grid like the column name, id, and date to the ascx page?

Thanks!
Eyup
Telerik team
 answered on 23 Nov 2015
3 answers
149 views

Hi,

After installing 2015.3.1111.45 I observed that RadComboBoxes with Filter=Contains setting will not fire after user deletes text and presses enter.

Scenario:

RadComboBox populated with data, with settings Filter="Contains".

When user selects item - event fires. When user deletes entered text and presses ENTER event does not fire.

 Basic markup:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
</head>
<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" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
         
    </telerik:RadScriptManager>
    <script type="text/javascript">
        //Put your JavaScript code here.
    </script>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    <div>
        <telerik:RadComboBox Filter="Contains" ID="RadComboBox1" runat="server" OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged" AutoPostBack="true" DataSourceID="LinqDataSource1" DataTextField="du" DataValueField="id"></telerik:RadComboBox>
        <asp:LinqDataSource ID="LinqDataSource1" OnSelecting="LinqDataSource1_Selecting" runat="server"></asp:LinqDataSource>
        <asp:Label ID="lblResult" runat="server" Text=""></asp:Label>
    </div>
    </form>
</body>
</html>

 

Sample code with sample data. 

using System;
using System.Web.UI.WebControls;
using System.Linq;
using Telerik.Web.UI;
using System.Collections.Generic;
 
public partial class Default : System.Web.UI.Page
{
 
    protected void LinqDataSource1_Selecting(object sender, LinqDataSourceSelectEventArgs e)
    {
        List<int> a = new List<int>();
 
        for(int i = 1; i < 10; i++)
        {
            a.Add(i);
        }
 
        var q = from b in a
                select new { id = b, du = "2 * " + b.ToString() };
 
        e.Result = q;
    }
 
    protected void RadComboBox1_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        if (RadComboBox1.Items.Any())
        {
            lblResult.Text = (Int32.Parse(RadComboBox1.SelectedValue)*2).ToString();
        }
    }
}
 â€‹

Expected behaviour:

 1. User selectes "2 * 2=" and result is shown as 4

2. User deletes selected text in ComboBox and presses ENTER. ComboBox should return to the first value on list ("2*1=") and show result of "2".

  

Also with the same build:

Bootstrap skin loses hover style for combobox list (meaning items on list do not show different background color when mouse is over particular item of this list).

 

Jacek

 

Magdalena
Telerik team
 answered on 23 Nov 2015
1 answer
635 views

I just want to post some of my code and have some eyes on it that may spot something I'm doing wrong. In general, there are just times where a user isn't able to upload a document. A second try usually works though. Literally no idea how to explain this.

 

The other problem I have is seemingly harder to deal with... Sometimes a document gets uploaded (seems to always be a .docx) and when trying to download the document Word attempts to open but says the file is corrupt. I am storing the documents as a VARBINARY(MAX) in sql server. The content type is getting stored as "application/vnd.openxmlformats-officedocument.wordprocessingml.document" which I believe is correct. The one odd thing I noticed one time is that... a particular document was uploaded.  I set a breakpoint when trying to download and saw the "content length" was a specific value. Well, I uploaded this same document to the system and when hitting that same breakpoint the content length value had changed. So one question I have is - does uploading the same document from a different machine (and perhaps a different user) really change the length of the byte array?! I wouldn't think so. I'm not sure if this is even relevant information to my problem but it was just something I noticed and couldn't account for why it happened. And for what its worth, whenever I upload a particular document myself that was a corrupted file after someone else had uploaded, the file is always fine for me. So it's not like the file itself is actually corrupted.

 

Any reason why the radasyncupload might be making these files corrupted? Or is there anything in my code that could explain it?

 

code for uploading:

foreach (UploadedFile File in ClientAgreementUpload.UploadedFiles)
            {
                try
                {
                    byte[] FileData = new Byte[File.ContentLength];
                    File.InputStream.Read(FileData, 0, (int)File.ContentLength);
                    Dictionary<string, object> DocParameters = new Dictionary<string, object>();
                    DocParameters.Add("PreviousDocumentId", DBNull.Value);
                    DocParameters.Add("RequestGroupId", RequestGroupId);
                    DocParameters.Add("Title", File.FileName.ToString());
                    DocParameters.Add("ContentType", File.ContentType.ToString());
                    DocParameters.Add("AgreementDocument", FileData);
                    DocParameters.Add("Comments", DocumentCommentsTextbox.Text);
                    DocParameters.Add("FinalExecuted", 0);
                    DocParameters.Add("SubmitBy", CommonClass.UserName(Request));
                    Session["id"] = CommonClass.Scalar("InsertDocument", ConfigurationManager.ConnectionStrings["ContractAdminConnection"].ToString(), DocParameters);
                }
                catch (Exception error)
                {
                    ...error handling stuff
                }
                
            }


CommonClass.Scalar looks like this:

public static object Scalar(string mySQL, string strConn, Dictionary<string, object> Parameters)
        {
            try
            {
                SqlConnection mySqlConnection = new SqlConnection(strConn);
                SqlCommand mySqlCommand = new SqlCommand(mySQL, mySqlConnection);
                mySqlCommand.CommandType = CommandType.StoredProcedure;
                foreach (KeyValuePair<string, object> Parameter in Parameters)
                {
                    var parameter = Parameter;
                    mySqlCommand.Parameters.Add(new SqlParameter(parameter.Key, parameter.Value));
                }
                object myObject = new object();
                mySqlConnection.Open();
                myObject = mySqlCommand.ExecuteScalar();
                mySqlConnection.Close();
                return myObject;
            }
            catch (System.Exception ex)
            {
                ...error handling stuff
            }
        }

code for downloading... 
protected void Page_Load(object sender, EventArgs e)
        {
            Dictionary<string, object> Parameters = new Dictionary<string, object>();
            Parameters.Add("AgreementDocumentId", Request.QueryString["DownloadParameter"]);
            DataTable AgreementDocumentTable = CommonClass.Table("GetAgreementDocumentBinaryByRequestId", ConfigurationManager.ConnectionStrings["ContractAdminConnection"].ToString(), Parameters);

            Response.Clear();
            Response.Buffer = true;
            Response.Charset = "";
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            Response.ContentType = AgreementDocumentTable.Rows[0]["ContentType"].ToString();
            Response.AppendHeader("Content-Disposition", "attachment; filename=" + AgreementDocumentTable.Rows[0]["Title"].ToString());
            Response.AddHeader("Content-Length", ((byte[])AgreementDocumentTable.Rows[0]["AgreementDocument"]).Length.ToString());
            Response.Flush();
            Response.BinaryWrite((byte[])AgreementDocumentTable.Rows[0]["AgreementDocument"]);
            Response.End();
        }

CommonClass.Table is nothing special, just returns a datatable



Here is C# code for the initial call to download a doc: 
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Download", String.Format("GotoDownloadPage(\"./Download.aspx?DownloadParameter={0}\");", Convert.ToInt32(e.CommandArgument)), true);

here is the javascript code for downloading docs:
function GotoDownloadPage(urlString) {
            console.log(urlString);
            window.location = urlString;
        }
Peter Filipov
Telerik team
 answered on 23 Nov 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?