Telerik Forums
UI for ASP.NET AJAX Forum
11 answers
616 views
Hi,
How can i achive Tab or Right Key press and change the selected grid cell to next Cell.
For example i have 10 Column and 10 rows in a grid.
IF i click on first row cell of Colum[0] and press Tab Key or Right Arrow Key the selected cell should move to next cell .Same like Excel
Kostadin
Telerik team
 answered on 10 Nov 2015
1 answer
94 views

Bullet charts are a supported vizualization in Kendo, MVC, and others but ​​​do not seem to be supported in HtmlChart, at least not like sparklines are. Is there any work-around for rendering them using HtmlChart?

Thanks,

Terry

Danail Vasilev
Telerik team
 answered on 10 Nov 2015
5 answers
213 views
Hello Telerik Team,

We have used the UI for ASP.NET AJAX Telerik toolkit in our application. Recently we have upgraded the Telerik version from older version “2012.2.724.35” to the new version “2014.2.724.45”. After upgrading the Telerik version we are facing some functionality issues. We need your help on identifying the fix for following mentioned issue. 

Following is the issue which we are facing after upgrading Telerik Version to “2014.2.724.45” i.e. UI for ASP.NET AJAX Q2 2014

Issue: Basically the issue is that, we have used RadContext menu with the Telerik Grid controls if there are few columns visible in the Grid and if we click to open the context menu it displays the menu properly and at the desired position, refer the image “BeforeTelerikUpgrade”.
Now the issue is that when there are more columns visible in the grid then the “Horizontal Scroll bar” appears at the bottom of the page so that we can scroll and view all the grid columns, now when the horizontal scroll bar is visible and if we click on the “Context Menu” then in this case the context menu is displayed but its position is misplaced and it do not appear at item where it should actually be displayed, refer the image “AfterTelerikUpgrade”.

The Context Menus used to display and work as desired in the previous Telerik version “2012.2.724.35” but after we have upgraded the Telerik to the new version “2014.2.724.45” we are facing this issue.

Please can anyone help us to identify the fix for this problem which we are facing?

Thanks in advance,
Riz 
Magdalena
Telerik team
 answered on 10 Nov 2015
4 answers
130 views

I have two RadGrids for showing main and detail data.

I wanted to have an asp:FileUpload in the WebUserControl Editform, so I  made a button to upload, save the new InsertItem and Redirect to the same page, opening the EditForm for the newly inserted item in RadGrid2 as shown here: http://www.telerik.com/forums/how-to-use-a-hyperlink-column-to-redirect-to-a-new-and-load-details-in-a-radgrid.

Then, on DataBind, the second Grid throws the following error:

[ArgumentNullException: Der Wert darf nicht NULL sein.
Parametername: virtualPath]
   System.Web.VirtualPath.Create(String virtualPath, VirtualPathOptions options) +9893937
   System.Web.UI.TemplateControl.LoadControl(String virtualPath) +18
   Telerik.Web.UI.GridEditFormItem.InitializeUserControlForm(GridColumn[] columns, ControlCollection controls, GridEditFormSettings formSettings) +123
   Telerik.Web.UI.GridEditFormItem.InitializeEditForm(GridColumn[] columns) +6009
   Telerik.Web.UI.GridEditFormItem.Initialize(GridColumn[] columns) +373
   Telerik.Web.UI.GridEditFormItem.SetupItem(Boolean dataBind, Object dataItem, GridColumn[] columns, ControlCollection rows) +340
   Telerik.Web.UI.GridItemBuilder.CreateItems(GridGroupingContext group) +1155
   Telerik.Web.UI.GridTableView.CreateItems(IEnumerator enumerator, GridColumn[] columns, ControlCollection controls) +211
   Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) +3172
   Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +1150
   System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +67
   System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +128
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +34
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
   Telerik.Web.UI.GridTableView.PerformSelect() +38
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74
   Telerik.Web.UI.GridTableView.DataBind() +392
   Telerik.Web.UI.RadGrid.DataBind() +191
   Telerik.Web.UI.RadGrid.AutoDataBind(GridRebindReason rebindReason) +4238
   Telerik.Web.UI.RadGrid.OnLoad(EventArgs e) +201
   System.Web.UI.Control.LoadRecursive() +59
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +678
Jan
Top achievements
Rank 1
 answered on 10 Nov 2015
6 answers
263 views

Hi,

