Telerik Forums
UI for ASP.NET MVC Forum
4 answers
146 views
I'm using a custom editor to select a value in a grid column and that's working fine. I've tried both a ComboBox and an Autocomplete and with both I'm able to get my list of values from the server and can select one in the custom editor. But when I tab to another grid cell the value disappears. If I click back to that cell the editor takes over again and the selected value reappears. But how can I make the value visible when the cell doesn't have focus?

Custom Editor:
@Html.Kendo().AutoComplete().Name("SOCAutocomplete").Events(events => events.Select("onOpCodeSelect")).DataTextField("opCode").DataSource(d => d.Read(r => r.Action("GetServiceOpCodes", "Onboarding")))

(I've tried a few things in JS in the onOpCodeSelect handler but nothing that I've tried succeeds in retaining the selected value after leaving the cell.)

Grid:
 @(Html.Kendo().Grid<Service>()
                    .Name("ServicesGrid")
                    .Columns(columns =>
                    {
                        columns.Bound(o => o.Description).Title(@Resource.ServiceData_ServiceDescription).Width(150).HtmlAttributes(new { tabindex = 999999 });
                        columns.Bound(o => o.OpCode).Title(@Resource.ServiceData_OpCode).Width(120); // because of UIHint on Service.OpCode it automatically uses OpCodeEditor.cshtml...

 


Vladimir Iliev
Telerik team
 answered on 13 Jan 2014
1 answer
124 views
The menu SecurityTrimming feature isn't hiding actions that are marked as async.

For example I have the following Action:

[Authorize]
public async Task<ActionResult> Profile()
{
     return View();
}

If I include this Action in the Menu, it displays even if the user is not logged in.
Ben
Georgi Krustev
Telerik team
 answered on 10 Jan 2014
1 answer
138 views
                <div id="tabstrip">
                    <ul>
                        <li>
                            Report #1 <span><a class="k-button" href="#"><span class="k-icon k-i-close"></span></a></span>
                        </li>
                        <li>
                            Report #2 <span><a class="k-button" href="#"><span class="k-icon k-i-close"></span></a></span>
                        </li>
                    </ul>
                    <div>Content of Report #1</div>
                    <div>Content of Report #2</div>
                </div>

I've gotten most of it, but I cannot get the k-I-close icon & the k-button in the tab.

                      @(Html.Kendo().TabStrip()
                      .Name("tabstrip")     
                      .Items(items =>
                          {
                              items.Add().Text("Report #1")
                                   .Content("Content of Report #1");
                              items.Add().Text("Report #2")
                                   .Content("Content of Report #2");
                          })
                      )

Any help would be appreciated.
Dimo
Telerik team
 answered on 10 Jan 2014
5 answers
756 views
I've made a Grid that formerly got his data from the Model.
I also had a custom collumn here that i created using columns.template which worked properly.

For sorting and search reasons a changed the datasource to a json from a viewmodel.
When i used this method my data also loaded but the template only displayed an empty column.

This is my code of the Grid:

                        @(Html.Kendo().Grid<KdG.ProjectPortofolio.IntranetApp.ViewModels.Projects.ListProjectViewModel>() 
                              .Name("Grid")
                                        .DataSource(ds => ds.Ajax()
                                                          .Read(r => r.Action("Read", "Project"))
                                        )
                              .EnableCustomBinding(false)
                              .ToolBar(toolBar => toolBar.Custom()
                                    .Text("Exporteer naar Excel")
                                    .HtmlAttributes(new { @class = "export",@id="test" })
                                    .Url(Url.Action("ExportToExcel", "Project",new { page = 1, pageSize = "~", filter = "~", sort = "~" }))
                                    

                              )
                              .Columns(columns =>
                              {
                                  columns.Bound(p => p.Name).Filterable(filterable => filterable.UI("nameFilter")).Title("Naam");
                                  columns.Bound(p => p.Status).Filterable(filterable => filterable.UI("statusFilter")).Title("Status");
                                  columns.Bound(p => p.Category).Title("Categorie");
                                  columns.Bound(p => p.StartDate).Title("Start");
                                  columns.Bound(p => p.EndDate).Title("Einde");
                                  columns.Bound(p => p.AreaOfStudy).Title("Studiegebied");
                                  columns.Bound(p => p.ProjectLeader).Title("Projectleider");
                                  columns.Template(

                                      @<text>
                                        @Html.IconActionLink("glyphicon glyphicon-info-sign", null, "Details", "Project", new { id = item.Id }, new { @class = "btn btn-default btn-xs float FloatLeft" })
                                      </text>);
                              })
                              .Filterable(f => f.Extra(false).Operators(o => o.ForString(s => s
                                  .Clear()
                                  .Contains("Bevat")
                                  .DoesNotContain("Bevat Niet")
                                  .EndsWith("Eindigd met")
                                  )))
                             
                             .Pageable()
                             .Groupable()
                             .Sortable()//Enable paging
)

Thanks in advance
Dimiter Madjarov
Telerik team
 answered on 10 Jan 2014
3 answers
74 views
At Runtime:
Kendo.Mvc.UI.Fluent.EditorToolFactory&#39; does not contain a definition for &#39;ViewHtml&#39; and no extension method &#39;ViewHtml&#39; accepting a first argument of type &#39;Kendo.Mvc.UI.Fluent.EditorToolFactory&#39; could be found (are you missing a using directive or an assembly reference?)

Kendo.Mvc.dll
Version 2013.2.918.340

What gives?
Daniel
Telerik team
 answered on 10 Jan 2014
2 answers
109 views
I have a weird problem with grid paging.
Whenever i select apge 11 it does not work. I still see page i was before. e.g. on page 10 i press next - i still see page 10.

The grid setup: PageSize(10), pageable.ButtonCount(5)
Total data count: 112

Loaded dynamically by ajax:
Json result looks like (generated with kendo function extionsion ToDataSourceResult()):
{
  "Data": [
    ... 10 items ...
  ],
  "Total": 112,
  "AggregateResults": null,
  "Errors": null
}

I have logged the DataResults - and i saw, that the correct items are send back to the client, but they are not displayed (but only on page 11 - all other pages show the correct items, even page 12, when ein press the last page button).
Is there a bug in kendo ui grid? (i'm using the latest kendo ui version 2013.3.1119)
Oliver
Top achievements
Rank 1
 answered on 09 Jan 2014
2 answers
303 views
I need the parent's item while binding the child item setting it's action.  I need to pass the categoryName from the category (parent) on the child action call.  Is this possible?  If so, how?  Any help is very much appreciated!

Here is the panelbar code:
@(Html.Kendo().PanelBar()
.Name("MainMenu")
.ExpandMode(PanelBarExpandMode.Single)
.BindTo(Model, mappings =>
    {
        mappings.For<GMCWeb.Areas.bi.Models.ReportCategory>(binding => binding
            .ItemDataBound((item, category) =>
                {
                    item.Text = "<div class='row'><div class='col-md-9'>" + category.categoryName + "</div><div class='col-md-3 menu-arrow'><i class='fa fa-arrow-circle-right fa-2x'></i></div></div>";
                    item.Encoded = false;
                })
                .Children(category => category.reportCategories));
        mappings.For<GMC.CustomerInformation.DashboardParameters.ReportCategoryInformation>(binding => binding
            .ItemDataBound(
            (item, reportCategory) =>
               {
               item.Text = reportCategory.ReportCategoryName;
               item.Enabled = !reportCategory.Disabled;
               item.Action("GetReports", "Home", new RouteValueDictionary { { "category", category.categoryName } });
               }));    
    }))
Donna Stewart
Top achievements
Rank 1
 answered on 08 Jan 2014
10 answers
639 views
My application is in ASP.NET MVC 5 using Razor views and remote data stored in a SQL Server database.

I have a Kendo Grid which contains a list of Users. This list of users then becomes a resource list in a Kendo Scheduler.

The problem I have is when I add a new user to the grid, open the scheduler then open the task editor the new user does not appear in the resource list; the new user appears in the grid and is created in the database. If I exit the application and then re-run it the user is present in the scheduler resource dropdown. In other words the resource datasource is not being refreshed when the scheduler is displayed.

Now the complication:
The user grid sits in a Partial View: The grid has a toolbar template consisting of a 'Create New User' button(editing is via a popup)  and a Kendo button which calls a script to display a Kendo Window; the window is model and configured via .LoadContentsFrom to display the scheduler view.

I have tried several methods, found on this forum, to get the scheduler resources to update before opening the task editor without success.

Your help would be appreciated

Alan
Alan
Top achievements
Rank 2
 answered on 08 Jan 2014
4 answers
109 views
Hey,

I've been using your MVC wrappers for some time and I absolutely love them!
I just migrated a project on which I was using the Telerik Extensions for ASP.NET MVC to use Kendo UI. There have been some problems, but in the end it works like a charm.

I'm just faced with an issue I can't resolve...
On a "Details" page, I have a static, server-bound grid with a column which has a specific EditorTemplate, itself using a Kendo DropDownList.

All my controls use the deferred JS output to keep all the JS clean and at the bottom of the page.
My issue is that the initalization script of the DropDownList is outputted right after the <input> and not at the bottom of the page where I call the DeferredScripts() function.

Let me show you some code that may clear up what I'm trying to explain.

My Models:
public class MyParentViewModel
{
    public IEnumerable<MyChildViewModel> Children
    {
        get;
        set;
    }
}
 
public class MyChildViewModel
{
    public String DummyString
    {
        get;
        set;
    }
 
    public Boolean? DummyBoolean
    {
        get;
        set;
    }
}
My view:
@model MyParentViewModel
 
@(
    Html.Kendo().Grid(Model.Children)
        .Name("Children")
        .Deferred()
        .Columns(c =>
        {
            c.Bound(x => x.DummyString);
            c.Bound(x => x.DummyBoolean);
        });
)
The EditorTemplate associated to the DummyBoolean property:
@model Boolean
 
@(
    Html.Kendo().DropDownListFor(x => x)
        .Deferred()
        .Items(items =>
        {
            items.Add().Selected(value == false).Text("Non").Value(Boolean.FalseString);
            items.Add().Selected(value == true).Text("Oui").Value(Boolean.TrueString);
        })
        .HtmlAttributes(new { style = "width:100px; line-height:normal;" })
)
And that's the outputted HTML:
<div class="k-widget k-grid k-secondary" id="Groupements" data-role="grid">
    <table role="grid">
        <colgroup>
            <col style="width:20%">
            <col>
        </colgroup>
        <thead class="k-grid-header">
            <tr>
                <th class="k-header" data-field="DummyString" data-title="DummyString" scope="col">
                    <span class="k-link">DummyString</span>
                </th>
                <th class="k-header" data-field="DummyBoolean" data-title="DummyBoolean" scope="col">
                    <span class="k-link">DummyBoolean</span>
                </th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>Groupement #1</td>
                <td>
                    <input disabled="disabled" id="DummyBoolean" name="DummyBoolean" style="width:100px; line-height:normal;" type="text" value="True">
                    <script>
                        jQuery(function () { jQuery("#DummyBoolean").kendoDropDownList({ "dataSource": [{ "Text": "Non", "Value": "False", "Selected": false }, { "Text": "Oui", "Value": "True", "Selected": true }], "dataTextField": "Text", "dataValueField": "Value" }); });
                    </script>
                </td>
            </tr>
            <tr class="k-alt">
                <td>Groupement #2</td>
                <td>
                    <input disabled="disabled" id="DummyBoolean" name="DummyBoolean" style="width:100px; line-height:normal;" type="text" value="True">
                    <script>
                        jQuery(function () { jQuery("#DummyBoolean").kendoDropDownList({ "dataSource": [{ "Text": "Non", "Value": "False", "Selected": false }, { "Text": "Oui", "Value": "True", "Selected": true }], "dataTextField": "Text", "dataValueField": "Value" }); });
                    </script>
                </td>
            </tr>
        </tbody>
    </table>
</div>
As you can see, we only have here the DropDownLists' initialization scripts.
The table's is at the bottom of the page where I expect it to be.

Is there anything I'm missing?
Thanks in advance.
Sincerely,
Mickaël Derriey
Alexander Popov
Telerik team
 answered on 08 Jan 2014
5 answers
486 views
I'm initialising a chart in MVC razor syntax, and am unable to find a way of specifying the schema of returned data from an AJAX bound DataSource, as specified in the DataSource documentation:

schema: {
    data: "results" // twitter's response is { "results": [ /* results */ ] }
}

As I'm not autobinding my chart, I've tried setting the schema property in JS before calling the read() method on the DataSource , but this doesn't seem to make any difference:

chart.dataSource.options = { schema: { data: "results" } };

Is this functionality possible using the ASP.NET wrappers?
Orrin
Top achievements
Rank 1
 answered on 07 Jan 2014
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
Upload
ComboBox
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
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
ListView (Mobile)
Pager
Accessibility
ColorPicker
DateRangePicker
Wizard
Security
Styling
Chat
MediaPlayer
TileLayout
DateInput
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
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?