Telerik Forums
UI for ASP.NET MVC Forum
4 answers
945 views
Hi,

i am using batch editing grid,is there any solution for checking weather my data is edited or not  in grid using javascript 
Dimo
Telerik team
 answered on 22 Apr 2014
2 answers
56 views
Is it possible to change the default location that the JS files for Kendo UI are placed, when upgrading a project?
Donald
Top achievements
Rank 1
 answered on 21 Apr 2014
16 answers
2.8K+ views
Hello,

I am looking for a way to change the contenttype in the http request,  it seems you can do it in jquery but there doesn't seem to be a way to do it with the razor html helpers.  I would think it would work something like line #6.  Is this possible?

Thanks,



01..DataSource(dataSource => dataSource
02.        .Ajax()
03.        .PageSize(20)
04.        .ServerOperation(true)
05.        .Events(events => events.Error("error_handler"))y
06.        .Create(update => update.Action("Customer_Create", "Customer", ContentType="Application/Json")
07.                
08.        )
09.        .Read(read => read.Action("Customer_Read", "Customer"))
10.        .Update(update => update.Action("Customer_Update", "Customer"))
11.        .Destroy(update => update.Action("Customer_Delete", "Customer"))
12.        .
13.        
14.    )
15.)

   
Robert
Top achievements
Rank 1
 answered on 21 Apr 2014
1 answer
260 views
I have looked all over.  I would think this would be simple to do.  If I have a listview control inside of a MVC form.  How do I get the items selected in the listview to post back to the controller?
Alexander Popov
Telerik team
 answered on 21 Apr 2014
3 answers
301 views
Hello.
I have a scheduler and an EditorTemplate.
I want to bind a multiselectfor after the reading method. (with my Model which is populated in the read Method).
I suppose the .BindTo() Display nothing because the read method 'll be call after this one.

So here is my scheduler :

@(Html.Kendo().Scheduler<iMail.Web.Models.TaskViewModel>()
            .Name("scheduler")
            .Date(DateTime.Now)
            .Timezone("Etc/UTC")
            .Views(views =>
            {
                views.DayView();
                views.WeekView();
                views.MonthView();
                views.AgendaView(agenda => agenda.Selected(true));
            })
            .Selectable(true)
            .Timezone("Etc/UTC")
            .Events(e =>
            {
                e.Edit("onEdit");
                e.Change("onChange");
            })
            .Editable(editable =>
            {
                editable.TemplateName("_EditorTemplatePartial");
            })
            .DataSource(d => d
                    .Model(m =>
                    {
                        m.Id(f => f.TaskID);
                        m.Field(f => f.Title).DefaultValue("No title");
                        m.RecurrenceId(f => f.RecurrenceID);
                        m.Field(f => f.Priority);
                        m.Field(f => f.TypeID);
                    })
                .Events(e => e.Error("error_handler"))
                .Read (read => read.Action("TasksRead", "Calendar").Data("additionalInfo").Type(HttpVerbs.Get))
                .Create(create => create.Action("TasksCreate", "Calendar").Data("additionalInfo"))
                .Destroy(destroy => destroy.Action("TasksDestroy", "Calendar").Data("additionalInfo"))
                .Update(update => update.Action("TasksUpdate", "Calendar").Data("additionalInfo"))
            )
        )



And here is my MultiSelectFor in the _EditorTemplatePartial.cs file.
<div id="AttendeeAlreadyInvited">
    <div data-container-for="AlreadyInvitedID" class="k-edit-field">
        @(Html.Kendo().MultiSelectFor(model => model.AlreadyInvitedID)
            .HtmlAttributes(new { data_bind = "value:AlreadyInvitedID" })
            .DataTextField("Name")
            .DataValueField("ID")
            .BindTo(Model.Invited) 
        )
    </div>
</div>

Model.Invited has a structure like this :

public class CalEmployeeLight
{
  public int ID;
  public string Name;
 }

Here is a part of my model :

public class TaskViewModel : Kendo.Mvc.UI.ISchedulerEvent
{
   public int TaskID { get; set; } //each event have an ID.
   .....
   public IEnumerable<
int> AlreadyInvitedID { get; set; }
   public ICollection<CalEmployeeLight> Invited { get; set; }
}

Each event in the Scheduler have an ID (TaskID)

