Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
140 views
i'm using following code to bind to RadGrid

boundColumn = new GridBoundColumn();
            boundColumn.DataField = "ElectronicLocation";
            boundColumn.HeaderText = "Electronic Location";
            boundColumn.UniqueName = "ElectronicLocation";
            boundColumn.HeaderStyle.Width = Unit.Pixel(220);
            boundColumn.ItemStyle.BackColor = System.Drawing.Color.AliceBlue;
            RadGrid1.MasterTableView.Columns.Add(boundColumn);

"ElectronicLocation" binds a file path which retrieved from sql query (ex:E:/Docs/aa.pdf).i need to display only the file name on the grid.is there any option available for this? 
Chamara
Top achievements
Rank 1
 answered on 01 May 2012
0 answers
152 views
I am using RadDatePicker in an application page.  The issue is that the control expands to the full page width and displays with block format instead of inline when browsing the page in IE9's compatibility mode.  How do I fix this behavior?

Markup:
<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RadDateTest.aspx.cs" Inherits="Test.SharePoint.Layouts.RadDateTest" DynamicMasterPageFile="~masterurl/default.master" %>
 
<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
 
</asp:Content>
 
<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    <asp:Panel ID="pnlControls" runat="server">
    </asp:Panel>
</asp:Content>
 
<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
Application Page
</asp:Content>
 
<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >
My Application Page
</asp:Content>


C#:
using System;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
 
namespace Test.SharePoint.Layouts
{
    public partial class RadDateTest : LayoutsPageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            CreateDateField(0, "One", false);
            CreateDateField(1, "Two", true);
        }
 
        private void CreateDateField(int ID, string name, bool isRequired)
        {
            // Creates a lable with the name of the selection...
 
            Label lbl = new Label();
            lbl.Width = 160;
            lbl.ID = "lblItem" + ID.ToString();
            lbl.Text = name + ":";
            lbl.Style.Add("font-weight", "700");
            this.pnlControls.Controls.Add(lbl);
 
            // Creates a date picker text box
            RadDatePicker txt = new RadDatePicker();
            txt.Width = 230;
            txt.ID = "datItem" + ID.ToString();
            txt.Style.Add("margin-top", "3px");
            txt.Calendar.ShowRowHeaders = false;
            txt.ShowPopupOnFocus = true;
 
            this.pnlControls.Controls.Add(txt);
 
            // If it is required, then add a lable showing its required...
            if (isRequired)
            {
                Label lblReq = new Label();
                lblReq.ID = "lblRequired" + ID.ToString();
                lblReq.Text = "*";
                lblReq.Style.Add("margin-left", "15px");
                lblReq.Style.Add("color", "Red");
                this.pnlControls.Controls.Add(lblReq);
            }
 
            // Add a new lable for a new line feed in HTML.
            this.pnlControls.Controls.Add(new Label() { Text = "<br />" });
        }
    }
}
James
Top achievements
Rank 1
 asked on 01 May 2012
2 answers
134 views
I am trying to use the RadEditor to create a PDF of html that was saved earlier using an HttpHandler. No matter what I try I get a null reference exception.
Is there any reason this should not work? If not, any ideas what I could be missing?

Here is the code I am using currently. I just put this together for testing any help is much appreciated!
public void ProcessRequest(HttpContext context)
      {
          var editor = new Telerik.Web.UI.RadEditor();
 
          editor.ContentFilters = Telerik.Web.UI.EditorFilters.DefaultFilters | Telerik.Web.UI.EditorFilters.PdfExportFilter;
 
          //editor.ExportContent += new Telerik.Web.UI.EditorExportContentEventHandler(editor_ExportContent);
 
          editor.ExportSettings.FileName = "cv";
 
          editor.ExportSettings.Pdf.Title = "TEST";
 
          editor.Content = "<b>HTML</b>";
 
          editor.ExportToPdf();
          
          context.Response.Write("H");
      }

ITLackey
Top achievements
Rank 1
 answered on 30 Apr 2012
1 answer
62 views
i'm using a custom provider to prevent the control from listing a settings file in each folder. it works fine in my development environment but on the live server if the custom provider is used, the control will not list any files under a folder. the wait indicator spins and spins and the files never load. i tested the control on the live server without the custom provider and it works fine.  i'm using the provided example for the custom provider and did not make any changes other than the IsFiltered method. any ideas?