I'm trying to do drag and drop between 2 treeview using example at http://demos.telerik.com/aspnet-ajax/treeview/examples/functionality/draganddropnodes/defaultvb.aspx

However, I do not want the item to be removed from the first tree view.

1. I removed the server side event and both my treeviews are as following:

<telerik:RadTreeView ID="radTV_pages" Font-Size="Large" runat="server" EnableDragAndDrop="True"
                   OnClientNodeDropping="onNodeDropping" OnClientNodeDragging="onNodeDragging" MultipleSelect="true"
                   EnableDragAndDropBetweenNodes="true">
               </telerik:RadTreeView>
 
 <telerik:RadTreeView ID="radTV_Menu" Font-Size="Large" runat="server" EnableDragAndDrop="True"
                   OnClientNodeDropping="onNodeDropping" OnClientNodeDragging="onNodeDragging" MultipleSelect="true"
                   EnableDragAndDropBetweenNodes="true">
               </telerik:RadTreeView>

 

 

2. As for the client script, I modified as following (remove grid related code and comment "sourceNode.get_parent().get_nodes().remove(sourceNode);"):

<script>
 
        (function () {
 
            var demo = window.demo = window.demo || {};
 
            //demo.checkbox = document.getElementById('<%'= ChbClientSide.ClientID %>');
 
            //function isMouseOverGrid(target) {
            //    parentNode = target;
            //    while (parentNode !== null) {
            //        if (parentNode.id === demo.grid.get_id()) {
            //            return parentNode;
            //        }
            //        parentNode = parentNode.parentNode;
            //    }
 
            //    return null;
            //}
 
            function dropOnHtmlElement(args) {
                if (droppedOnInput(args))
                    return;
 
                if (droppedOnGrid(args))
                    return;
            }
 
            function droppedOnGrid(args) {
                var target = args.get_htmlElement();
 
                while (target) {
                    if (target.id === demo.grid.get_id()) {
                        args.set_htmlElement(target);
                        return;
                    }
 
                    target = target.parentNode;
                }
                args.set_cancel(true);
            }
 
            function droppedOnInput(args) {
                var target = args.get_htmlElement();
                if (target.tagName === "INPUT") {
                    target.style.cursor = "default";
                    target.value = args.get_sourceNode().get_text();
                    args.set_cancel(true);
                    return true;
                }
            }
 
            function dropOnTree(args) {
                var text = "";
 
                if (args.get_sourceNodes().length) {
                    var i;
                    for (i = 0; i < args.get_sourceNodes().length; i++) {
                        var node = args.get_sourceNodes()[i];
                        text = text + ', ' + node.get_text();
                    }
                }
            }
 
            function clientSideEdit(sender, args) {
                var destinationNode = args.get_destNode();
 
                if (destinationNode) {
                    firstTreeView = demo.firstTreeView;
                    secondTreeView = demo.secondTreeView;
 
                    firstTreeView.trackChanges();
                    secondTreeView.trackChanges();
                    var sourceNodes = args.get_sourceNodes();
                    var dropPosition = args.get_dropPosition();
 
                    //Needed to preserve the order of the dragged items
                    if (dropPosition == "below") {
                        for (var i = sourceNodes.length - 1; i >= 0; i--) {
                            var sourceNode = sourceNodes[i];
 
                            //huisheng - do not remove source
                            //sourceNode.get_parent().get_nodes().remove(sourceNode);
 
                            insertAfter(destinationNode, sourceNode);
                        }
                    }
                    else {
                        for (var j = 0; j < sourceNodes.length; j++) {
                            sourceNode = sourceNodes[j];
 
                            //huisheng - do not remove source
                            //sourceNode.get_parent().get_nodes().remove(sourceNode);
 
                            if (dropPosition == "over")
                                destinationNode.get_nodes().add(sourceNode);
                            if (dropPosition == "above")
                                insertBefore(destinationNode, sourceNode);
                        }
                    }
                    destinationNode.set_expanded(true);
                    firstTreeView.commitChanges();
                    secondTreeView.commitChanges();
                }
            }
 
            function insertBefore(destinationNode, sourceNode) {
                var destinationParent = destinationNode.get_parent();
                var index = destinationParent.get_nodes().indexOf(destinationNode);
                destinationParent.get_nodes().insert(index, sourceNode);
            }
 
            function insertAfter(destinationNode, sourceNode) {
                var destinationParent = destinationNode.get_parent();
                var index = destinationParent.get_nodes().indexOf(destinationNode);
                destinationParent.get_nodes().insert(index + 1, sourceNode);
            }
 
            window.onNodeDragging = function (sender, args) {
                var target = args.get_htmlElement();
 
                if (!target) return;
 
                if (target.tagName == "INPUT") {
                    target.style.cursor = "hand";
                }
 
                //var grid = isMouseOverGrid(target)
                //if (grid) {
                //    grid.style.cursor = "hand";
                //}
            };
 
            window.onNodeDropping = function (sender, args) {
                var dest = args.get_destNode();
                if (dest) {
                    //var clientSide = demo.checkbox.checked;
                    var clientSide = true;
 
                    if (clientSide) {
                        clientSideEdit(sender, args);
                        args.set_cancel(true);
                        return;
                    }
 
                    dropOnTree(args);
                }
                else {
                    dropOnHtmlElement(args);
                }
            };
        }());
 
        /* <![CDATA[ */
        Sys.Application.add_load(function () {
            //  demo.grid = $find("<%'= RadGrid1.ClientID %>");
            demo.firstTreeView = $find('<%=radTV_pages.ClientID%>');
            demo.secondTreeView = $find('<%= radTV_Menu.ClientID%>');
            //demo.checkbox = document.getElementById('<%'= ChbClientSide.ClientID %>');
        });
        /* ]]> */
 
    </script>

