Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
139 views

Hi there,

I was wondering whether the visual style builder actually supports changing the coloring of icons?  
So I base a new skin of for example Metro Touch, choose a new base color, save all and download the zip.

1. Unfortunately, if you look at the /Common folder, all the sprites (radActionsSprite.png, radFormToggleSprite.png etc) are still the default blue color and not the new base color.

2. Also not too sure about what is supported, since I can successfully get the skin applied (using StyleSheetManager) on some controls but there are serious issues with other controls (RadDatePicker for instance) - both layout and sprite positioning (offsets).

3. Am I supposed to be able to do this simple change (just change the base color) and the skin should just work for all controls?

Magdalena
Telerik team
 answered on 14 Aug 2014
5 answers
357 views
Pls show me how to achieve that in Bar chart as all the bars in the same serie always have  the same color. It can be done automatically in Pie chart but I cannot figure out how to do that in Bar chart apart from manually assigned colors to every single item.

Thanks in advance
Danail Vasilev
Telerik team
 answered on 14 Aug 2014
0 answers
325 views
Hello Team, 

I am using Rad File Explorer with Telerik file version 2012.2.1002.35 in my application. We are using FileSystemContentProvider to override DeleteFile and DeleteDirectory methods. My issue is when I click Delete button on toolbar or using context menu for deleting file or directory, ItemCommand event of Telerik Rad Fileexplorer is never being hit. Hence Delete is not working for me at all.

Browser: IE 9. We tested this in chrome just to confirm if this is issue with IE alone, but in vain. It does not work in Chrome as well. Below is the code written on OnClientDelete of Rad Explorer.

function OnClientDelete(sender, args) {
                document.getElementById("<%=txtfileTag.ClientID%>").value = "";
                LogEvent("Delete: " + args.get_item().get_name());
                setTimeout(function () {
                    sender.refresh();
                }, 200);
            }

