Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
539 views
Hallo,
I have problem with spaces in url path.
I have Rad Grid with columns like this:
<telerik:GridHyperLinkColumn DataTextFormatString="Adres" ItemStyle-ForeColor="Orange"
 DataNavigateUrlFields="s_adresar" UniqueName="s_adresar" DataNavigateUrlFormatString="file://///SomeServer/Some Directory With Spaces/{0}" Target="_blank" HeaderText="Adres" DataTextField="s_adresar">
 </telerik:GridHyperLinkColumn>

I would like to open directory from shared file system in Windows Explorer after click on link in RadGrid, but it doesn't work.
Right path to directory is file://SomeServer/Some Directory With Spaces/
but rendered path is  file://SomeServer/Some%20Directory%20With%20Spaces/
and  this path is for Windows Explorer unknown. I tried to replace spaces in path ( in DataNavigateUrlFormatString property) with some mark entity but without success.
Can anyone help me  please?
Thanks
Rama
Top achievements
Rank 1
 answered on 10 Mar 2015
7 answers
211 views
Hi,
I use radgrid with these settings

Me.ResultsGrid.MasterTableView.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric
Me.ResultsGrid.MasterTableView.PagerStyle.Position = GridPagerPosition.Top
Me.ResultsGrid.MasterTableView.PagerStyle.PageButtonCount = 10

I want to hide the border for the pager, as the pager is placed on top, the top-line caused by the styles are not in sync with my design,
so i want to hide the border.

.RadGrid_Default .rgPager .rgPagerCell
   border-color:#828282 -moz-use-text-color #EEEEEE #EEEEEE;
   border-style:solid none solid solid;
   border-width:1px 0 1px 1px;

I tried setting
  Me.ResultsGrid.MasterTableView.PagerStyle.BorderStyle = WebControls.BorderStyle.None
but no use.

How i can set it from code-behind?
Pavlina
Telerik team
 answered on 10 Mar 2015
1 answer
103 views
wherever I try to filter a bounded column with RadGrid I get the following error:

"Could not resolve 'COLUMN NAME' in scope or current context. Check
that all referenced variables are in scope, if required schemes were
loaded and references to namespaces are correct. Next simple identifier,
line 6, column 3."

My page's code is:

