Telerik Forums
Kendo UI for jQuery Forum
7 answers
726 views
Here is what I've got:

Controller:

        public ActionResult TestIndex()
        {
            var model = new Zeus.Models.SiteModels();
            Models.Site[] sites = model.List(50, 1);

            return View(sites.ToList());
        }


View:

@model IEnumerable<Zeus.Models.Site>
@{
    ViewBag.Title = "TestIndex";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>TestIndex</h2>

@(Html.Kendo().Grid(Model)
    .Name("Grid")
    .Columns(columns =>
    {
        columns.Bound(p => p.Name).Groupable(false);
        columns.Bound(p => p.Address1);
        columns.Bound(p => p.CityName);
        columns.Bound(p => p.OwnerGroupName);
    })
    .Pageable()
    .Sortable()
    .Scrollable() 
    .Filterable()    
    .DataSource(dataSource => dataSource        
        .Ajax()
        .ServerOperation(false)        
     )
)


I get an error:
[ArgumentOutOfRangeException: Index must be within the bounds of the List.<br>Parameter name: index]<br>   System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) +64<br>   System.Collections.ObjectModel.Collection`1.Insert(Int32 index, T item) +9573490<br>   Kendo.Mvc.UI.Grid`1.WriteHtml(HtmlTextWriter writer) +365<br>   Kendo.Mvc.UI.WidgetBase.ToHtmlString() +86<br>   Kendo.Mvc.UI.Fluent.WidgetBuilderBase`2.ToHtmlString() +22


Any idea why?
Rosen
Telerik team
 answered on 29 Oct 2013
3 answers
375 views
Hi,

I need to insert single characters programmatically into an editor (use case symbol selector for special characters).

Using the insertHTML API I can insert the right character, but the character/string is inserted outside the existing text-span's in the editor.
Same result when using the 'paste' API.

Since the character is *not* inserted inside the span of the existing text, it will be using the default formatting, and not the formatting of the text next to it.

Example: "ABC" is entered into the editor, the font-size is set to a non-default size.  If a character is inserted using insertHTML or paste after the "ABC", it will be using the default font-size, not the size of the text next to it.

Is there a way to insert a character or string into the current text-span so formatting can be preserved ?

Thanks.
Mikkel
Top achievements
Rank 1
 answered on 28 Oct 2013
1 answer
72 views
I have attached a simple test app to replicate this behavior.
There are 2 pages, the main index.html page, and a remote list.html page.
On the index page there is a textbox into which you can enter any input. When you click the login button the value of that input is read and echoed to the console, as well as appended to the URL for the remote view.

So if you enter 'bilbo' the URL for the remote view will be ".../list.html?val=bilbo'".

If you hit the cancel button on the list page you go back to the index page. Now the interesting part. If you enter another value in the text box and click login, it will always read 'bilbo' from the text box.

What I have noticed:
if the cancel button on the list page invokes app.navigate("#:back") or you use the back button everything works.
if you invoke app.navigate("index.html") or app.navigate("vIndex") then we get the same 'locked in' behavior.

Now, in this example it's great that the "#:back" function works. But in my actual app I have multiple remote views and I can't transition between them to capture new input. Once the value is set the first time it's locked in.

Petyo
Telerik team
 answered on 28 Oct 2013
15 answers
1.5K+ views
Hi there

I am trying to implement Image Browser for Kendo Editor using the example here : http://demos.kendoui.com/web/editor/imagebrowser.html

My controller class : 

public class ImageBrowserController : EditorImageBrowserController
    {
        private const string contentFolderRoot = "~/Content/";
        private const string prettyName = "Images/";
        private static readonly string[] foldersToCopy = new[] { "~/uploads/newsitem/" };
 
 
        /// <summary>
        /// Gets the base paths from which content will be served.
        /// </summary>
        public override string ContentPath
        {
            get
            {
                return CreateUserFolder();
            }
        }
 
        private string CreateUserFolder()
        {
            var virtualPath = Path.Combine(contentFolderRoot, "UserFiles", prettyName);
 
            var path = Server.MapPath(virtualPath);
            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
                foreach (var sourceFolder in foldersToCopy)
                {
                    CopyFolder(Server.MapPath(sourceFolder), path);
                }
            }
            return virtualPath;
        }
 
        private void CopyFolder(string source, string destination)
        {
            if (!Directory.Exists(destination))
            {
                Directory.CreateDirectory(destination);
            }
 
            foreach (var file in Directory.EnumerateFiles(source))
            {
                var dest = Path.Combine(destination, Path.GetFileName(file));
                System.IO.File.Copy(file, dest);
            }
 
            foreach (var folder in Directory.EnumerateDirectories(source))
            {
                var dest = Path.Combine(destination, Path.GetFileName(folder));
                CopyFolder(folder, dest);
            }
        }
    }
My js code

$("#Content").kendoEditor({
        encoded: false,
        imageBrowser: {
            messages: {
                dropFilesHere: "Drop files here"
            },
            transport: {
                read: "/console/ImageBrowser/Read",
                destroy: {
                    url: "/console/ImageBrowser/Destroy",
                    type: "POST"
                },
                create: {
                    url: "/console/ImageBrowser/Create",
                    type: "POST"
                },
                thumbnailUrl: "/console/ImageBrowser/Thumbnail",
                uploadUrl: "/console/ImageBrowser/Upload",
                imageUrl: "/console/ImageBrowser/Image?path={0}"
            }
        },
        tools: [
            "bold",
            "italic",
            "underline",
            "strikethrough",
            "fontSize",
            "foreColor",
            "backColor",
            "justifyLeft",
            "justifyCenter",
            "justifyRight",
            "justifyFull",
            "createLink",
            "unlink",
            "insertImage",
            "style",
            "viewHtml"
        ],
        style: [
                { text: "Highlight Error", value: "hlError" },
                { text: "Highlight OK", value: "hlOK" },
                { text: "Inline Code", value: "inlineCode" }
        ],
        stylesheets: [
            "../../content/web/editor/editorStyles.css"
        ]
    });

My image folder is : /uploads/newsitem and the code generates a folder /content/userfiles/images and this folder does have write permission. 

When any actions are invoked on EditorImageBrowserController they are 404'ed. I've attached a screen shot to show what is going on.

Any help would be greatly appreciated.
Rosen
Telerik team
 answered on 28 Oct 2013
3 answers
126 views
Hi Telerik support team
I am using custom icons for listview but those don't work fine using the documentation guidelines
I Attached the project for your review.

Thanks in advance and I am aware for your help.

Regards.

Diego Varela
Kiril Nikolov
Telerik team
 answered on 28 Oct 2013
1 answer
187 views
Hi everyone! 

I'm having a problem with treeview - I need to set a callback function (or an individual parameter to a common function, which would be even better) for the click event on each treeview leaf element (or all elements regardless whether they be leaf or non-leaf node). Imagine it as a structured menu for javascript functions (not http links).


 I'm now using a very unelegant and unnice workaround with javascript: link in dataUrlField. I'v been reading through this forum, SO and whatever google threw at me but could not find any single mention about callbacks in the treeview other than dataUrlField and the select event, use of which I find as unfeasible as the first possibility I mentioned. 

Thank you very much for ideas and suggestions.

Pavel
Pavel
Top achievements
Rank 1
 answered on 28 Oct 2013
3 answers
1.5K+ views
I have two grids on top of one another, showing different data but using the same column layout. Don't ask why; it's a market research thing.

To save space, I really don't need the header row for the second grid, since it aligns with the header columns for the first grid.

How to get rid of header row for the second grid and use that saved space for data rows?

I've tried this, but it leaves a gap at the bottom of the grid instead of distributing the saved space to the rest of the grid.
#cntr-bnch .k-grid-header {
    display               : none;
}
Garðar
Top achievements
Rank 1
 answered on 28 Oct 2013
2 answers
101 views
Hello,

I think the visible property doesn't render the navigator chart as expected, when set to false : http://jsbin.com/uyAvOna/1/edit

Stefania
Stefania
Top achievements
Rank 1
 answered on 28 Oct 2013
1 answer
83 views
Now I need filter grid data by mutil values(user kendoMultiSelect ui), how to fix it?

use as

columns: [
           ....................
          {
                                field: "City",
                                width: 130,
                                filterable: {
                                    ui: cityFilter
                               }
             },
            .....................
]

AND:
function cityFilter(element) {
                    element.kendoMultiSelect({
                        dataSource: sourceData,
                        dataTextField: "text",
                        dataValueField: "text",
                    });
                }
Kiril Nikolov
Telerik team
 answered on 28 Oct 2013
3 answers
319 views
I'm looking for a way to replace this MS chart (see attachment) with a horizontal bar chart that has a range for high and low values (yellow portion in the image).  Is there any way to do this with the DataViz charts? 
Iliana Dyankova
Telerik team
 answered on 28 Oct 2013
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Application
Drag and Drop
Map
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
ListBox
DropDownTree
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
Licensing
ScrollView
Switch
TextArea
BulletChart
QRCode
ResponsivePanel
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
TimePicker
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?