protected void RadTrdFile_ItemCommand(object sender, RadFileExplorerEventArgs e)
    {
        objcommon.InsErrorLog("Entered Item Command", 2, "EditTeardown.aspx", "RadTrdFile_ItemCommand", Convert.ToInt32(Session["UserId"]), "Chrome or IE");
 
        try
        {
            int m_countFileexists = 0;
            int m_fileID = 0;
            string m_fileName = "";
            int m_count = 0;
            int m_count1 = 0;
            string m_actualPath = "";
            if (e.Command == "UploadFile" || e.Command == "DeleteFile" || e.Command == "MoveFile")
            {
                string m_fileNamePath = e.Path.ToString();
                BllAdministration ObjAdministration = new BllAdministration();
                // ObjAdministration.MastersId = 7;
                //ObjAdministration.UserId = Convert.ToInt32(Session["UserId"]);
                ObjTearDown.Type = 7;
                DataTable tb = ObjTearDown.LoadMasters();
                //  DataTable tb = ObjAdministration.LoadMasterFileValues();
 
                foreach (DataRow dr in tb.Rows)
                {
                    if (e.Path.ToUpper().Contains(dr["Description"].ToString().ToUpper().Trim()))
                    {
                        //  m_fileID = Convert.ToInt32(dr["MastersValueId"]);
                        m_fileID = Convert.ToInt32(dr["MasterFileValueId"]);
                        m_fileName = dr["Description"].ToString().Trim();
                        break;
                    }
                }
                if (m_fileID != 0)
                {
                    int m_index = e.Path.ToUpper().IndexOf(m_fileName.ToUpper());
                    if (File.Exists(e.Path))
                    {
                        m_countFileexists = 1;
 
                    }
                    string m_direcoryPath = e.Path.ToUpper().Substring(0, m_index + m_fileName.Length);
                    m_direcoryPath = m_direcoryPath.Replace("/", "\\");
 
 
 
                    DirectoryInfo m_dirInfo = new DirectoryInfo(Server.MapPath(m_direcoryPath));
                    IEnumerable<FileInfo> m_totalFiles = objcommon.GetFilesRecursive(m_dirInfo, "*.*");
                    m_count = m_totalFiles.Count();
                    m_count1 = m_totalFiles.Count();
 
                }
            }
 
            switch (e.Command)
            {
                case "UploadFile":
                    {
 
                        if (m_countFileexists == 0)
                        {
                            string m_FilePath1 = Server.MapPath(e.Path);
                            string dirName1 = new DirectoryInfo(m_FilePath1).Name.Replace('&', '_');
                            string fileExtention = Path.GetExtension(m_FilePath1);
                            if (fileExtention.ToLower() == ".jpg" || fileExtention.ToLower() == ".jpeg"
                                || fileExtention.ToLower() == ".gif" || fileExtention.ToLower() == ".png"
                                || fileExtention.ToLower() == ".bmp" || fileExtention.ToLower() == ".tif" || fileExtention.ToLower() == ".tiff")
                            {
                                m_count = m_count + 2;
 
                            }
                            else
                            {
                                m_count = m_count + 1;
                            }
 
                        }
                        if (m_fileID != 0)
                        {
                            ObjTearDown.MasterFileID = m_fileID;
                            ObjTearDown.MappedFolderPath = m_actualPath;
                            ObjTearDown.FileCount = m_count;
                            ObjTearDown.TearDownId = Request.QueryString["TRDID"];
                            ObjTearDown.UpdateMasterFileCount();
 
                            ObjTearDown.TearDownId = Request.QueryString["TRDID"];
                            ObjTearDown.MappedFolderPath = m_fileName;
                            ObjTearDown.FileCount = m_count;
                            ObjTearDown.InsTRDFiles();
 
 
                        }
                        if (m_count1 == 0)
                        {
                            DataTable dt = objcommon.GetMailSettings();
                            if (dt.Rows.Count > 0)
                            {
                                if (dt.Rows[0]["IsTRDUploadEnabled"].ToString() == "True")
                                {
                                    SendMailDataUpload(Request.QueryString["TRDID"].ToString(), m_fileName, Request.QueryString["TRDID"].ToString(), hdnwrno.Value);
 
                                }
                            }
                        }
 
                        string m_FilePath = Server.MapPath(e.Path);
                        string dirName = new DirectoryInfo(m_FilePath).Name.Replace('&', '_');
                        objcommon.InsAuditLog("U", "tbl_TRD", Request.QueryString["TRDID"].ToString(),
                            Request.QueryString["TRDID"].ToString(), Request.QueryString["TRDID"].ToString(),
                            "UploadFile", null, dirName, Convert.ToInt32(Session["UserId"]));
 
                    } break;
                case "MoveDirectory":
                    {
                        Session["Id"] = Request.QueryString["TRDID"].ToString();
                        Session["Type"] = "T";
                        string foldername = hdnFoldername.Value;
                        string oldfoldername = new DirectoryInfo(hdnoldFoldername.Value).Name;
 
                        objcommon.InsAuditLog("U", "tbl_TRD", Request.QueryString["TRDID"].ToString(),
                            Request.QueryString["TRDID"].ToString(), Request.QueryString["TRDID"].ToString(),
                            "MoveDirectory", oldfoldername, foldername, Convert.ToInt32(Session["UserId"]));
                    } break;
                case "CreateDirectory":
                    {
                        string foldername = hdnFoldername.Value;
                        objcommon.InsAuditLog("U", "tbl_TRD", Request.QueryString["TRDID"].ToString(),
                            Request.QueryString["TRDID"].ToString(), Request.QueryString["TRDID"].ToString(),
                            "CreateDirectory", "", foldername, Convert.ToInt32(Session["UserId"]));
 
                    } break;
                case "DeleteDirectory":
                    {
 
                        DirectoryInfo[] m_SubDir;
                        FileInfo[] m_files;
                        int m_SubDirCount = 0;
                        int m_DirCount = 0;
                        string m_FilePath = Server.MapPath(e.Path); //~results/MappedFoldertest/" +
                        DirectoryInfo m_Dir = new DirectoryInfo(m_FilePath);
                        string dirName = new DirectoryInfo(m_FilePath).Name;
 
                        if (m_Dir.GetDirectories().Length > 0)
                        {
                            m_SubDir = m_Dir.GetDirectories();
                            m_SubDirCount = m_SubDir.Length;
                        }
 
                        if (m_Dir.GetFiles().Length > 0)
                        {
                            m_files = m_Dir.GetFiles();
                            m_DirCount = m_files.Length;
 
                        }
                        objcommon.InsErrorLog("Count" + m_DirCount.ToString(), 2, "EditTeardown.aspx", "Delete Directory", Convert.ToInt32(Session["UserId"]), "Chrome or IE");
 
                        if (m_DirCount > 0 || m_SubDirCount > 0)
                        {                           
                            //ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "alert", "alert('The folder cannot be deleted.Sub Folder(s) or File(s) exist in this folder.')", true);
                            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "alert", "alert('The folder cannot be deleted.Sub Folder(s) or File(s) exist in this folder.')", true);
                            e.Cancel = true;
                            return;
                        }
                        else
                        {
                            string foldername = hdnFoldername.Value;
                            objcommon.InsAuditLog("D", "tbl_TRD", Request.QueryString["TRDID"].ToString(),
                                Request.QueryString["TRDID"].ToString(), Request.QueryString["TRDID"].ToString(),
                                "DeleteDirectory", "", dirName, Convert.ToInt32(Session["UserId"]));
                        }
                    } break;
                case "DeleteFile":
                    {
                        if (m_fileID != 0)
                        {
                            // m_count = m_count - 2;
                            string m_FilePath1 = Server.MapPath(e.Path);
                            string dirName1 = new DirectoryInfo(m_FilePath1).Name.Replace('&', '_');
                            string fileExtention = Path.GetExtension(m_FilePath1);
                            if (fileExtention.ToLower() == ".jpg" || fileExtention.ToLower() == ".jpeg"
                                || fileExtention.ToLower() == ".gif" || fileExtention.ToLower() == ".png"
                                || fileExtention.ToLower() == ".bmp" || fileExtention.ToLower() == ".tif" || fileExtention.ToLower() == ".tiff")
                            {
                                m_count = m_count - 2;
 
                            }
                            else
                            {
                                m_count = m_count - 1;
                            }
                            ObjTearDown.MasterFileID = m_fileID;
                            ObjTearDown.MappedFolderPath = m_actualPath;
                            ObjTearDown.FileCount = m_count;
                            ObjTearDown.TearDownId = Request.QueryString["TRDID"];
                            ObjTearDown.UpdateMasterFileCount();
 
                            string path = e.Path;
                            path = path.Substring(1, path.Length - 1);
                            int index = path.IndexOf('/');
                            path = path.Substring(index);
 
                            ObjTearDown.FilePath = path;
                            ObjTearDown.TearDownId = Request.QueryString["TRDID"];
                            ObjTearDown.DelTRDAnalysisFileTag();
 
 
                            ObjTearDown.TearDownId = Request.QueryString["TRDID"];
                            ObjTearDown.MappedFolderPath = m_fileName;
                            ObjTearDown.FileCount = m_count;
                            ObjTearDown.InsTRDFiles();
 
                            objcommon.InsErrorLog("Count" + m_count.ToString(), 2, "EditTeardown.aspx", "Delete Files", Convert.ToInt32(Session["UserId"]), "Chrome or IE");
 
 
                        }
                        string m_FilePath = Server.MapPath(e.Path);
                        string dirName = new DirectoryInfo(m_FilePath).Name;
                        objcommon.InsAuditLog("D", "tbl_TRD", Request.QueryString["TRDID"].ToString(),
                            Request.QueryString["TRDID"].ToString(), Request.QueryString["TRDID"].ToString(),
                            "DeleteFile", null, dirName, Convert.ToInt32(Session["UserId"]));
 
 
                    } break;
                case "MoveFile":
                    {
                        Session["Id"] = Request.QueryString["TRDID"].ToString();
                        Session["Type"] = "T";
                        string oldpath = hdnoldFoldername.Value;
                        string newpath = hdnFoldername.Value;
 
                        string[] newpatharray = newpath.Split('/');
                        string newFolder = newpatharray.Last();
                         
 
                        ObjTearDown.FilePath = m_fileName;
                        ObjTearDown.TearDownId = Request.QueryString["TRDID"];
                        ObjTearDown.DelTRDAnalysisFileTag();
 
 
                        ObjTearDown.TearDownId = Request.QueryString["TRDID"].ToString() + "," + m_fileName;
                        ObjTearDown.MappedFolderPath = newFolder;
                        ObjTearDown.FileCount = m_count;
                        ObjTearDown.InsTRDFiles();
                    } break;
                case "CopyFile":
                    {
                        Session["Id"] = Request.QueryString["TRDID"].ToString();
                        Session["Type"] = "T";
                    } break;
            }
            // e.Cancel = true; // Cancel the operation
        }
        catch (Exception ce)
        {
            string BrowserType = Request.Browser.Browser + " " + Request.Browser.Version + " " + Request.Browser.Platform;
            objcommon.InsError(ce.Message.ToString() + "<br/> Method Name : RadTrdFile_ItemCommand <br/> Page Name :EditTeardown.aspx");
            objcommon.InsErrorLog(ce.Message.ToString(), 2, "EditTeardown.aspx", "RadTrdFile_ItemCommand", Convert.ToInt32(Session["UserId"]), BrowserType);
        }
    }