3. However, the source node is still removed. How can I make the source target to remain?

 

Thanks.

Peter Filipov
Telerik team
 answered on 10 Nov 2015
1 answer
134 views

Hi,

If I set a header with static text it shows fine but as soon as I use embedded code (eg. below) then no header is displayed. 

<HeaderTemplate>
    <div class="rlvHeader"><%= funcs.Translate("Staff") %></div>
</HeaderTemplate>

Ivan Danchev
Telerik team
 answered on 10 Nov 2015
3 answers
267 views

When we binding the data through web service in RadComboBox, web service method is not calling and data is not binding.

These are my following Code :

.aspx :

 <script type="text/javascript">
        var cb;
        function cb_onDataBound(pComboboxItem, pDropDownLine) {
            var customAttributes = pComboboxItem.get_attributes();

            pDropDownLine.update(
                '<span class="column" style="width:50px;">' + pComboboxItem.get_text().truncate(30, '[...]') + '</span>'
                + '<span class="column" style="width:50px;">' + customAttributes.getAttribute("Company") + '</span>'
                + '<span class="column" style="width:50px;">' + customAttributes.getAttribute("City") + '</span>'

            );
        }
        function pageLoad(sender, args) {            
            initComboExtensions();
            cb = $find("RadComboBox1");
           
            cb.onDataBound = cb_onDataBound;
        }
       
       
    </script>​

<telerik:RadComboBox runat="server"
                ID="RadComboBox1"
                Skin="Default"
                Height="200px"
                Width="200px"
                DropDownWidth="200px"                
                ShowMoreResultsBox="true"
                EnableVirtualScrolling="true"
                ChangeTextOnKeyBoardNavigation="false"
                OnClientItemsRequesting="OnClientItemsRequesting"
                OnClientItemsRequested="OnClientItemsRequested"
                OnClientDropDownOpening="OnClientDropDownOpening"                                
                EnableLoadOnDemand="true">
                <HeaderTemplate>
                    <ul style="list-style: none">
                        <li>
                            <span class="column" style="width: 50px;">ClientID</span>
                            <span class="column" style="width: 50px;">Company</span>
                            <span class="column" style="width: 50px;">City</span>

                        </li>
                    </ul>
                </HeaderTemplate>
                <WebServiceSettings Method="GetClientNames" Path="BindComboboxService.asmx" />
            </telerik:RadComboBox>

 

.asmx :