The Model is populated in the TaskRead fct and works correctly.
But my multiselectFor is empty.

How can i use .bindTo() fct in the MultiSelectFor() after the Model is populated by "TaskRead" ?

Alexander Popov
Telerik team
 answered on 21 Apr 2014
2 answers
156 views
Hi,

          I trying to do on treeview item select populate the kendogrid something like this EXAMPLE ..  which used dropdownlist instead of treeview , I'm trying to do the same for treeview any help appreciated.


Thank you
Bharathi
Top achievements
Rank 2
 answered on 18 Apr 2014
1 answer
295 views
Hi,

I'm currently developing an application with the support of Windsor Castle (DI container).

As I also want to use Kendo in this project, I started with a simple Grid.

Suddenly the Exception "no parameterless constructor defined for this object" came up.

I've found some threads about this on the net - like this one (http://www.telerik.com/forums/binding-to-an-arraylist-4539b158237a) - which are talking about the same error.
But the solution suggested in those are not satisfying, because I don't want to introduce a parameterless constructor if I don't need one (beside of Kendo).

Is there a way to use Kendo without having parameterless constructors?

Thanks in advance.

Kind regards
Daniel
Petur Subev
Telerik team
 answered on 18 Apr 2014
2 answers
127 views
Is Kendo 2014.1.415 not yet in cdn?
I am getting errors when attempting to use the latest version.
Vladimir Iliev
Telerik team
 answered on 18 Apr 2014
4 answers
708 views
Hi,

I have a stored procedure which returns  2 result sets. First result-set is collection of Columns ,data types, column order, Is column sortable and is column filterable. 
Second resultset is actual data for the columns which are there in first resultset. So in short my stored procedure returns the metadata for the columns and their values. I dont know in advance what will be my columns list. At code level stored procedure is  returning a dataset with 2 tables inside it.  Now I want to bind the kendo grid with the second table of dataset and first table of dataset will give me information about the columns which are suppose to have sort ,filter criteria. My problem is  i dont know the columns in advance still i execute the stored procedure then how can i use DataSourecRequest object to find out custom sorting and filtering stuff.
e.g. 
private CriteriaDto GetCriteriaDtoValues(DataSourceRequest request)
        {
           var criteriaDto = new DocumentHistoryCriteriaDto { Filters = new Dictionary<string, string>() };
            if (request.PageSize == 0)
            {
                request.PageSize = 20;
                criteriaDto.PageSize = 20;
            }
            else
            {
                criteriaDto.PageSize = request.PageSize;
            }
            if (request.Sorts != null && request.Sorts.Count > 0)
            {
                foreach (SortDescriptor sortDescriptor in request.Sorts)
                {
                    if (sortDescriptor.SortDirection == ListSortDirection.Ascending)
                    {
                        switch (sortDescriptor.Member)
                        {
                            case "ActivityDate": //This is hard coded column just for example but by this time i dont knwo what are the columns there in resultset
                                criteriaDto.SortBy = "ActivityDate";
                                criteriaDto.IsSortAcending = true;
                                currentSortType = criteriaDto.SortBy;
                                break;
                            case "RecordId": ////This is hard coded column just for example but by this time i dont knwo what are the columns there in resultset
                                criteriaDto.SortBy = "RecordId";
                                criteriaDto.IsSortAcending = true;
                                currentSortType = criteriaDto.SortBy;
                                break;                            
                        }
                    }
                    else
                    {
                        switch (sortDescriptor.Member)
                        {
                            case "ActivityDate": //This is hard coded column just for example but by this time i dont knwo what are the columns there in resultset
                                criteriaDto.SortBy = "ActivityDate";
                                criteriaDto.IsSortAcending = false;
                                currentSortType = criteriaDto.SortBy;
                                break;
                            case "RecordId": //This is hard coded column just for example but by this time i dont knwo what are the columns there in resultset
                                criteriaDto.SortBy = "RecordId";
                                criteriaDto.IsSortAcending = false;
                                currentSortType = criteriaDto.SortBy;
                                break;                            
                        }

                    }
                }
            }
            else
            {
                criteriaDto.SortBy = "ActivityDate"; //This is hard coded column just for example but by this time i dont know what are the columns there in resultset
                criteriaDto.IsSortAcending = true;
                currentSortType = criteriaDto.SortBy;
            }
            if (request.Filters != null && request.Filters.Count > 0)
            {
                foreach (FilterDescriptor filterDescriptor in request.Filters)
                {
                    switch (filterDescriptor.Member)
                    {
                        case "RecordId": //This is hard coded column just for example but by this time i dont know what are the columns there in resultset
                            criteriaDto.Filters.Add("LoanNo", filterDescriptor.Value.ToString());
                            break;
                    }

                }
            }
            if (request.Page > 0)
            {
                criteriaDto.PageNumber = request.Page;
            }
            return criteriaDto;

        }  

