Telerik Forums
UI for ASP.NET MVC Forum
3 answers
473 views

Hi! I'm trying to do the following:

I have a grid of groups, and each group can have a bunch of items. The items have two fields right now (url and name, ie two text fields) . I'd like to create a new group, and in the popup editor, being able to add items to it.

The group is something like:

public class Group

{

  public long Id {get; set;}

  public string Name {get; set;}

  public List<Item> Items {get; set;}

}

And the items are like:

public class Item

{

   public long Id {get; set;}
   public string Name {get; set;}

   public string Url{get; set;}

}

I tried to use a ListView but it didnt quite work (seems the API is way, way less developed than the grid's for example), what do you think its the best way to do this? Maybe another grid with inline editing?

Ideally what I'd want is for the nested Item editor to add items to the group being created, and once that group is submitted, then persist everything in the DB.

Danail Vasilev
Telerik team
 answered on 13 Sep 2016
2 answers
148 views

Recently I met a issue that when I batch update my grid, and it's always call the action I not assign to ?  And I have no idea why the grid keep calling Index action when I press the save changes button. here is the code below, my update controller and action is IV21080W and SenToTurnkey. No matter what I change the action, the grid just keep calling Index action.  this issue just pendding me lots of days.

.DataSource(dataSource => dataSource.Ajax().PageSize(15).Batch(true)
.Events(events => { events.Error("IV21080WErrors"); events.RequestEnd("IV21080WCRUDevents"); })
.Update("SentToTurnkey", "IV21080W")
.Read("Read", "IV21080W").Filter(x => x.Add(z => z.INVOICEDATE).IsEqualTo(DateTime.Parse("2016/09/01")))
.Model(model => { model.Id(m => m.KEY_NO); model.Field(m => m.errorType).Editable(false); model.Field(m => m.INVOICENUMBER).Editable(false); model.Field(m => m.INVOICEDATE).Editable(false); model.Field(m => m.INVOICETIME).Editable(false); model.Field(m => m.AMOUNT).Editable(false); model.Field(m => m.TAXAMOUNT).Editable(false); model.Field(m => m.TOTALAMOUNT).Editable(false); })
)
.Editable(editable => editable.Mode(GridEditMode.InCell))
.AutoBind(true)
.Sortable()
.Filterable()
.Scrollable(s => s.Height("auto"))
.Pageable(pageable => pageable.Refresh(false).PageSizes(false).ButtonCount(5))
.ToolBar(toolbar => { toolbar.Excel(); toolbar.Save().SaveText("SentToTurnkey"); })
.Excel(excel => excel.FileName("IV21080W.xlsx").Filterable(true).AllPages(true).ProxyURL(Url.Action("Save", "ILISFinPublic")))

ITGF
Top achievements
Rank 1
 answered on 13 Sep 2016
9 answers
1.2K+ views
I've noticed that we have the option of doing a custom sort here: [url]http://docs.telerik.com/kendo-ui/api/web/grid#configuration-columns.sortable.compare[/url].

I'm using the MVC wrappers, but cannot figure out the syntax to make it work in my grid, or find an example.  Could you provide me with an example of this functionality using the MVC wrapper?
Dimiter Madjarov
Telerik team
 answered on 13 Sep 2016
4 answers
583 views
Hi all,

I use a ViewModel when binding to a grid.
However when using the filtering function I get the following:

Invalid property or field - 'UserName' for type: ErrorLog

Username is only a property in the ErrorLogViewModel

The code to fill my view model is:
public ActionResult ListErrors([DataSourceRequest]DataSourceRequest request)
        {
            IQueryable<ErrorLog> errorLogs = (IQueryable<ErrorLog>)db.ErrorLogs.Include(e => e.User).OrderByDescending(e => e.ErrorLogId);
            DataSourceResult result = errorLogs.ToDataSourceResult(request, errorLog => new ErrorLogViewModel
                {
                    ErrorLogId = errorLog.ErrorLogId,
                    Message = errorLog.AdditionalMessage,
                    Timestamp = errorLog.Timestamp,
                    UserName = errorLog.User.UserName
                });
            return Json(result);
        }

Thanks,
Keith. 









Maria Ilieva
Telerik team
 answered on 12 Sep 2016
2 answers
114 views

hello Support,

    We are using Spreadsheet and found one issue. This issue also exist in Online Demo. Enter some words in cell that not any format, save as Json or Excel file. Next, import the saved Json or Excel file again, you will find the words has redundant Underline format.

    Seemly it is bug for Spreadsheet widget. Could you please give us some advice? We are using this widget in our project and it is emergency.

Thanks

Mark

 

   

Stefan
Telerik team
 answered on 09 Sep 2016
5 answers
1.3K+ views

Hi,

I am trying to build a grid that has a detail template displaying child records. One of the columns in the grid (both the main grid and sub-grid) should display a dropdown menu. This is all mostly straightforward but I have a couple of issues/questions.

1. The properties of the child objects do not seem to be available within the context of the detail template. How can I access those properties?

2. I cannot seem to figure out how to add the dropdown menu in the grid column. I've tried to apply examples from the demos but keep getting errors like "Invalid Template" when attempting to use a client template or "Cannot convert lambda expression" when I try to use a foreach loop to add submenu items.

Product: Telerik MVC UI

Version: 2016.2.714

 

Please take a look at the attached sample solution and point me in the right direction. (I could not add the Content and Scripts folders as they cause me to exceed the 2MB upload limit; however those folder are out of the box Telerik MVC UI scaffolded so I hope you can add them). Also see the Razor View code below.

@{
    ViewBag.Title = "Home Page";
}
<div class="container-fluid">
    <div class="row">
        <div class="col-xs-18 col-md-12">
@(Html.Kendo().Grid<TelerikMvcApp1.Models.Shop>()
        .Name("grid")
        .Columns(columns =>
        {
            columns.Bound(e => e.ShopId).Width(110);
            columns.Bound(e => e.ShopName);
            columns.Template(@<text></text>).ClientTemplate(
                Html.Kendo().Menu()
                    .Name("menu_#=ShopId#")
                    .Items(menu =>
                    {
                        menu.Add().Text("Pay Affiliates").Items(nested =>
                        {
                            // How does one loop through the affiliates here?
                            nested.Add()
                                .Text("[How to get affiliate name here]?");
                               // .Action("ActionName", "ControllerName", new { ShopId = "#=ShopId#", AffiliateId = "#=AffiliateId#" });
                                });

                        })
                    .ToClientTemplate().ToHtmlString()
                );
        })
        .Sortable()
        .Pageable()
        .Scrollable()
        .ClientDetailTemplateId("affiliates-template")
        .HtmlAttributes(new { style = "height:600px;" })
        .DataSource(dataSource => dataSource
            .Ajax()
            .PageSize(6)
            .Read(read => read.Action("Shops_Read", "Grid"))
        )
        .Events(events => events.DataBound("dataBound"))
)
      </div>
    </div>
</div>
<script id="affiliates-template" type="text/kendo-tmpl">
    @(Html.Kendo().Grid<TelerikMvcApp1.Models.Affiliate>()
            .Name("grid_#=ShopId#") // template expression, to be evaluated in the master context
            .Columns(columns =>
            {
                columns.Bound(o => o.AffiliateId).Width(110).ClientTemplate(" \\#= AffiliateId \\#"); ;
                columns.Bound(o => o.AffiliateName).ClientTemplate(" \\#= AffiliateName \\# promotes \\#= ShopName \\#");
            })
            .DataSource(dataSource => dataSource
                .Ajax()
                .PageSize(10)
                .Read(read => read.Action("Affiliates_Read", "Grid", new { ShopId = "#=ShopId#" }))
            )
            .Pageable()
            .Sortable()
            .ToClientTemplate()
    )
</script>
<script>
    function dataBound() {
        this.expandRow(this.tbody.find("tr.k-master-row").first());
    }
</script>

Viktor Tachev
Telerik team
 answered on 09 Sep 2016
1 answer
102 views

Requirements

Telerik Product and Version

Kendo

Supported Browsers and Platforms

IE

Components/Widgets used (JS frameworks, etc.)


Hello Telerik Team,

 

We are looking for a Kendo-MVC control equal to the below link:-

http://demos.telerik.com/aspnet-ajax/splitter/examples/sp_firstlook/defaultcs.aspx

we need to overlay on another control same like the above example. we have already seen the Kendo slider which does not fit into our requirement.

 

Please let us know ASAP.

Rumen
Telerik team
 answered on 09 Sep 2016
6 answers
252 views
I'm studying the example at http://demos.telerik.com/aspnet-mvc/sortable/sortable-panels for implementing drag and drop dashboard components, and in that example I notice the area to drag is the whole panel as opposed to just the title bar.  This precludes the use of links in the panel themselves.  How would this be modified to only allow dragging by the title bar of the individual panels, thus allowing links inside the actual panel to remain clickable?
Rumen
Telerik team
 answered on 09 Sep 2016
1 answer
427 views

In my template,the code like this:

<script type="text/x-kendo-template" id="template">
    <div id="details-container">
        <p>内容:</p>
       <div id="div_con">@Html.Raw("#=Content#")</div>
    </div>
</script>

#=Content# and the result like this:

内容:
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#333333;font-family:SimSun, 'Microsoft YaHei', sans-serif;font-size:16px;line-height:32px;text-indent:32px;">木屑颗粒机是生物质燃料颗粒形成机系例产品中的优质产品代表之一,,它不仅帮助我们解决了一些农村废弃的玉米秸秆、棉花秸秆、稻草秸秆、木糠、木粉、木屑、花生壳、稻壳等这些农作物的外壳面临着存放难的问题。</span><p style="margin-bottom:0px;padding:0px;text-indent:32px;line-height:1.8;color:#333333;font-family:SimSun, 'Microsoft YaHei', sans-serif;font-size:16px;"></p><p style="margin-bottom:0px;padding:0px;text-indent:32px;line-height:1.8;color:#333333;font-family:SimSun, 'Microsoft YaHei', sans-serif;font-size:16px;">对于木屑颗粒机设备本身而言。</p>

 

How to resolve it?

Eyup
Telerik team
 answered on 09 Sep 2016
3 answers
982 views

To whom so ever it may concern,

I have a kendo grid and I have a filter on the column header like the one shown in the attached .

the page loads, the grid populates with data. After the page loads successfully with the grid and the data, When I am trying to type some characters in column header filter to search, for each character I type, going to server call (I mean its calling controller action method every time). I don't want this round trip to happen for every character provide in filter. Is there any way to not call server as data is already the grid and when I type any character in box, it just filters using the grid data rather than doing round trip.

This is what I have used in the grid.

            .Filterable(ftb => ftb.Mode(GridFilterMode.Row))
            .Filterable()
            //.Sortable()
            .Resizable(rsb => rsb.Columns(true))
            //.ColumnMenu(c=>c.Sortable(false).Filterable(true))
            //.Reorderable(r => r.Columns(true))
            .DataSource(dataSource => dataSource
            .Ajax()
            .Read(read => read.Action("GetAllSiteReleases", "Dashboard").Data("SetFilter"))
            .ServerOperation(false)

Can I get any help on this.

 

 

Eyup
Telerik team
 answered on 08 Sep 2016
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
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Template
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Licensing
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
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?