Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
87 views

Hi,

We have a custom tool in the editor to remove "comments", this works when I simulate IE 7 and works great in Chrome. When I click the button in IE 10 the browser crashes without any details. 

If I debug the code it seems like it is working, the crash seems to happen in RadEditor.js when the checkElementsRecursively() is done. 

Do you have any clue whats happend? I guess it has to do with the removed element.

sb.Append("Telerik.Web.UI.Editor.CommandList[\"StripOneSpan\"] = function(commandName, editor, args){");
sb.Append("var theSelectedElement = editor.getSelectedElement();");
sb.Append("checkElementsRecursively(theSelectedElement)");
sb.Append("};");

 

And the JS-code: 

        function checkElementsRecursively(selElement) {

            if ((selElement.tagName == "FONT" || selElement.tagName == "font" || selElement.tagName == "SPAN" || selElement.tagName == "span") && selElement.attributes["id"] != null && selElement.attributes["id"].value.substring(7, 0) == "abccom_" && selElement.parentNode != null) {
                selElement.parentNode.removeChild(selElement);
            }
        }

Rumen
Telerik team
 answered on 14 Sep 2017
3 answers
110 views

Hi ,

My scenario is as follows,

I have 3 user controls each of which contains Rad Map with some data.

This is displaying correctly. However my problem is that I am using these user controls in 3 different tabs using Rad Tab same as the 'Load On demand' demo of the RadTab in Telerik site. On the initial tab change the map displays correctly. But if keep changing the tabs the maps are shifting its position to the left.

Why is this happening?

Thanks

Rumen
Telerik team
 answered on 14 Sep 2017
5 answers
1.1K+ views

hi there,

Please help me to setup my RadGrid.

My scenario is : I click on a linkbutton with a navigateUrl which contains parameters I need to Load the RadGrid. With that parameter, I can load my list of Entities.

But the visual representation of theses datas, is not a classical RadGrid with properties columns binding.

In fact, I need to Bind each Entity into a Cell of my RadGrid. How can I realise it ?

I am trying this code :

public void Loading()

{

            List<T> entities = getFromDb(); // T is my complex Object

            // Determine what will be the rows
            List<string> rows = entities.Select(e => e.X_MyProperty).Distinct().ToList();

              // Determine what will be the columns
            List<string> columns = entities.Select(e => e.Y_MyProperty).Distinct().ToList();
            
            DataTable table = new DataTable();

            table.Columns.Add("FirstColumn");

            foreach (string columnsName in columns)
            {
                   table.Columns.Add(columnsName);
            }

            foreach (var row in rows)
            {
                TableRow r = new TableRow();
                table.Rows.Add(r);
                r.Cells.Add(new TableCell {Text = row });

                for (int i = 0; i < columns.Count; i++)
                {
                    var c = new TableCell();
                    r.Cells.Add(c);

                    c.Controls.Add(new Label { Text = "A Property of T to display" });
                }
            }

            GridDetailEmplacements.DataSource = table;
            GridDetailEmplacements.DataBind();

}

 

Inside the ASPX file : 

 <telerik:RadGrid runat="server" ID="GridDetailEmplacements" AutoGenerateColumns="False">
                        <ClientSettings ReorderColumnsOnClient="false" AllowColumnsReorder="false">
                            <Selecting AllowRowSelect="false" EnableDragToSelectRows="false" />
                            <Resizing AllowColumnResize="false" ResizeGridOnColumnResize="false" AllowResizeToFit="false" />
                        </ClientSettings>

                        <HeaderStyle HorizontalAlign="Center" Font-Size="14px"></HeaderStyle>
                        <ItemStyle HorizontalAlign="Left" Font-Names="Arial Unicode MS" Font-Size="12px" />
                        <AlternatingItemStyle HorizontalAlign="Left" Font-Names="Arial Unicode MS" Font-Size="12px" />

                    </telerik:RadGrid>

How can I Bing different properties of my Object of T inside each cells ?

I would like render acell with a simple asp:Table which contains 3 rows with 3 properties of my Object

 

Thank's for helping 

 

Best regards

jeremie
Top achievements
Rank 1
 answered on 14 Sep 2017
