Telerik Forums
UI for ASP.NET MVC Forum
2 answers
131 views
I am using a parameter to allow manually editing group rotation angle, when an angle has been set, moving the affected shape/group causes the height to at least 3x it's original size and width to fluctuate up and down. Also, when a shape has been rotated, the selector doesn't rotate, causing an offset between the shape and it's selector.
Note: I noticed that moving the group after rotation triggers the ItemRotate event;

                    if (dataItem.Align.toUpperCase() === "left".toUpperCase()) {
                        g.append(new dataviz.diagram.Rectangle({
                            width: dataItem.width,
                            height: dataItem.height,
                            fill: dataItem.Color
                        }));

                        g.append(new dataviz.diagram.Rectangle({
                            width: dataItem.width * 0.25,
                            height: dataItem.height,
                            fill: "Red"
                        }));
                        g.rotate(dataItem.Angle, new dataviz.diagram.Point(30, 30));


                    }
I have tried :
Setting the rotation on each shape instead of the group, with the same results. see below
setting rotation angle in shape defaults but each group's Angle varies and was unable to set it dynamically using the dataItem's Angle.
var rect = new dataviz.diagram.Rectangle({
                            width: dataItem.width * 0.25,
                            height: dataItem.height,
                            fill: "Red"
                        });
rect.rotate(dataItem.Angle, new dataviz.diagram.Point(30, 30));
Tjay
Top achievements
Rank 1
 answered on 04 Dec 2018
1 answer
910 views

Every example that has custom paging always fails to address the question. Every example has the controller receiving the DbContext for the ToDataSourceResult method to then do the paging which is not what is wanted.

 

Take a look at the example on this page: https://docs.telerik.com/aspnet-mvc/helpers/grid/binding/custom-binding#custom-ajax-binding

public ActionResult Orders_Read([DataSourceRequest]DataSourceRequest request)
    {
        //Get the data (code omitted).
        IQueryable<Order> orders = new NorthwindEntities().Orders;
 
        //Apply sorting (code omitted).
 
        //Apply paging (code omitted).
 
        //Initialize  the DataSourceResult.
        var result = new DataSourceResult()
        {
            Data = orders, // Process data (paging and sorting applied)
            Total = total // Total number of records
        };
    }

 

The problem is when we don't pass our DbContext this far up.

 

I'm trying to do custompaging on the grid, my controller calls a middle layer which does the paging and filtering and returns an IList<OrderViewModels> with only the 20 items for the page. Except it doesn't work unless I return all 700,000 records. Then it magically pages and somehow this is supposed to be called serverside paging. It is only paging at the UI layer which is incredibly inefficient. Granted it is not doing it on the client, but it is still no good if it is at the UI layer as I'm having to return all records from the datalayer.

 

public ActionResult GetFilteredOrders([DataSourceRequest] DataSourceRequest request, OrderSearchModel model)
        {         
            var dataResults = orderSearcher.GetOrders(model); // Users datalayer to returns the paged 20 items and total    
            var resultObject = new DataSourceResult()
            {
                Data = dataResults.OrderList, // Process data (paging and sorting already applied)
                Total = dataResults.DataTotal // Total number of records
            };
            return Json(result);
        }

 

This only works on page 1 and nothing on any other page, even though I can see that dataResults has data. 

 


Georgi
Telerik team
 answered on 04 Dec 2018
1 answer
185 views

Hi,

Every time I upgrade the Kendo with the upgrade wizard the culture files I need for my non-English language are ignored. It is easy to miss, since most things work after the upgrade, but there are some subtle problems that arise when the culture files are missing. Like NumericTextBox that changes the decimal point character.

 

Would it be possible to have the upgrade wizard handle also the culture and message files? Or at least a reminder on the upgrade wizard log page that this needs to be done?

 

Best regards,

Henrik

Nikolay Mishev
Telerik team
 answered on 03 Dec 2018
9 answers
1.1K+ views
Is there a helper for TextBox? I tried using AutoComplete, but I think it's an over kill and it does not cache entries like Text Boxes, so it functions differently and may confuse users.

Thanks
Alex
Jim
Top achievements
Rank 1
 answered on 03 Dec 2018
1 answer
356 views

I'm trying to use the Telerik MVC TreeView control with checkboxes in a form. This form is use to create and modify my view Model to recover the user informations (in particular categories selection). 
The treeview control shows two levels. 
In case of creation, the treeview control must expand all levels.
In case of modify, the treeview control must shows the checkboxes populate in database.

How retrieve the selection of treewiew control in my view model ? I would like to retrieve the selection of treeview control in controller.

Do you have a sample code to explain that ? The demo of treewiew control doesn't explain this binding type of remote data. My treeview control is not make on demand.

My form looks like this :

@model DigitalVM

 