Also I have written below ajax method which is calling the above code before it calls the Store procedure. Can you provide some exmaple on how I can actually
pass the data set's data table collection to view in MVC  and How can i bind it to grid for 2nd table in dataset and how can i make use of first table
to decide which columns to sort and filter using DataSourceRequest object

 public ActionResult View_ByRecordId_Read([DataSourceRequest] DataSourceRequest request)
{
        
DataSet dsModel;
int  total=0;
int RecordId = 2;
string RecordValue = "0000224374";
 int timeFrame = 50;

 criteriaDto = this.GetCriteriaDtoValues(request);  //So here it calls this method to decide which columns got sort and filer criteria but actually by this time i dint get my procedure called so how can i figure it out which columns are meant to be for sorting and filtering.

dsModel = this._Service.GetDocumentView (userDto.Id,RecordId,RecordValue,timeFrame,criteriaDto,Guid.NewGuid());  //This is calling stored procedure and returning a dataset with 2 tables inside it.

if (dsModel != null && dsModel.Tables.Count > 0)        {
 bool tryParse=int.TryParse(dsModel.Tables[1].Rows[0]["TotalCount"].ToString(),out  total);    }

            var  result = new DataSourceResult() { Data = dsModel.Tables, Total = total };

            return Json(result);

        }
Aarti
Top achievements
Rank 1
 answered on 17 Apr 2014
1 answer
157 views

So I'm pretty new to using this component, so I'm not very familiar with it yet.

Here's what I'm trying to do:

I have a scheduler that I'm pre-populating with a lot of tasks.  I don't want the user to be able to add, delete, or update anything.  However, on selecting or clicking (or double clicking, whatever works best) I want to be able to update some other value in the model that was passed into the view.

For example: When user clicks on a task at 12:00 PM I don't want to show any pop ups or anything, but I want to set Model.appontmentTime equal to the tasks start time (i.e. 12:00 PM).

Also, as a side issue, for some reason when I attach a task to an owner as listed in the resources, the task is not showing in the right color.  Am I doing something wrong there?

So Far I have:

01.@(Html.Kendo().Scheduler<Humana.RetailSales.CGX.Site.TaskViewModel>()
02.            .Name("timeSlots")
03.            .Views(views => { views.WeekView(); })
04.            .Height(300)
05.            .Date(Model.appointmentCalendarRenderStartDate)
06.            .Height(400)
07.            .AllDaySlot(false)
08.            .MajorTick((int)Model.timeSlotInterval.TotalMinutes)
09.            .MinorTickCount(1)
10.            .Min(Model.appointmentCalendarRenderStartDate)
11.            .Max(Model.appointmentCalendarRenderFinishDate)
12.            .Resources(resource =>
13.            {
14.                resource.Add(m=> m.OwnerID)
15.                    .Title("Owner")
16.                    .DataTextField("Text")
17.                    .DataValueField("Value")
18.                    .DataColorField("Color")
19.                    .BindTo(new[] {
20.                        new { Text = "Many", Value = 1, color = "#003300"},
21.                        new { Text = "Few", Value = 2, color = "#CC3300"}
22.                    });
23.            })
24.            .DataSource(d => d
25.                .Model(m => {
26.                    m.Id(f => f.TaskID);
27.                    m.Field(f => f.Title).DefaultValue("No title");
28.                    m.Field(f => f.OwnerID).DefaultValue(1);
29.                    m.Field(f => f.Title).DefaultValue("No title");
30.                    m.RecurrenceId(f => f.RecurrenceID);
31.                })
32.
33.            )
Vladimir Iliev
Telerik team
 answered on 17 Apr 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
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Template
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Rating
ScrollView
ButtonGroup
CheckBoxGroup
Licensing
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
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?