Telerik Forums
UI for ASP.NET AJAX Forum
10 answers
287 views
Hello!

I read through many documentation pages and also examples and looked up google to make one column formating work, but I didn't have any success so far.

I have a field to store a varchar(14) string called CNPJ.

I created a custom template for inserting/updating value and used RadMaskedTextBox for formating it and it works fine.
Now I wanted to format the display in the grid.

I already tried using GridBoundColumn, GridMaskedColumn, GridTemplateColumn and my last try was this one:

<telerik:GridTemplateColumn DataField="emp_cnpj" HeaderText="CNPJ" SortExpression="emp_cnpj"
                  UniqueName="emp_cnpj">
       <ItemTemplate>
                    <asp:label id="lblCNPJ" runat="server" text='<%# String.Format("{0:00.000.000/0000-00}", Eval("emp_cnpj")) %>' ></asp:label>
       </ItemTemplate>
</telerik:GridTemplateColumn>

I have a number stored as a string in the database as this one: 00000000000000 and need it to be formated as 00.000.000/0000-00.

For the registration date I used as follows:

<telerik:GridBoundColumn DataField="emp_dt_criacao" DataType="System.DateTime" HeaderText="Data Cadastro"
                    SortExpression="emp_dt_criacao" UniqueName="emp_dt_criacao" DataFormatString="{0:dd/MM/yyyy}">
                    <ItemStyle HorizontalAlign="Center" Width="80px" />
                </telerik:GridBoundColumn>

and it's perfectly fine, but I can neither apply a mask for the field mentioned above nor for a telephone field I have (also a varchar field)

Can anyone help me further, please?

Thanks!






Rabeeh
Top achievements
Rank 2
 answered on 14 Sep 2010
6 answers
211 views
Hi,
I would like to know if you plan to add support for using radgrid with dynamicdata metadata. For example gridview has a .SetMetaTable(Metatable) method that allows to load type metadata for display. Is there another solution to do this?
Stephen Naughton
Top achievements
Rank 1
 answered on 14 Sep 2010
1 answer
96 views

We are using RADComboBox with custom Itemtemplate.This renders a <IFRAME> which shows up as 508 non-conformance.Is it possible to suppress the IFRAME? Pls. give suggestions                                  

                                 

Kalina
Telerik team
 answered on 14 Sep 2010
3 answers
176 views
Hi, i have just upgraded to 826 version and now i am getting the error above. Previous version worked good. I use telerik CDN for scriptmanager:

<add key="Telerik.ScriptManager.TelerikCdn" value="Enabled" />
<add key="Telerik.StyleSheetManager.TelerikCdn" value="Enabled" />

this simple page raises the error.

<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
 
        <telerik:RadScriptManager runat="server" ID="Rsm1"></telerik:RadScriptManager>
        <telerik:RadSkinManager ID="SkinMngr" runat="server" Skin="Windows7"></telerik:RadSkinManager>
        <telerik:RadAjaxManager ID="MainAjaxMngr" runat="server"></telerik:RadAjaxManager>
        <telerik:RadFormDecorator runat="server" ID="Fd1" />
 
        <telerik:RadFileExplorer ID="Fexp1" runat="server" Width="520" Height="650" AllowPaging="false">
        </telerik:RadFileExplorer>
         
    </form>
</body>
</html>


code behind is

protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            String basePath = "~/Repo2/";
 
            Fexp1.Configuration.ViewPaths = new string[] { basePath };
            Fexp1.Configuration.DeletePaths = new string[] { basePath };
            Fexp1.Configuration.UploadPaths = new string[] { basePath };
            Fexp1.InitialPath = basePath;
 
            Fexp1.Grid.PageSize = 25;
 
            Fexp1.EnableOpenFile = true;
            Fexp1.DisplayUpFolderItem = true;
            Fexp1.AllowPaging = true;
            Fexp1.EnableCreateNewFolder = true;
            Fexp1.VisibleControls = GetVisibleControls();
 
            Fexp1.Configuration.MaxUploadFileSize = 2 * 1024 * 1024;
        }
    }
 
    private FileExplorerControls GetVisibleControls()
    {
        FileExplorerControls explorerControls = 0;
        //explorerControls |= Telerik.Web.UI.FileExplorer.FileExplorerControls.AddressBox;
        explorerControls |= Telerik.Web.UI.FileExplorer.FileExplorerControls.Grid;
        explorerControls |= Telerik.Web.UI.FileExplorer.FileExplorerControls.Toolbar;
        explorerControls |= Telerik.Web.UI.FileExplorer.FileExplorerControls.TreeView;
        explorerControls |= Telerik.Web.UI.FileExplorer.FileExplorerControls.ContextMenus;
        return explorerControls;
    }

