Telerik Forums
UI for ASP.NET MVC Forum
11 answers
734 views
I came across this thread on the same issue, but without the use of server wrappers, which in my mind sort of complicates what I'm trying to accomplish. It led me to this example at JS Bin, but I can't seem to implement this in my existing code. Do you guys have any suggestions in regards to approaching this particular 'problem'?

Here's what I have today:
<div class="span3">
    @(Html.Kendo().MultiSelect()
      .Name("tags")
      .Placeholder("No tags selected for this unit")
      .BindTo(new SelectList(Model.TagsAvailable))
      .Events(e => e
                .Select("select")
                .Change("change"))
      .Value(Model.TagsSelected.ToArray())
      )
</div>
 
<script>
    function select(e) {
        var dataItem = this.dataSource.view()[e.item.index()];
        var param = dataItem.Text;
        var url = '@Url.Content("~/UnitDetails/TagUnit/" + Model.UnitId)';
 
        $.ajax({
            url: url,
            data: { selectedItem: param },
            type: 'GET',
            dataType: 'json',
            success: function (data) {
                
            },
            error: function () {
                
            }
        });
    };
 
    function change(e) {
        var dataItem = this;
        var param = dataItem.element.context.innerText;
        var url = '@Url.Content("~/UnitDetails/UnTagUnit/" + Model.UnitId)';
 
        $.ajax({
            url: url,
            data: { selectedItem: param },
            type: 'GET',
            dataType: 'json',
            success: function (data) {
                
            },
            error: function () {

            }
        });
    };
</script>
This is before I start mixing the code from the example I referenced earlier. Chose to remove it, because it just clutters my code anyway, in addition to not working. Hope you guys can help!
Daniel
Telerik team
 answered on 18 Jun 2015
2 answers
70 views

when ever try to Implement the Server template it shows the Data and Every thing Good data is Coming and binding But when Click on the left most row to click it this comes to the Start of page if

 

i change   if (row.Index == 0)
        {
            row.DetailRow.Expanded = true;
        }

from 0 to 1 , 2 ,3 for every time it showing the data of the item for which it is set to expand but when ever try too click it doesn't so me detail and it comes up to the start of the page

Almas
Top achievements
Rank 1
 answered on 18 Jun 2015
1 answer
169 views

Hi,

I'm developing a leave management application and I have 2 types of leaves. Full day leave and half day leave. I want to limit the from and to date time pickers to same day if the full day event check box is not clicked in the default popup that appears in the add event popup.

 Currently it shows 1 day difference in from and to date pickers when full day event check box is not clicked and user can select any day with any gap in from and to date pickers. 

 I've tried to do it but failed. Would be grate if someone can help me on doing this.

 Thanks.

Vladimir Iliev
Telerik team
 answered on 18 Jun 2015
1 answer
465 views

Hi,

I've got a property in my model:

DateTime _ValidTo;
[DisplayName("Gültig bis")]
[DataType(DataType.Date, ErrorMessage="Falsches Datumsfornmat")]
[DisplayFormat(DataFormatString = "{0:dd.MM.yyyy}", ApplyFormatInEditMode = true), ]
public DateTime ValidTo
{
     get { return _ValidTo; }
     set { _ValidTo = value; }
}

So in edit-mode the DatePicker is displayed.

But when I pick a a date, a message below the field appears The field "Gültig bis" must be a date.

This Message disappears when I enter the date in yyyy-MM-dd Format, but in ModelState this value is not accepted because of my property-attributes (this is a correct behaviour).

 

The question is, how can I get the Datepicker setup correctly correspondending my property-attributes?
I'm confused beacuse the Date ist picked correctly (in dd.MM.yyyy Format), but the picker itself does not accept it???

 

Greetings,

Denis

Daniel
Telerik team
 answered on 18 Jun 2015
1 answer
156 views

I'm new to Kendo UI MVC controls. I'm using a couple of grids inside a tabstrip. When I add a custom command to one of the grids, the grid does not render onto the page, but when I remove the custom command, it renders and displays the data as expected. Can anyone help? any help is greatly appreciated. My code is as follows.

 

<div id="jobstabdiv">
    @(Html.Kendo().TabStrip()
          .Name("Jobstabstrip")
          .Events(events => events
            .Select("selecttab"))
          .Items(tabstrip =>
          {
              tabstrip.Add().Text("Job Runs")
                  .Selected(true)
                  .Content(@<text>@RenderRunGrid()</text>);

              tabstrip.Add().Text("Incoming Files")
                  .Content(@<text>@RenderInFilesGrid()</text>);

          })
          .Events(tab => tab.Show("capturecurrenttab"))
    )
</div>