public override string DeleteFile(string path)
    {
        BllCommon objcommon = new BllCommon();
        objcommon.InsErrorLog("In Delete File overriden ", 2, "EditTeardown.aspx", "Delete File", 1, "Chrome or IE");
 
        string physicalPath = MapPath(RemoveProtocolNameAndServerName(path));
        try
        {
            if (File.Exists(physicalPath))
            {
                File.Delete(physicalPath);
                try
                {
                    File.Delete(physicalPath.Replace(".thumb", ""));
                }
                catch
                {
                    File.Delete(physicalPath.Replace(".thumb", ""));
                }
            }
        }
        catch (UnauthorizedAccessException)
        {
            return "NoPermissionsToDeleteFile";
 
        }
        return string.Empty;
    }
 
    public override string DeleteDirectory(string path)
    {
        BllCommon objcommon = new BllCommon();
        objcommon.InsErrorLog("In Delete Directory overriden ", 2, "EditTeardown.aspx", "Delete Directory", 1, "Chrome or IE");
 
        string absolutePath = MapPath(RemoveProtocolNameAndServerName(path));
        try
        {
            if (Directory.Exists(absolutePath))
            {
                if (Directory.GetFiles(absolutePath).Length == 0)
                    Directory.Delete(absolutePath);
            }
        }
        catch (UnauthorizedAccessException)
        {
            return "NoPermissionsToDeleteFile";
        }
 
        return string.Empty;
    }