1 answer
305 views

Hi,
I recently updated the version 2011 to 2017, but the radComboBox object I have on my pages has been unconfigured, as I show in the attached image.

Please help me on this issue.

Thank you.

 

Html:
<div id="ctl00_ctl00_placeHolderMain_mainWebCad_frmMoeda_cmbPais" class="RadComboBox RadComboBox_Default" style="width:160px;white-space:normal;">
<table summary="combobox" style="border-width:0;border-collapse:collapse;width:100%">
<tbody><tr class="rcbReadOnly">
<td class="rcbInputCell rcbInputCellLeft" style="width:100%;"><input name="ctl00$ctl00$placeHolderMain$mainWebCad$frmMoeda$cmbPais" type="text" class="rcbInput radPreventDecorate" id="ctl00_ctl00_placeHolderMain_mainWebCad_frmMoeda_cmbPais_Input" value="-Selecione uma opção-" readonly="readonly" autocomplete="off"></td><td class="rcbArrowCell rcbArrowCellRight"><a id="ctl00_ctl00_placeHolderMain_mainWebCad_frmMoeda_cmbPais_Arrow" style="overflow: hidden;display: block;position: relative;outline: none;">select</a></td>
</tr>
</tbody></table><input id="ctl00_ctl00_placeHolderMain_mainWebCad_frmMoeda_cmbPais_ClientState" name="ctl00_ctl00_placeHolderMain_mainWebCad_frmMoeda_cmbPais_ClientState" type="hidden" autocomplete="off">
</div>

 

 

CSS:

.RadComboBox_Default .rcbInputCellLeft {
    background-image: url("/Hotsite/Content/Images/forms/telerikComboCMFlex.png") !important;
}

.RadComboBox_Default .rcbInputCellRight {
    background-image: url("/Hotsite/Content/Images/forms/telerikComboCMFlex.png") !important;
}

.RadComboBox_Default .rcbArrowCellLeft {
    background-image: url("/Hotsite/Content/Images/forms/telerikComboCMFlex.png") !important;
}

.RadComboBox_Default .rcbArrowCellRight {
    background-image: url("/Hotsite/Content/Images/forms/telerikComboCMFlex.png") !important;
}

.RadComboBox table td.rcbInputCell {
    height: 29px !important;
}

.RadComboBox table td.rcbInputCell {
    width: 100% !important;
    padding-left: 2px !important;
}

.RadComboBox .rcbInputCell .rcbInput {
    width: 100% !important;
    padding-left: 2px !important;
}

.radComboBox .rcbInputCell .rcbInputCell {
    width: 100%;
}

.RadComboBox .rcbHovered .rcbInput {
    width: 95% !important;
}

.RadComboBox .rcbFocused .rcbInput {
    width: 95% !important;
}

.RadComboBox .rcbDisabled .rcbInput {
    width: 95% !important;
}

.RadComboBox_Default .rcbHovered .rcbReadOnly td.rcbInputCellLeft {
    background-position: 0px -32px !important;
}

.RadComboBox_Default .rcbFocused .rcbReadOnly td.rcbInputCellLeft {
    background-position: 0px -64px !important;
}

.RadComboBox_Default .rcbDisabled .rcbReadOnly td.rcbInputCellLeft {
    background-position: 0px -64px !important;
}

.RadComboBox_Default .rcbReadOnly td.rcbArrowCellRight {
    background-position: -4px -96px !important;
}

.RadComboBox_Default .rcbHovered .rcbReadOnly .rcbArrowCellRight {
    background-position: -64px -96px !important;
}

.RadComboBox_Default .rcbFocused .rcbReadOnly .rcbArrowCellRight {
    background-position: -125px -96px !important;
}

.RadComboBox_Default .rcbDisabled .rcbReadOnly td.rcbArrowCellRight {
    background-position: -125px -96px !important;
}

.RadComboBox .rcbReadOnly td.rcbArrowCell a {
    width: 18px !important;
}

.RadComboBox .rcbReadOnly td.rcbArrowCell {
    width: 18px !important;
}

.RadComboBox_Default td.rcbArrowCellRight {
    background-position: -2px -108px !important;
}