<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="VerOcorrencias.aspx.cs" Inherits="DuctorWebSite.OuvidoriaPages.VerOcorrencias" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
    <meta http-equiv='cache-control' content='no-cache'>
    <meta http-equiv='expires' content='0'>
    <meta http-equiv='pragma' content='no-cache'>
 
    <link href="../Content/OuvidoriaPages.css" rel="stylesheet" />
 
    <div class="container-full">
        <h2>Lista de ocorrĂȘncias</h2>
 
        <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="EntityDataSource1"
            RenderMode="Auto" Culture="pt-BR" Skin="Metro"
            AllowAutomaticDeletes="True" AllowFilteringByColumn="True" AllowPaging="True"
            AutoGenerateColumns="False" OnItemCommand="RadGrid1_ItemCommand" EnableLinqExpressions="False" GroupPanelPosition="Top">
 
            <ExportSettings>
                <Pdf PageWidth="">
                </Pdf>
            </ExportSettings>
 
            <MasterTableView DataSourceID="EntityDataSource1" DataKeyNames="OUV_Id" PageSize="25">
 
                <EditFormSettings>
                    <EditColumn UniqueName="EditCommandColumn" CancelText="Cancelar" EditText="Editar" UpdateText="Confirmar" ButtonType="ImageButton" CancelImageUrl="../Images/icons/cancelar.png"
                        UpdateImageUrl="../Images/icons/ok.png">
                    </EditColumn>
                </EditFormSettings>
 
                <Columns>
                    <telerik:GridButtonColumn CommandName="Editar" Text="Editar resposta" UniqueName="EditCommandColumn" ButtonType="ImageButton" ImageUrl="../Images/icons/editar.png" Resizable="False">
                        <ItemStyle Width="41px" />
                    </telerik:GridButtonColumn>
 
                    <telerik:GridButtonColumn CommandName="Delete" Text="Apagar mensagem inteira" UniqueName="DeleteColumn" ConfirmText="VocĂȘ tem certeza que quer apagar essa mensagem?" ConfirmDialogType="RadWindow" ConfirmDialogHeight="25px" HeaderStyle-Width="15px" ItemStyle-Width="15px"
                        ButtonType="ImageButton" ImageUrl="../Images/icons/apagar.png">
                        <HeaderStyle Width="15px" />
                        <ItemStyle Width="41px" />
                    </telerik:GridButtonColumn>
 
                    <telerik:GridBoundColumn DataField="OUV_Id" DataType="System.Int32" Display="False" FilterControlAltText="Filter OUV_Id column" HeaderText="OUV_Id" ReadOnly="True" SortExpression="OUV_Id" UniqueName="OUV_Id" Visible="False" Resizable="False">
                        <ColumnValidationSettings>
                            <ModelErrorMessage Text="" />
                        </ColumnValidationSettings>
                        <ItemStyle Width="41px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="OUV_DtdRegistro" DataType="System.DateTime" FilterControlAltText="Filter OUV_DtdRegistro column" HeaderText="<b>DATA REGISTRO</b>" SortExpression="OUV_DtdRegistro" UniqueName="OUV_DtdRegistro" ReadOnly="True" DataFormatString="{0:dd/MM/yyyy}" Resizable="False">
                        <ColumnValidationSettings>
                            <ModelErrorMessage Text="" />
                        </ColumnValidationSettings>
                        <ItemStyle Width="50px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="OUV_Protocolo" DataType="System.Double" FilterControlAltText="Filter OUV_Protocolo column" HeaderText="<b>PROTOCOLO</b>" SortExpression="OUV_Protocolo" UniqueName="OUV_Protocolo" ReadOnly="True" Resizable="False">
                        <ColumnValidationSettings>
                            <ModelErrorMessage Text="" />
                        </ColumnValidationSettings>
                        <ColumnValidationSettings>
                            <ModelErrorMessage Text="" />
                        </ColumnValidationSettings>
                        <ItemStyle Width="30px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridCalculatedColumn DataFields="OUV_Nome,OUV_Email,OUV_Telefone" FilterControlAltText="Filter column column" UniqueName="column" Expression="OUV_Nome + '<br/>' + OUV_Email + '<br/>' + OUV_Telefone" HeaderText="<b>IDENTIFICAÇÃO</b>" Resizable="False">
                        <FooterStyle Width="100px" />
                        <ItemStyle Width="80px" />
                    </telerik:GridCalculatedColumn>
                    <telerik:GridBoundColumn DataField="OUV_Mensagem" FilterControlAltText="Filter OUV_Mensagem column" HeaderText="<b>MENSAGEM</b>" SortExpression="OUV_Mensagem" UniqueName="OUV_Mensagem" ReadOnly="True" Resizable="False" MaxLength="150">
                        <ColumnValidationSettings>
                            <ModelErrorMessage Text="" />
                        </ColumnValidationSettings>
                        <FooterStyle Width="500px" />
                        <ItemStyle Width="250px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="OUV_DtdResposta" DataType="System.DateTime" FilterControlAltText="Filter OUV_DtdResposta column" HeaderText="<b>DATA RESPOSTA</b>" SortExpression="OUV_DtdResposta" UniqueName="OUV_DtdResposta" ReadOnly="True" DataFormatString="{0:dd/MM/yyyy}" Resizable="False">
                        <ColumnValidationSettings>
                            <ModelErrorMessage Text="" />
                        </ColumnValidationSettings>
                        <ItemStyle Width="30px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="OUV_Resposta" FilterControlAltText="Filter OUV_Resposta column" HeaderText="<b>RESPOSTA</b>" SortExpression="OUV_Resposta" UniqueName="OUV_Resposta" Resizable="False" MaxLength="150">
                        <ColumnValidationSettings>
                            <ModelErrorMessage Text="" />
                        </ColumnValidationSettings>
                        <ItemStyle Width="250px" Wrap="True" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="OUV_Nome" FilterControlAltText="Filter OUV_Nome column" HeaderText="OUV_Nome" SortExpression="OUV_Nome" UniqueName="OUV_Nome" Display="False" ReadOnly="True" Visible="False">
                        <ColumnValidationSettings>
                            <ModelErrorMessage Text="" />
                        </ColumnValidationSettings>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="OUV_Email" FilterControlAltText="Filter OUV_Email column" HeaderText="OUV_Email" SortExpression="OUV_Email" UniqueName="OUV_Email" Display="False" ReadOnly="True" Visible="False">
                        <ColumnValidationSettings>
                            <ModelErrorMessage Text="" />
                        </ColumnValidationSettings>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="OUV_Telefone" FilterControlAltText="Filter OUV_Telefone column" HeaderText="OUV_Telefone" SortExpression="OUV_Telefone" UniqueName="OUV_Telefone" Display="False" ReadOnly="True" Visible="False">
                        <ColumnValidationSettings>
                            <ModelErrorMessage Text="" />
                        </ColumnValidationSettings>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="OUV_ChaveLoc" Display="False" FilterControlAltText="Filter OUV_ChaveLoc column" HeaderText="OUV_ChaveLoc" SortExpression="OUV_ChaveLoc" UniqueName="OUV_ChaveLoc" Visible="False" ReadOnly="True">
                        <ColumnValidationSettings>
                            <ModelErrorMessage Text="" />
                        </ColumnValidationSettings>
                    </telerik:GridBoundColumn>
                    <telerik:GridCheckBoxColumn DataField="OUV_Ativo" DataType="System.Boolean" Display="False" FilterControlAltText="Filter OUV_Ativo column" HeaderText="OUV_Ativo" SortExpression="OUV_Ativo" UniqueName="OUV_Ativo" Visible="False" ReadOnly="True">
                    </telerik:GridCheckBoxColumn>
                    <telerik:GridBoundColumn DataField="OUV_idCAT" Display="False" FilterControlAltText="Filter OUV_idCAT column" HeaderText="OUV_idCAT" SortExpression="OUV_idCAT" UniqueName="OUV_idCAT" Visible="False" ReadOnly="True">
                        <ColumnValidationSettings>
                            <ModelErrorMessage Text="" />
                        </ColumnValidationSettings>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="CAT_Descr" Display="False" FilterControlAltText="Filter CAT_Descr column" HeaderText="CAT_Descr" SortExpression="CAT_Descr" UniqueName="CAT_Descr" Visible="False" ReadOnly="True">
                        <ColumnValidationSettings>
                            <ModelErrorMessage Text="" />
                        </ColumnValidationSettings>
                    </telerik:GridBoundColumn>
                </Columns>
                <PagerStyle Position="TopAndBottom" />
            </MasterTableView>
 
 
            <FilterMenu RenderMode="Mobile">
            </FilterMenu>
            <HeaderContextMenu RenderMode="Mobile">
            </HeaderContextMenu>
 
        </telerik:RadGrid>
 
    </div>
    <asp:EntityDataSource ID="EntityDataSource1" runat="server" ConnectionString="name=DuctorWebSiteEntities"
        DefaultContainerName="DuctorWebSiteEntities" EnableDelete="True" EnableFlattening="False" EntitySetName="Ouvidoria" OrderBy="it.OUV_DtdRegistro Desc" EntityTypeFilter="Ouvidoria">
    </asp:EntityDataSource>