Vani
Top achievements
Rank 1
 asked on 14 Aug 2014
7 answers
227 views
Hi,

When pasting content from MS Word in Chrome, FF and IE 11, I am prompted with a popup which suggests to clean the content as it comes from Word. In Chrome and FF it comes in clean, however in IE 11, it seems that even if you choose to clean it, it comes in with extra html. I would expect that pasting would end up with the same results regardless of the browser?

Thanks,

Leon
Ianko
Telerik team
 answered on 14 Aug 2014
1 answer
139 views
Hello,

I am working on a project with a RadListBox.
In the RadListBox there is a list of items.
The user can change a location of an item inside the list, by drag-and-drop.
I am trying to get the new order of the list, after such a change.
I get the new order only after the first change, but not after the following changes. [View video]

How can I get the new order also after multiple changes?

 
Thanks,

Daniel.
Daniel
Top achievements
Rank 1
 answered on 14 Aug 2014
3 answers
176 views
i am opening a radwindow frim within a radajaxpanel.
The moment the window opens it directly is closed automatically again.

As seen here: http://hama.ontwikkelruimte.nl

Put something in the shopcart and go to Warenkorb, try to login, there is the problem.

Any clue?

Marc
Marin Bratanov
Telerik team
 answered on 14 Aug 2014