Vessy
Telerik team
 answered on 14 Sep 2017
1 answer
46 views

I have a RadGrid with a .Resx for switching Cultures. the UI is switched from global.asax with a button in MasterPage. All labels an titles are switched correcly but the grid and other telerik controls are not working properly. they stay with the previous culture.

Vessy
Telerik team
 answered on 14 Sep 2017
2 answers
94 views

I tried to apply my own gif to the "expanded" arrow but when clicking it shows nothing at all.  I tried setting background-color as a control test and that worked fine.

The gif is currently just a plain colored square so it'd be pretty obvious to see that it's working.

Attachment shows how it looks on the page (no icons).

Where am I going wrong?

Here's my CSS:

.RadTreeView_MetroTouch .rtMinus {
    background-image: url('../Images/Test.gif') !important;   
}
Kenyon
Top achievements
Rank 1
 answered on 13 Sep 2017
0 answers
97 views

Hi,

I have a typical master/child RadGrid:

<telerik:RadGrid ID="RadGridParent"
    AutoGenerateColumns="false"
    DataSourceID="ObjectDataSourceParent"
    runat="server">
    <MasterTableView
        DataSourceID="ObjectDataSourceParent"
        DataKeyNames="Id"
        Name="ParentGrid"
        CommandItemDisplay="Top"
        HierarchyDefaultExpanded="true"
        EnableHierarchyExpandAll="true"
        ShowFooter="false">
        <CommandItemSettings ShowAddNewRecordButton="false" />
        <DetailTables>
            <telerik:GridTableView
                DataSourceID="ObjectDataSourceChild"
                DataKeyNames="Id"
                Name="ChildGrid"
                CommandItemDisplay="Top"
                EditMode="InPlace"
                ShowFooter="false"
                HierarchyDefaultExpanded="true"
                runat="server">
                <ParentTableRelation>
                    <telerik:GridRelationFields DetailKeyField="ParentId" MasterKeyField="Id"></telerik:GridRelationFields>
                </ParentTableRelation>
                <Columns>
                ...
                </Columns>
            </telerik:GridTableView>
        </DetailTables>
    </MasterTableView>
</telerik:RadGrid>
<asp:ObjectDataSource ID="ObjectDataSourceParent" runat="server"
    SelectMethod="RetrieveList">
    <SelectParameters>
        <asp:QueryStringParameter Name="Id" querystringfield="id" />
    </SelectParameters>           
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="ObjectDataSourceChild" runat="server"
    SelectMethod="RetrieveList">
    <SelectParameters>
        <asp:Parameter Name="parentId" Type="Int32" />
    </SelectParameters>
</asp:ObjectDataSource>

 

The problem is with the following line:

<asp:Parameter Name="parentId" Type="Int32" />

I'd like to specify the parentId of the corresponding parent record. How can I do that?

 

Thanks,

Leszek

 

Leszek
Top achievements
Rank 1
 asked on 13 Sep 2017
1 answer
83 views

I have a RADGrid that looks like this:

<telerik:RadGrid ID="gvMembers" runat="server"
         OnNeedDataSource="gvMembers_NeedDataSource"
         AllowSorting="true"
         AllowPaging="true"
         PageSize="10"
         AllowAutomaticUpdates="true"
         AllowAutomaticInserts="true"
         AllowAutomaticDeletes="true"
         OnItemCreated="gvMembers_ItemCreated"
         OnItemInserted="gvMembers_ItemInserted"
         OnPreRender="gvMembers_PreRender"
         OnInsertCommand="gvMembers_InsertCommand"
         OnItemDataBound="gvMembers_ItemDataBound">
         <HeaderStyle CssClass="GridHeader" />
         <PagerStyle Mode="NextPrevNumericAndAdvanced" />
         <MasterTableView AutoGenerateColumns="false" DataKeyNames="UserID" CommandItemDisplay="Top">
             <Columns>
                 <telerik:GridEditCommandColumn UniqueName="EditCommandColumn"></telerik:GridEditCommandColumn>
                 <telerik:GridBoundColumn DataField="UserId" Visible="false" MaxLength="6"></telerik:GridBoundColumn>
                 <telerik:GridCheckBoxColumn DataField="Valid" HeaderText="Active" SortExpression="Valid" UniqueName="valid"></telerik:GridCheckBoxColumn>
                 <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" SortExpression="FirstName" UniqueName="firstname"></telerik:GridBoundColumn>
                 <telerik:GridBoundColumn DataField="FirstName" HeaderText="Last Name" SortExpression="LastName" UniqueName="lastname"></telerik:GridBoundColumn>
                 <telerik:GridBoundColumn DataField="UserName" HeaderText="User Name" SortExpression="UserName" UniqueName="username"></telerik:GridBoundColumn>
                 <telerik:GridBoundColumn DataField="EmailAddress" HeaderText="Email" SortExpression="EmailAddress" UniqueName="email"></telerik:GridBoundColumn>
                 <telerik:GridTemplateColumn HeaderText="Role2" DataField="Role" UniqueName="Role2">
                     <ItemTemplate>
                         <%#DataBinder.Eval(Container.DataItem, "Role")%>
                     </ItemTemplate>
                     <EditItemTemplate>
                         <telerik:GridDropDownListColumnEditor ID="GridDropDownListColumnEditor1" runat="server"></telerik:GridDropDownListColumnEditor>
                     </EditItemTemplate>
                 </telerik:GridTemplateColumn>
             </Columns>
         </MasterTableView>
     </telerik:RadGrid>

The NeedDataSource for the grid is pulled from a SQL View. When I edit or insert  I need to use a DropDown for the Role.  That Role data will come from a SQL table that contains the RoleName and the RoleID.  How can I configure the DropDown to get that data to show??

Perry
Top achievements
Rank 1
 answered on 13 Sep 2017
16 answers
615 views

I want to reduce/hide a few filter options in rad grid (Version 5.1.2.0) . The options to hide are different for different columns. So to do this I am using client side java script as mentioned in the forums. I am using Telerik Q3 2007. but as it seems its not working at all for me. I am following the tutorial in telerik website Reducing the filter menu options


   <script type="text/javascript" language="javascript">     
             
        function filterMenushowing(sender, eventArgs)   
        {     
            if (eventArgs.get_column().get_uniqueName() == "unique_invoice_no")      
            {              
                var menu = eventArgs.get_menu();   
                var items = menu._itemData;   
  
                var i = 0;   
                while (i < items.length)     
                {     
                    if (items[i].value != "NoFilter" && items[i].value != "EqualTo")     
                    {     
                        var item = menu._findItemByValue(items[i].value);   
                        if (item != null)   
                            item._element.style.display="none";   
                    }     
                    i++;     
                }     
            }      
        }   
    </script>  

My problem is that eventArgs.get_column().get_uniqueName() and eventArgs.get_menu() are always undefined. I have also tried the following code snippet, which I found in the online help documents, but nothing is happening. Now with this code, I get the menu and all the filter items in the menu, but don't know how to get the menu item and how to hide that item.

<ClientSettings>  
    <ClientEvents OnFilterMenuShowing="filterMenuShowing" />  
</ClientSettings>  

<script type="text/javascript" language="javascript">         
    function filterMenuShowing(sender, eventArgs)   
    {     
        if (eventArgs.Column.UniqueName == "Name")      
        {              
            var menu = eventArgs.Menu;   
            var items = menu.Items;   
            var i = 0;   
                 
            while (i < items.length)     
            {    
                if (items[i].Value != "NoFilter" && items[i].Value != "EqualTo")     
                {     
                    /* what to write here to hide the menu items */
      
                }     
                i++;     
            }     
        }      
    } 
</script> 

Any help would be appreciated

DogBizPro
Top achievements
Rank 1
 answered on 13 Sep 2017
1 answer
119 views

Hello,

I'm using embedded bar graphs in a grid () and it will have 1-3 items contained within the graph depending on the row.  Is there some way to adjust the graph (or the row width) to cater for larger or smaller graphs rather than them all being the same size.

See attached diagram as an example.  I would like the size of the bars in the graph to be standardized regardless of how items there are.  E.g. in this case have the single item graph be the same width as the 2 item graphs.

Thanks

Vessy
Telerik team
 answered on 13 Sep 2017
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?