@helper RenderRunGrid()
{
    @(Html.Kendo().Grid<WI20Web.Models.RunsViewModel>()
        .Name("rungrid")
        .Columns(columns =>
        {
            columns.Command(command => command.Custom("status").Click("chgstatus"));
            columns.Bound(p => p.Id).Filterable(false).Width(50);
            columns.Bound(p => p.Mailshop_Job_Id).Width(200).Title("Mailshop Job Id");
            columns.Bound(p => p.Application_Id).Width(200).Title("App Id");
            columns.Bound(p => p.Application_Name).Title("App Name");
            columns.Bound(p => p.Status).Width(200);
            columns.Bound(p => p.Work_Order).Width(200).Title("Work Order");
            columns.Bound(p => p.Status).Hidden(true).ClientTemplate("<div class='run-status-#= Status#'></div>");
        })
        .Pageable()
        .Sortable()
        .Scrollable()
        .Filterable()
        .Groupable()
        .HtmlAttributes(new { style = "height:650px;" })
        .DataSource(dataSource => dataSource
            .Ajax()
            .PageSize(10)
            .Read(read => read.Action("List_Data", "Runs"))
        )
        .Resizable(resize => resize.Columns(true))
        .Reorderable(reorder => reorder.Columns(true))
        .Events(events => events.DataBound("hilite_runs"))
    )
}

@helper RenderInFilesGrid()
{
    @(Html.Kendo().Grid<WI20Web.Models.IncomingFileViewModel>()
        .Name("infilesgrid")
        .Columns(columns =>
        {
            columns.Bound(p => p.File_Path).Title("File Path");
            columns.Bound(p => p.File_Name).Title("File Name");
            columns.Bound(p => p.Date_Received).Title("Date Received").Format("{0:MM/dd/yyyy hh:mm:ss}");
            columns.Bound(p => p.File_Size).Title("File Size");
        })
        .Pageable()
        .Sortable()
        .Scrollable()
        .Filterable()
        .Groupable()
        .HtmlAttributes(new { style = "height:650px;" })
        .DataSource(dataSource => dataSource
            .Ajax()
            .PageSize(10)
            .Read(read => read.Action("List_Data", "InFiles"))
        )
        .Resizable(resize => resize.Columns(true))
        .Reorderable(reorder => reorder.Columns(true))
    )
}

@section scripts
{
    function chgstatus(e) {
    alert("Change Status");
    }
}

Tony
Top achievements
Rank 1
 answered on 17 Jun 2015
2 answers
160 views

Hello,

For a specific item in a PanelBar, I would like to display a tooltip using Bootstrap Javascript method.

Generally speaking, I am trying to understand how I can inject custom attribut to a specific panelBar item node from C# razor view.

Does the PanelBar helper provide a built-in mechanism ?

Regards.

 

 

Sylvain
Top achievements
Rank 1
 answered on 17 Jun 2015
1 answer
207 views

Hi guys,

I have a grid with amounts for each month of the year which has totals for rows and columns. I use aggregates for column totals and a javascript function for the Totals column and the grand total.

This works nicely when a user edits a row. When he comes out of edit mode the totals are recalculated properly.

Now comes the problem. We have a change values functionality which allows the user to setup a pattern for changing values, eg: decrease by 10 percent where amount > X. I cannot use .set(value) for setting the amount since the grid sometimes has 7 pages and calling that for many cells has a huge performance impact.

So how can I have all aggregates recalculated at the end of my function execution?

I'll mention that changes are batched and saved only when user presses the Save button.

Thank you,

Mircea D.

Daniel
Telerik team
 answered on 17 Jun 2015
1 answer
320 views

Hello Friends,

 

Good Morning.

 

I am using Kendo UI with ASP.Net MVC 4.0

I have bind grid using helper and used kendo grid grouping functionality. but the issue is I want to add some functionality while clicking on grouping column but the text value for all grouping label will be different. I have attached image and also a code sample can you please help me.

//Code Sample//

 <div id="dvPayrollReportGrid" class="kendo-responsive-grid-content">
@(Html.Kendo().Grid<Models.Productr>()
.Name("gridpayrollreport")
.Columns(columns =>
{
    columns.Bound(payroll => payroll.CheckDate).Format("{0:dd/MM/yyyy}");
columns.Bound(payroll => payroll.FromDate).Format("{0:dd/MM/yyyy}");
columns.Bound(payroll => payroll.ToDate).Format("{0:dd/MM/yyyy}");
        
    })
.Pageable(pageable => pageable
.Messages(messages => messages.Display("Payroll Reports {0} - {1} of {2}"))
)
.Sortable()
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(10)
.Read(read => read.Action("Action", "Controller"))
.Group(groups =>
{
groups.Add(payroll => payroll.CompanyName);


})
)
)

</div>

 

 

 

 

Alexander Popov
Telerik team
 answered on 17 Jun 2015