@using (Html.BeginForm("saveCampaign", "Digital", FormMethod.Post))
            {
                @Html.AntiForgeryToken()
                <!-- Champs cachés -->
                @Html.HiddenFor(model => Model.ID)
                <div class="row 1">
                    <div class="form-group col-xs-12 col-md-6 Libelle">
                        @Html.LabelFor(model => model.Libelle)
                        <div>
                            @(Html.Kendo().TextBoxFor(model => model.Libelle)
                                                        .HtmlAttributes(new { style = "width:100%" })
                            )
                            @Html.ValidationMessageFor(model => model.Libelle, "", new { @class = "text-danger" })
                        </div>
                    </div<!-- Libelle -->
                    <label>Categories</label>
                    <div class="form-group col-xs-12 col-md-6 Diffusion">
                        @(
                            Html.Kendo().TreeView()
                                .Name("Categories")
                                .Checkboxes(checkboxes => checkboxes
                                    //.Name("IsChecked")
                                    .CheckChildren(true)
                                )
                                .BindTo(Model.ModelTree, mappings =>
                                {
                                    mappings.For<ModelTree>(binding => binding.ItemDataBound((item, modelItem) =>
                                    {
                                        item.Id = modelItem.id;
                                        item.Text = modelItem.Name;
                                        item.Expanded = modelItem.Expanded;
                                        item.Checked = modelItem.Checked;
                                    })
                                    .Children(category => category.Children));
                                })
                                .Events(ev => ev.Check("onCheck"))
                        )
                    </div>
                </div> <!-- row 1 -->
                <div style="padding-top: 2em;">
                    <h4>Status</h4>
                    <p id="result">No nodes checked.</p>
                </div>
                <div><span class="icon icon-lock"> @PortailMR.Resources.Shared.Shared.RequiredFields</span></div>
                <div>@Html.ValidationMessage("CustomError", new { @class = "text-danger" })</div>
                <div class="form-group gbuttons">
                    <div class="k-edit-buttons text-right">
                        @*<input type="submit" value="@PortailMR.Resources.Shared.Shared.Buy.ToUpper()" title="Buy" class="icon icon-shopping-basket k-button" />*@
                        @(Html.Kendo().Button()
                            .Name("Commander")
                            .Content("Liste insertion")
                            .Icon("icon icon-next2")
                            .HtmlAttributes(new { @type = "submit", @onClick = "abortEvtUnload(true)" }))
                        @Html.ActionLink(" " + @PortailMR.Resources.Shared.Shared.Cancel, "Index", "Digital", null, new { @class = "k-button k-button-icontext k-grid-cancel", @onClick = "abortEvtUnload(true)" })
                    </div>
                </div> <!-- gbuttons -->
            }

My Controller looks like this :

[Authorize]
        [ValidateAntiForgeryToken]
        [HttpPost]
        //public ActionResult SendCommand(CommandeVM currentOffre) // OK
        public ActionResult saveCampaign(DigitalVM model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    writeLog(MethodBase.GetCurrentMethod(), "Start", "Info");
 
                    // SAVE Model in DATABASE
                    //var connectManager = ConnectManagers.FirstOrDefault(mng => mng.Product == model.Version);
 
                    return View("index");
                }
                return View("_TreeView", model);
            }
            catch (BusinessException bex)
            {
                SetModelError(MethodBase.GetCurrentMethod(), bex);
                return View("ErrorBusiness", "_Layout3", new HandleErrorInfo(bex, "Offre", "Index"));
            }

My View model looks like this :

public class ModelTree
{
    public string id { get; set; }
    public string Name { get; set; }
    public bool Checked { get; set; }
    public bool Expanded { get; set; }
    public IList<ModelTree> Children { get; set; }
    public ModelTree Parent { get; set; }
}
public class DigitalVM
{
    public int ID { get; set; }
     
    public String Libelle { get; set; }
 
    public IEnumerable<ModelTree> ModelTree { get; set; }
}

Best regards,

Steph.

Veselin Tsvetanov
Telerik team
 answered on 30 Nov 2018
1 answer
260 views

I've been fighting with a solution - I have to take a flat file, sometimes 200 mb or larger and and display that in a grid.

Stripping the data from the file is a snap using any one of several methods, but getting into a useful object the Grid can use becomes a real time-crusher.

The raw data is comma-delimited text with headers.

Is it possible to feed a csv into the grid?  If so, how?

I can't provide sample code because of security and time constraints.

The most promising approach has been query the the target file using OleDb classes including a OleDbDataReader.  Reading a 400k records file into a data table takes about 20 seconds give or take.  Applying that to a Grid just blows everything out of the water.  Virtual scrolling doesn't help.  I simply can't get a large file to display in your grid helper.

Grid for JS doesn't work any better.

 