</asp:Content>
I need some help, thanks.
Pavlina
Telerik team
 answered on 10 Mar 2015
6 answers
260 views
Hello,

If you begin typing in the editor without selecting anything from the toolbar, no "default" formatting is applied. If you switch between Design and HTML mode you see just the text you typed. No HTML is applied.

I've tried setting default toolbar font options using the OnClientLoad event but these selections are not applied upon typing.

Any suggestions would be appreciated.

Thanks

Blair
Blair
Top achievements
Rank 1
 answered on 10 Mar 2015
12 answers
234 views
I notice that radribbonbutton does not have a NavigationUrl Property to navigate to a specific aspx. Is there a property to navigate to aspx from the radribbonbutton. If not, How would I do it in code from the .cs file.


 protected void RadRibbonBar1_ButtonClick(object sender, Telerik.Web.UI.RibbonBarButtonClickEventArgs e)
    {
        switch (e.Button.Text)
        {
            case "Calender":
                break;

            default:
                break;
        }
Ivan Danchev
Telerik team
 answered on 10 Mar 2015
5 answers
107 views
I created my own  Template column. Everything works ok. But when I add a child hierarchy and expand any row, the values of that column in the father grid are lost.

Any suggestions on this?

I added part of my code to show the situation.

Code:

public class MyGridTemplateColumn : GridTemplateColumn
{
    public override void Initialize()
    {
        base.Initialize();

        HeaderStyle.Width = Unit.Pixel(105);
        HeaderText = "State";
        UniqueName = "StateCol";

        DataField = "StateId";
        DataType = typeof(byte);

        var _dataSource = new List<KeyValuePair<int, string>>
        {
            new KeyValuePair<int, string>(1, "Active"),
            new KeyValuePair<int, string>(2, "Deleted"),
            new KeyValuePair<int, string>(3, "Inactive"),
            new KeyValuePair<int, string>(6, "Other")
        };

        ItemTemplate = new MyItemTemplate(this.DataField, _dataSource);
        EditItemTemplate = new MyEditItemTemplate(this.DataField, _dataSource);
    }

    public override GridColumn Clone()
    {
        var res = new MyGridTemplateColumn();
        res.CopyBaseProperties(this);

        return res;
    }

    private class MyItemTemplate : ITemplate
    {
        private readonly string _dataField;
        private readonly List<KeyValuePair<int, string>> _dataSource = new List<KeyValuePair<int, string>>();

        public MyItemTemplate(string dataField, List<KeyValuePair<int, string>> origenDatos)
        {
            _dataField = dataField;
            _dataSource = origenDatos;
        }

        public void InstantiateIn(System.Web.UI.Control container)
        {
            var lControl = new LiteralControl { ID = _dataField + "_lControl" };
            lControl.DataBinding += lControl_DataBinding;
            container.Controls.Add(lControl);
        }

        private void lControl_DataBinding(object sender, EventArgs e)
        {
            var l = (LiteralControl)sender;
            var value = l.NamingContainer.GetFieldValue("DataItem." + _dataField);
            if (value != null)
                l.Text = _dataSource.FirstOrDefault(s=>s.Key == (int)value).Value;
        }
    }

    private class MyEditItemTemplate : IBindableTemplate
    {
        private readonly string _dataField;
        private readonly List<KeyValuePair<int, string>> _dataSource = new List<KeyValuePair<int, string>>();

        public MyEditItemTemplate(string dataField, List<KeyValuePair<int, string>> origenDatos)
        {
            _dataField = dataField;
            _dataSource = origenDatos;
        }

        public void InstantiateIn(System.Web.UI.Control container)
        {
            var rcBox = new RadComboBox
            {
                ID = _dataField + "_RadComboBox",
                DataTextField = "Value",
                DataValueField = "Key",
                DataSource = _dataSource
            };

            rcBox.DataBinding += rcBox_DataBinding;
            container.Controls.Add(rcBox);
        }

        public IOrderedDictionary ExtractValues(Control container)
        {
            var dictionary = new OrderedDictionary
            {
                {_dataField, (container.FindControl(_dataField + "_RadComboBox") as RadComboBox).SelectedValue}
            };
            return dictionary;
        }

        private void rcBox_DataBinding(object sender, EventArgs e)
        {
            var rcBox = (RadComboBox)sender;
            var value = rcBox.NamingContainer.GetFieldValue("DataItem." + _dataField);
            rcBox.SelectedValue = value != null ? value.ToString() : string.Empty;
        }
    }

Usage:

<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="LinqDataSource1" AllowPaging="True" AutoGenerateColumns="False" Width="50%">
    <MasterTableView DataKeyNames="ENTUserAccountId" DataSourceID="LinqDataSource1" PageSize="5">
        <Columns>
            <telerik:GridBoundColumn DataField="UserName" HeaderText="UserName" UniqueName="UserName"/>
            <telerik:GridBoundColumn DataField="Email" HeaderText="Email" UniqueName="Email"/>
            <a:MyGridTemplateColumn />
        </Columns>
        <DetailTables>
            <telerik:GridTableView runat="server" DataSourceID="LinqDataSource2" DataKeyNames="ENTUserAccountId">
                <ParentTableRelation>
                    <telerik:GridRelationFields DetailKeyField="ENTUserAccountId" MasterKeyField="ENTUserAccountId" />
                </ParentTableRelation>
                <Columns>
                    <telerik:GridTemplateColumn DataField="ENTRoleId" HeaderText="Rol" UniqueName="ENTRoleId">
                        <ItemTemplate>
                            <asp:Label ID="ENTRoleIdLabel" runat="server" Text='<%# Eval("ENTRole.RoleName") %>'></asp:Label>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                </Columns>                 
            </telerik:GridTableView>
        </DetailTables>
    </MasterTableView>
</telerik:RadGrid>

<asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="TelerikWebApp1.DataClasses1DataContext"
    EntityTypeName="" TableName="ENTUserAccount"/>
        
<asp:LinqDataSource ID="LinqDataSource2" runat="server" ContextTypeName="TelerikWebApp1.DataClasses1DataContext"
    EntityTypeName="" TableName="ENTRoleUserAccount" Where="ENTUserAccountId == @ENTUserAccountId">
        <WhereParameters>
            <asp:SessionParameter Name="ENTUserAccountId" Type="Int32" />
        </WhereParameters>
</asp:LinqDataSource>  



Kostadin
Telerik team
 answered on 10 Mar 2015
4 answers
127 views
Hi

I'm using add_show from Radwindow but sinds installing version UI for ASP.NET AJAX Q1 2015, I get following error :

Object doesn't support property or method 'add_show'


This is the javascript function I use it in it:

function openChildDialog(url, wndName, title) {
    if (!url)
        url = "errorPage.aspx";
    if (!wndName)
        wndName = "popup_" + Math.random();
    var currentWnd = GetRadWindow();
     
    var browserWnd = window;
    if (currentWnd)
        browserWnd = currentWnd.BrowserWindow;
    setTimeout(function () {
        browserWnd.add_show(returnDataToParentPopup);
        var wnd = browserWnd.radopen(url, wndName);
        wnd.__parentBackReference = window; //pass the current window object of the page that opens the dialog so it can be used later
 
        if (title)
            wnd.set_title(title);
    }, 0);


Can someone please help me? It is urgent because no window is opening in my production environment!

Kind regards

Suzy
Suzy
Top achievements
Rank 2
 answered on 10 Mar 2015
1 answer
166 views
Hi, I've got a grid where neither the client nor server side events are firing on row drop, the target grid:
         <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1"   
                             EnableViewState="False" GridLines="None" Width="475px" AutoGenerateDeleteColumn="True"
                             AllowAutomaticDeletes="True"
                            AllowMultiRowSelection="true"
                             OnDeleteCommand="RadGrid1_DeleteCommand" 
                            OnRowDrop="RadGrid1_RowDrop" 
                            OnItemCreated="RadGrid1_ItemCreated">
                 <ClientSettings EnableRowHoverStyle="True" AllowRowsDragDrop="True">
                <Selecting AllowRowSelect="True" EnableDragToSelectRows="false" />
                            <ClientEvents  OnRowDropping="onRowDropping"></ClientEvents>
                </ClientSettings>
david
Top achievements
Rank 1
 answered on 10 Mar 2015
4 answers
87 views
I need to use a radwindow confirmation with an icontile just like you would with a button.   How would I accomplish this with javascript?
Marin Bratanov
Telerik team
 answered on 10 Mar 2015
2 answers
116 views
Hi Team,

I am using custom css file and showing few css classes with user friendly names in "Apply CSS Class" drop down box of RAD Editor Tool bar.
I used following code in ToolsFile.xml to show user-friendly names corresponding to custom css classes:

<classes>
    <class name="Clear Class" value="" />
    <class name="ContentLink" value="a.oc-rteElement-ContentLink" />
    <class name="ContentBody" value=".oc-rteStyle-ContentBody" />
    <class name="Arrow/Separator" value=".oc-rteStyle-ContentArrowSeparator" />
    <class name="ContentHeading" value=".oc-rteStyle-ContentHeading" />
    <class name="CorporateHeading" value=".oc-rteStyle-ContentHeadingCorporate" />
    <class name="PrivateEquityHeading" value=".oc-rteStyle-ContentHeadingPrivateEquity" />
    <class name="CovertiblesHeading" value=".oc-rteStyle-ContentHeadingCovertibles" />
    <class name="ListedEquityHeading" value=".oc-rteStyle-ContentHeadingListedEquity" />
....
....
</classes>

Initially in the RAD Editor Toolbar, user-friendly names are shown in “Apply CSS Class” drop down box as shown in below figure:



After we select a style and apply it to some content, then the internal css class name of the style gets displayed on the drop down as shown below:



Kindly suggest how can I resolve this issue that internal css class name not shown to user.

Thanks & Regards,
Lipi 
Ianko
Telerik team
 answered on 10 Mar 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?