2 answers
204 views

 Hello,

 Can somebody please explain what is the purpose/interest of "virtualization" for Autocomplete ?

 http://demos.telerik.com/aspnet-mvc/autocomplete/virtualization

Regards.

Sylvain
Top achievements
Rank 1
 answered on 16 Jun 2015
2 answers
263 views

Hi All,

Struggling with a very peculiar problem.

I have a Kendo grid with kendo dropdownlist in some of the columns. The dropdown is populated based on values from in the database.

Problem:

On Edit in grid, the dropdown is not preserving previous saved value. 

Please can you help me in finding  the solution for the problem.

VIEW Code:

 @(Html.Kendo().Grid<ViaPath.LookUpDataManagement.MvcApp.Models.MasterDataMappingModel>(Model)
    .Name("gridTable")    
    .HtmlAttributes(new { style = "font-family: verdana,arial,sans-serif; font-size: 11px;color: #333333;border-color: #999999;" })
    .Columns(columns =>
    {
        columns.Bound(p => p.ClientAppName).ClientTemplate("# try {# #=ClientAppName# #} catch (e) {}#").EditorTemplateName("ClientComboBoxLookup").Width(120).Filterable(ft => ft.UI("ClientApplicationsFilter"));
      
        columns.Bound(p => p.SupplierAppName).ClientTemplate("# try {# #=SupplierAppName# #} catch (e) {}#").EditorTemplateName("SupplierComboBoxLookup").Width(120).Filterable(ft => ft.UI("SupplierApplicationsFilter"));
      
        columns.Bound(p => p.ListName).ClientTemplate("# try {# #=ListName# #} catch (e) {}#").EditorTemplateName("MasterDataListsComboBoxLookup").Width(150).Filterable(ft => ft.UI("ListsFilter"));
        columns.Bound(p => p.ClientValueName).Width(120).Title("Client Value");
        columns.Bound(p => p.ClientValueDescription).Width(200);
        columns.Bound(p => p.ClientCodingSystem).Width(150);
        columns.Bound(p => p.SupplierValueName).Width(120).Title("Supplier Value"); ;
        columns.Bound(p => p.SupplierValueDescription).Width(200);
        columns.Bound(p => p.SupplierCodingSystem).Width(150);
        columns.Bound(p => p.Direction).Width(90).ClientTemplate("# try {# #=Direction# #} catch (e) {}#").EditorTemplateName("DirectionComboBoxLookup").Filterable(ft => ft.UI("DirectionsFilter"));
        columns.Command(command =>  {
                command.Edit();
                command.Destroy();
            }).Width(200);
       
    })
            .ToolBar(t => t.Create())
            .Editable(editable => editable.Mode(GridEditMode.InLine))
            .Filterable(e => e.Extra(false))
            .Pageable(page => page.PageSizes(new int[] { 10, 25, 50, 100 }).Enabled(true))
            .Sortable()
            .Scrollable(src => src.Height("auto"))
            .Resizable(resize => resize.Columns(true))
            .DataSource(
                source => source
                    .Ajax() 
                    .Events(events => events.Error("error_handler"))                    
                    .ServerOperation(true)                  
                    .Model(model =>
                {
                    model.Id(e => e.MasterDataMappingId);
                    model.Field(e => e.MasterDataMappingId).Editable(false);
                    //model.Field(p => p.ClientAppName).Editable(true).DefaultValue(ViewData["defaultApplications"] as ViaPath.LookUpDataManagement.MvcApp.Models.MasterDataMappingModel);
                    //model.Field(p => p.SupplierAppName).Editable(true).DefaultValue(ViewData["defaultApplications"] as ViaPath.LookUpDataManagement.MvcApp.Models.MasterDataMappingModel);
                    //model.Field(p => p.ListName).Editable(true).DefaultValue(ViewData["defaultMasterDataList"] as ViaPath.LookUpDataManagement.MvcApp.Models.MasterDataMappingModel);
                    
                })                
                .Create(create => create.Action("Create_MasterDataMapping", "Home"))
                .Read(read => read.Action("Read_MasterDataMapping", "Home"))
                 .Update(update => update.Action("Update_MasterDataMapping", "Home"))
                 .Destroy(destroy => destroy.Action("Destroy_MasterDataMapping", "Home")))
                 //.Events(e => e.Edit("onEdit"))
            )

 Editor Template:

@(Html.Kendo().DropDownListFor(m => m)
        .Name("ClientAppName")
        .DataValueField("AppId")
        .DataTextField("ApplicationName")
        .BindTo((System.Collections.IEnumerable)ViewData["Applications"])
        .AutoBind(false)        
        .Events(e =>
        {
            e.Select("onSelect");
        })
)

​

Daniel
Telerik team
 answered on 16 Jun 2015
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
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
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?