[WebMethod]
        public RadComboBoxData GetClientNames(RadComboBoxContext context)
        {
            
            DataTable data = objProjectBL.PopulateClientCombo();
            List<RadComboBoxItemData> result = new List<RadComboBoxItemData>(context.NumberOfItems);
            RadComboBoxData comboData = new RadComboBoxData();
            try
            {

                int itemsPerRequest = 10;
                int itemOffset = context.NumberOfItems;
                int endOffset = itemOffset + itemsPerRequest;
                if (endOffset > data.Rows.Count)
                {
                    endOffset = data.Rows.Count;
                }
                if (endOffset == data.Rows.Count)
                {
                    comboData.EndOfItems = true;
                }
                else
                {
                    comboData.EndOfItems = false;
                }
                result = new List<RadComboBoxItemData>(endOffset - itemOffset);
                for (int i = itemOffset; i < endOffset; i++)
                {
                    RadComboBoxItemData itemData = new RadComboBoxItemData();
                    itemData.Text = data.Rows[i]["ClientID"].ToString();
                    itemData.Value = data.Rows[i]["ClientID"].ToString();
                    itemData.Attributes["Company"] = data.Rows[i]["Company"].ToString();
                    itemData.Attributes["City"] = data.Rows[i]["City"].ToString();
                    result.Add(itemData);
                }

                if (data.Rows.Count > 0)
                {
                    comboData.Message = String.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", endOffset.ToString(), data.Rows.Count.ToString());
                }
                else
                {
                    comboData.Message = "No matches";
                }
            }
            catch (Exception e)
            {
                comboData.Message = e.Message;
            }

            comboData.Items = result.ToArray();
            return comboData;
        }​

Bozhidar
Telerik team
 answered on 10 Nov 2015
1 answer
134 views

Hi,

Been at this for ages and read as much as I can. Also tried the code library sample.

Text only, no problem, it works - but if there is an image in the editor  I get  'Value cannot be null. Parameter name: data'

I've tried the absolute image path, + adding the alt tag but still no joy I'm afraid..

Please can you help.

Cheers,

Jon

 

 

Ianko
Telerik team
 answered on 10 Nov 2015
2 answers
71 views

I dont whats name for this issue, please help me ..

what must i do to change property of image in radeditor into behind the radeditor when i scroll the content into top/down in Internet Explorer

Thanks before ..

Ianko
Telerik team
 answered on 10 Nov 2015
2 answers
85 views

Hi telerik team.

My purpose is create a column that have a combo as a editor, and when user choose the item in combo box, it send both ID and Code back to the server to bind to datacontext of the row.

To do dat, I have a Template column in Markup code: 

<telerik:GridTemplateColumn>
<ItemTemplate>
<asp:Label Text='<%# Bind('Code')%> runat="server" ID=Label1></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadComboBox runat="server"
ID="col_Editor"
SelectedValue='<%# Bind("ID")%>'
Text='<%# Bind("Code")%>'
DataTextField="Code"
DataValueField="ID"></telerik:RadComboBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>

 It work fine. But now, i want to wrap this into 1 class call "MyComboboxColumn" and the problem is i can not find the way to make a '<%# Bind("")>' tag in the behind code.

My class look like:

Public Class MyComboboxColumn
    Inherits GridTemplateColumn
 
    Public Property DataTextField As String
 
    Public Property DataValueField As String
 
    Public Overrides Sub PrepareCell(cell As TableCell, item As GridItem)
        If TypeOf item Is GridDataItem AndAlso TypeOf item Is MyEntity Then
            Dim ent = CType(item.DataItem, MyEntity)
 
            Dim displayText = ent.GetValueByPropertyName(DataTextField)
            If Not item.IsInEditMode Then
                cell.Text = displayText
            Else
                Dim combo As RadComboBox = cell.FindControl(Me.UniqueName & "_Editor")
                combo.Text = displayText
                combo.SelectedValue = ent.GetValueByPropertName(DataValueField)
            End If
 
            MyBase.PrepareCell(cell, item)
        End If
    End Sub
 
    Protected Overrides Function CreateDefaultColumnEditor() As IGridColumnEditor
        Return New MyComboboxColumn_Editor(Me)
    End Function
End Class
 
Public Class MyComboboxColumn_Editor
    Inherits GridTemplateColumnEditor
 
    Public Property Owner As MyComboboxColumn
 
    Public Sub New(_owner As MyComboboxColumn)
        Owner = _owner
    End Sub
 
    Protected Overrides Sub AddControlsToContainer()
        Dim combo As New RadComboBox
        With combo
            .ID = Owner.UniqueName & "_Editor"
            .DataSource = MyDataSource()
            .DataValueField = Owner.DataValueField
            .DataTextField = Owner.DataTextField
            .DataBind()
        End With
 
        HtmlContainerControl.Controls.Add(combo)
    End Sub
End Class

I can send the value and text to the editor. But i do not know how to send back from editor to the container.

Please help me,

Thank you.

Nguyen
Top achievements
Rank 1
 answered on 10 Nov 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?