public class CustomProvider : FileSystemContentProvider

    {

        public CustomProvider(HttpContext context, string[] searchPatterns, string[] viewPaths, string[] uploadPaths, string[] deletePaths, string selectedUrl, string selectedItemTag)

            : base(context, searchPatterns, viewPaths, uploadPaths, deletePaths, selectedUrl, selectedItemTag)

        { }

        public override DirectoryItem ResolveDirectory(string path)

        {

            DirectoryItem originalFolder = base.ResolveDirectory(path);

            FileItem[] originalFiles = originalFolder.Files;

            List<FileItem> filteredFiles = new List<FileItem>();

            // Filter the files

            foreach (FileItem originalFile in originalFiles)

            {

                if (!this.IsFiltered(originalFile.Name))

                {

                    filteredFiles.Add(originalFile);

                }

            }

            DirectoryItem newFolder = new DirectoryItem(originalFolder.Name, originalFolder.Location, originalFolder.FullPath, originalFolder.Tag, originalFolder.Permissions, filteredFiles.ToArray(), originalFolder.Directories);

            return newFolder;

        }

        public override DirectoryItem ResolveRootDirectoryAsTree(string path)

        {

            DirectoryItem originalFolder = base.ResolveRootDirectoryAsTree(path);

            DirectoryItem[] originalDirectories = originalFolder.Directories;

            List<DirectoryItem> filteredDirectories = new List<DirectoryItem>();

            // Filter the folders 

            foreach (DirectoryItem originalDir in originalDirectories)

            {

                if (!this.IsFiltered(originalDir.Name))

                {

                    filteredDirectories.Add(originalDir);

                }

            }

            DirectoryItem newFolder = new DirectoryItem(originalFolder.Name, originalFolder.Location, originalFolder.FullPath, originalFolder.Tag, originalFolder.Permissions, originalFolder.Files, filteredDirectories.ToArray());

            return newFolder;

        }

        private bool IsFiltered(string name)

        {

            return name == Web.SETTINGS_FILENAME;

        }

Warren
Top achievements
Rank 1
 answered on 30 Apr 2012
2 answers
1.7K+ views
Hi,
 we are using rad numeric text box for taking numeric value from user. but when i enter 1234 it automatically convertes into 1,234 like but i dont need comma or any thing in that
any help much appreciated
Fabio
Top achievements
Rank 1
 answered on 30 Apr 2012
1 answer
67 views
Hi,

I use telerik rad grid control to display data from my database,
and I found out that the data field property value of the column is exposed on the client side.

I consider this issue as a security issue. I don't want to expose my database scheme to my clients.
Is there a way to prevent this data from being exposed??

Thank you.

Jayesh Goyani
Top achievements
Rank 2
 answered on 30 Apr 2012
3 answers
151 views
I have a radTreeView like this.

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
<telerik:RadTreeView ID="RadTreeView1" CheckBoxes="true" Runat="server"
    OnContextMenuItemClick= "menuClicked" OnClientContextMenuItemClicking="clientMenuClicking"
    OnNodeEdit="RadTreeView1_NodeEdit">
 
<ContextMenus>
        <telerik:RadTreeViewContextMenu ID="ctxMenuAdd" runat="server">
            <Items>
                <telerik:RadMenuItem Value="addNode" Text="Add Node">
                </telerik:RadMenuItem>
                <telerik:RadMenuItem Value="delNode" Text="Delete Node">
                </telerik:RadMenuItem>
                <telerik:RadMenuItem Value="renNode" Text="Rename Node">
                </telerik:RadMenuItem>                 
            </Items>
         </telerik:RadTreeViewContextMenu>
</ContextMenus>
 
</telerik:RadTreeView>
</telerik:RadAjaxPanel>

This is the ContextMenuClicking javascript in client side.

function clientMenuClicking(sender, args)
        {
            var menuItem = args.get_menuItem();
            var treeNode = args.get_node();
            menuItem.get_menu().hide();
 
            switch (menuItem.get_value())
            {
                case "addNode":
                    var windowResult = window.showModalDialog("newNode.html", "Enter Value", "dialogHeight: 300px; dialogWidth: 300px;");                   
                    document.getElementById("HiddenField1").value = windowResult;
                    break;
                case "renNode":
                    treeNode.startEdit();                   
                    break;
            }
                         
        }

finally this is the server side code for onNodeEdit

protected void RadTreeView1_NodeEdit(object sender, RadTreeNodeEditEventArgs e)
    {
        e.Node.Text = e.Text;
    }

The problem is, when I right click on the node and select "Rename" the node turns into a text box only for a split second, then it goes back to normal mode.

It seems when I click the rename option, the client side code is firing and the node is turning into a text box. but then somehow a page postback is occurring which is removing the textbox. 

How can I get rid of the issue?

Marbry
Top achievements
Rank 1
 answered on 30 Apr 2012
5 answers
293 views
Hi Telerik Team,

 I have More than one RadMenus in my application. After update the latest telerik 2011 (Telerik.Web.UI), the RadMenus are behave in a different manner. When I click/open one RadMenu without selecting the its item, click/Open the another RadMenu causes the problem (the first RadMenu items are not collapsing, it remains open). Please see the screenshot attached herewith. I need to collapse the First RadMenu items, if I click/Open the another Radmenu.


Please help me regarding  this.


Thanks,

V. Raguraman.
Kate
Telerik team
 answered on 30 Apr 2012
1 answer
114 views
How can I achieve custom behavior, when postback will only occur upon specific tabs being selected?
Say, there are 3 tabs and I would like to do nothing with the first, do client-js modifications with the 2, and process the click on the 3d button on the server.
Generic solution is requiered in order to support any amount of tabs.
Dimitar Terziev
Telerik team
 answered on 30 Apr 2012
3 answers
328 views
How to hide the horizontal scroll bar in a rad combo box. All the items in the combo box are shorter than the dropdown width of the control, yet a horizontal scroll bar turns up and seems unnecessary.
TonyG
Top achievements
Rank 1
 answered on 30 Apr 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?