1 answer
139 views
This demo page: http://demos.telerik.com/aspnet-ajax/searchbox/examples/programming/serverevents/defaultcs.aspx
shows that the RadSearchBox has a server event called OnDataRequesting. However, I do not ever see that event fire in the event log on the demo page. Also, I do not see that event in the version of the RadSearchBox control I have (2014.1.225.40).  I have found no demos that refer to that event.
Using the demo page and Fiddler, I see that when I type in a character, there IS a postback but no event is raised so I need to use Init or Load to capture it.

I expected that there would be an event similar to the ItemsRequested event in the RadComboBox which is working fine for me (but I want something a little more 'searchy' and the RadSearchBox looked good).

So, questions:

1. Is there supposed to be an OnDataRequesting server event in the RadSearchBox?
2. If so, is it supposed to behave similarly to the ItemsRequested event in the RadComboBox? I.e. it fires when a character is typed into the text box.
3. I have already looked at the version history and have seen no mention of this. Has something changed in this area since version 2014.1.225.40?
4. The RadComboBox makes it easy to provide paged results. Is this possible using the RadSearchBox?
5. The RadComboBox automatically highlights the matched texts. Is this possible using the Rad SearchBox?

Thanks.


Dimitar Terziev
Telerik team
 answered on 14 Aug 2014
1 answer
223 views
Hi all,

I have a RadGrid with UserControl as editmode, i set a timer to tick every 3 seconds to check the RadGrid's editmode whether if it's close, if yes, the timer will auto close the page. 
Currently it works well, but the UserControl editmode will "flicks" / "flash" every 3 seconds when the timer ticks, all the data in the RadGrid will refresh with the original value...
Any way to stop the "flicks" / "flash" when the timer ticks?

Thank you.

Best regards,
George

Princy
Top achievements
Rank 2
 answered on 14 Aug 2014
3 answers
474 views
Hi,

We use RadFilter to create a number of reports, some of which filter by date. In some instances we don't want to manually select a date but to simply set it to be today's date so that the report can give us all of today's appointments, for example.

Rather than manually selecting a date in a date fields, is it possible to simply input something like 'today' so that every time we load the report, it automatically sets the date for that field to be today?

Thanks

Tim
Maria Ilieva
Telerik team
 answered on 14 Aug 2014
1 answer
535 views
I'm want to insert a new row directly into the client data source doing something like this:

var data = [{ "ID": 1, "Text": "Text1" }, { "ID": 2, "Text": "Text2" }];
var mtv = $find("RadGrid1").get_masterTableView();

var items = mtv.get_dataSource(); // this won't work because is null
//var items = mtv.get_dataItems(); // this is obvious way to do it, but I want to insert a json object

var newItems = items.splice(3, 0, data); // insert object

mtv.set_dataSource(items); // (item actually get's inserted into orginal items,and not newItems - bit result is same either way)
mtv.dataBind();

However:

1) The data source is null - I guess upon rendering it gets reset
2) I can add items to the 'dataItems' array, but I guess this has to be formatted as HTML.

Is it possible to add a JSON object to the data source and rebind the grid?






Angel Petrov
Telerik team
 answered on 14 Aug 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?