Can the Grid actually display a datasource of that size in a reasonable amount of time?  Like less than a minute?

 

 

 

Tsvetina
Telerik team
 answered on 29 Nov 2018
3 answers
869 views

I have set up editor to use br instead of p for new line.

The problem I encounter is <br class="k-br"> tag is added in some situation whene ver the user select and apply the font as well.

 

Because of adding it automatically by the editor, when I get the editor value using value method, the line break is missing.

 

So, how can I set up not to add automatically line break with k-br class? Or how can I set up not to strip off br tag?

 

Thanks in advanced.

Kai

Marin Bratanov
Telerik team
 answered on 29 Nov 2018
9 answers
1.3K+ views

Setup: Master-Detail with TabStrip and Grid.

Inside a TabStrip item, which is inside a ClientDetailTemplate of a Grid, I need to have an editable Grid.

The Model for the ClientDetail contains 20 columns, but only three of them must be editable, so I want to put these three columns in an editable Grid. I want to display the rest of the (non-editable) columns in a <div><ul><li> setup, so I can style it in a multi column vertically setup for better readability (putting them as readonly columns inside the Grid would cause a huge horizontal layout).

Is there a way to bind the <li> #= items # </li> to the datasource that is bind to the Grid inside the TabStrip? It looks like I can only bind to the data that is in the Master that contains the ClientDetailTemplate.

The detail data inside the Grid, which is inside the TabStrip item, has its own datasource and this is working as expected. I just need to know how to bind the remaining values to some HTML.

TIA

Viktor Tachev
Telerik team
 answered on 28 Nov 2018
1 answer
176 views

We are using the grid to display forecast data.  it has about 15 rows.  In all but two rows, we are doing custom editing (launching another screen to edit values).  We use a column with our custom buttons to do launch the secondary screen.

In two of the rows, we would like to have in-line editing.  We'll use the same custom buttons to do this. However, we cannot find a way to programmatically put a row into in-line editing (EDIT MODE).  Is there a way to do this?  All we are able to do is to make the entire grid in-line editable and that is not what we desire. 

TIA! 

--- xavier

Georgi
Telerik team
 answered on 28 Nov 2018
4 answers
1.1K+ views

How can I correctly associate the label generated by Html.LabelFor() with my MVC Kendo DropDownListFor(). It seems like it should work but is not read by the screen reader, perhaps due to the hidden input field.

 

        <div class="input-block-level">
            @Html.LabelFor(m => m.BirthdayMonth, new {@class = "col-md-5 control-label"})
            <div class="col-md-3">
                @(Html.Kendo().DropDownListFor(m => m.BirthdayMonth)
                    .Name("BirthdayMonth")
                    .OptionLabel("Month")
                    .DataTextField("Text")
                    .DataValueField("Value")
                    .BindTo(new List<SelectListItem>
                    {
                        new SelectListItem {Text = "01 - Jan", Value = "1"},
                        new SelectListItem {Text = "02 - Feb", Value = "2"},

                                 [...etc...]
                        new SelectListItem {Text = "11 - Nov", Value = "11"},
                        new SelectListItem {Text = "12 - Dec", Value = "12"}
                    })
                    .HtmlAttributes(new {@class = "form-control", style = "width:100px"})
                    .Deferred()
                )
            </div>

        </div>

Thanks,

Gary Davis

Gary Davis
Top achievements
Rank 2
 answered on 27 Nov 2018
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
ComboBox
Upload
MultiSelect
ListView
Window
TabStrip
Menu
Installer and VS Extensions
Spreadsheet
AutoComplete
TreeList
Gantt
PanelBar
NumericTextBox
Filter
ToolTip
Map
Diagram
Button
PivotGrid
Form
ListBox
Splitter
Application
FileManager
Sortable
Calendar
View
MaskedTextBox
PDFViewer
TextBox
Toolbar
Dialog
MultiColumnComboBox
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
Security
ColorPicker
DateRangePicker
Wizard
Styling
Chat
DateInput
MediaPlayer
TileLayout
Drawer
SplitView
Template
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Licensing
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Localization
MultiViewCalendar
PopOver (Mobile)
Ripple
ScrollView (Mobile)
Switch (Mobile)
PivotGridV2
FlatColorPicker
ColorPalette
DropDownButton
AIPrompt
PropertyGrid
ActionSheet (Mobile)
BulletGraph
Button (Mobile)
Collapsible
Loader
CircularGauge
SkeletonContainer
Popover
HeatMap
Avatar
ColorGradient
CircularProgressBar
SplitButton
StackLayout
TimeDurationPicker
Chip
ChipList
DockManager
ToggleButton
Sankey
OTPInput
ChartWizard
SpeechToTextButton
InlineAIPrompt
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
LLM Kit
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?