If I do not set the InitialPath no error is raised.

Andrea
Fiko
Telerik team
 answered on 14 Sep 2010
1 answer
81 views
I have a bunch of custom html elements being generated by user controls in my web page, but I'm having a hard time getting them set as targets for the context menu. The following doesn't seem to work:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TelerikTest1._Default" %>
  
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
  
<!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>
</head>
<body>
    <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script language="javascript">
  
        function TokenContextMenu_Clicked(sender, args)
        {
            var menuItemValue = args.get_item().get_value();
            if (menuItemValue == "DefineDictionaryItem")
            {
                alert("Success!");
            }
        }
<form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadContextMenu ID="TokenContextMenu" runat="server" OnClientItemClicked="TokenContextMenu_Clicked">
        <Targets>
            <telerik:ContextMenuTagNameTarget TagName="text_token" />
        </Targets>
        <Items>
            <telerik:RadMenuItem runat="server" Text="Define Dictionary Item" Value="DefineDictionaryItem" />
        </Items>
    </telerik:RadContextMenu>
    <div>
        <text_token id="text_token_1">Thisisatesttoken1!</text_token>
        <text_token id="text_token_2">Thisisatesttoken2!</text_token>
    </div>
    </form>
</body>
</html>
Kalina
Telerik team
 answered on 14 Sep 2010
3 answers
107 views
Hello,

we're trying to support Safari 5 on Windows / Mac for our product using the rad editor.  I'm using some custom code to add the event Drop to the editor which will run anytime the user drag and drops something into the editor.  Works great in all browsers except Safari.  Any ideas?

Using Telerik build: 2009.3.1314.35

var element = document.all ? editor.get_document().body : editor.get_document();
    var eventHandler = "drop";
 
    $telerik.addExternalHandler(element, eventHandler, function(e) {
        setTimeout(function() {
            alert("i worked");
        }, 300);
    });

thanks
Dobromir
Telerik team
 answered on 14 Sep 2010
1 answer
124 views
Hi all,

I wanted to add and reference another icon for my dock so I have added another icon to the CommandSprite gif. It is consistent and should in theory work however when I replace the one located in  Telerik\RadControls for ASP.NET AJAX Q2 2010\ Skins\ Black\Dock\CommandSprite.gif  and then build my project with the new css position pointing to where my icon should be. There isn't an icon there I really would like guidance on this asap, I have attached one of the gifs and an image of what is wrong.

regards,

Ash
Bozhidar
Telerik team
 answered on 14 Sep 2010
8 answers
1.1K+ views
Hi...
I am having a radgrid with a column containing decimal values(ex:2.3,3.4,1.2,3.0).If i give for example 3 or 3.0 for filtering i am not getting the result.Please provide me with a solution.
Pavel
Telerik team
 answered on 14 Sep 2010
1 answer
55 views
Hi Telerik Team, 

           How Can I give  Horizantal Scroll bar for details table ?                   

Thanks In Advance
Dimo
Telerik team
 answered on 14 Sep 2010
1 answer
93 views
Hi,
When I use the property "CaptionFormatString" to set a caption title to an autogenerated edit form, when I edit a record, the caption of the popup form is set accordingly but the title is also repeated an another time just below the caption of the form.

How can I prevent that oddly behavior ?

Thanks.
Pavlina
Telerik team
 answered on 14 Sep 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?