Telerik Forums
UI for ASP.NET MVC Forum
8 answers
319 views
I have a gantt chart now rendering on my MVC page without error.  I have plumbed in the IQueryable for the Tasks Datasource but have not touched the Dependencies Datasource.  The Gantt is rendering blank.

Does the Gantt chart need the Dependencies Datasource to be wired up?

View:
@(Html.Kendo().Gantt(Of IMS_2.Models.Task, IMS_2.Models.Dependency)().Name("gantt") _
  .Columns(Sub(columns)
                   columns.Bound(Function(c) c.ID).Title("ID").Width(50)
                   columns.Bound("title").Editable(True).Sortable(True)
                   columns.Bound("start").Title("Start Time").Format("{0:MM/dd/yyyy}").Width(100).Editable(True).Sortable(True)
                   columns.Bound("end").Title("End Time").Format("{0:MM/dd/yyyy}").Width(100).Editable(True).Sortable(True)
           End Sub) _
        .Views(Sub(views)
                       views.DayView()
                       views.WeekView(Function(weekView) weekView.Selected(True))
                       views.MonthView()
               End Sub) _
      .DataSource(Function(d) d.Model(Sub(m)
                                              m.Id(Function(f) f.ID)
                                              m.ParentId(Function(f) f.ParentID)
                                              m.OrderId(Function(f) f.OrderID)
                                              m.Field(Function(f) f.Expanded).DefaultValue(True)
                                      End Sub) _
                                      .Read("ReadTasks", "Home")
                                     ))

Many thanks
Jason
Top achievements
Rank 1
 answered on 01 Sep 2014
7 answers
437 views
Hi,

I am using Grid popup editing to add new entries, i am getting an issue when pressing Save on new add multiple times before popup disappears it adds multiple entries to the grid. Is there a way to disable Save button once a request has been send to server to create new entry so it does not send multiple times new entry.

This Happens on IE8 only


Waiting for response,

Taha Khan 



Alexander Popov
Telerik team
 answered on 01 Sep 2014
2 answers
358 views
Dear support team,

I have a grid which registeres an error event. When the model validation fails, the event is correctly triggered and I get a messagebox.

Next i tried to insert a dummy javascript (<script>alert('aaa')</script>) into the textbox.
MVC reacts on it with an error 500 ('a potential malicious request was detected')
However the onError event function is not triggered now.

@(Html.Kendo().Grid<MyViewModel>()
      .Name("kendoGrid")
      .DataSource(dataSource => dataSource
          .Ajax()
          .Model(model => {              model.Id(i => i.Id);          })
          .Create(create => create.Action("_Create", "Controller"))
          .Read(read => read.Action("_Index", "Controller"))
          .Update(update => update.Action("_Update", "Controller"))
          .Destroy(destroy => destroy.Action("_Delete", "Controller"))
          .Events(events => events.Error("onError")) // <----------- Register Error Event
      )
      .ToolBar(toolbar => toolbar.Create().Text("New"))
      .Editable(editable => editable.Mode(GridEditMode.InLine))
      .Columns(column => {
          column.Bound(i => i.Name);
          column.Command(cmd => {
              cmd.Destroy();
              cmd.Edit();
          });
      })
      )
 
<script type="text/javascript">
    function onError(e) {
                          alert("test");
        if (e.errors) {
            var message = "The folowing errors occured:\n";
            $.each(e.errors, function(key, value) {
                if (value.errors) {
                    message += value.errors.join("\n");
                }
            });
            bootbox.alert(message);
        } else {
            bootbox.alert("An unknown error occured");
        }
    }
</script>


Any ideas what I've done wrong here?

btw my version is 2014.Q2

A second issue is, that I don't get a bootbox window. Instead I get a standard message box. Perhaps you have a clue on that too.

thank you,
Chris

Christian
Top achievements
Rank 1
 answered on 01 Sep 2014
5 answers
186 views
Hi

i'm using a Kendo UI Grid (Version: 2014.2.716.545) within a ASP .NET MVC 5 Project to bind XML Data from a local hosted Webservice. The following example works fine with IE 10, but not with Firefox, IE 11, etc.

<script type="text/javascript">
                $(document).ready(function () {
                    $("#systemLogs").kendoGrid({
                            dataSource: {
                                transport: {
                                    read: {
                                        url: 'http://localhost:9000/api/Home/GetSystemLogs")'
                                    },
                                dataType: "xml",
                            },
                            schema: {
                                model: {
                                    id: "LogId",
                                    fields: {
                                        Date: { type: "date" },
                                        Level: { type: "string" },
                                        Message: { type: "string" },
                                    }
                                }
                            },
                            pageSize: 10
                        },
                        height: 400,
                        sortable: false,
                        pageable: false,
                        columns: [
                            {
                                field: "Date",
                                title: "Date",
                                format: "{0:dd.MM.yyyy HH:mm}",
                                width: 150,
                            },
                            {
                                field: "Level",
                                title: "Level",
                                width: 50,
                            },
                            {
                                field: "Message",
                                title: "Message",
                                width: 300,
                            }
                        ]
                    });
                });
</script>

I always getting the Errormessage "[object Object]". What's wrong with my Javascript Code ?
Philipp
Top achievements
Rank 1
 answered on 01 Sep 2014
4 answers
319 views
Hi All,

I need to create an image column in my detail view. But the data field #= BroadcastEvent # is not recognized in client template at this line.
columns.Bound(o => o.BroadcastEvent).Title("").ClientTemplate( "<img src='" + Url.Content("~/Images/") + "#= BroadcastEvent #.png' />" );
#=DataField is always taking the Master Grid Data source. How can we access Data field of Detail view in client template on Detail view?

Code for Master grid

​ @(Html.Kendo().Grid<iPort.Models.CalanderItems>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(e => e.Time);
columns.Bound(e => e.CalanderStartTime).Hidden();
})
.Sortable()
.Pageable()
.ClientDetailTemplateId("template")
.DataSource(dataSource => dataSource
.Ajax()
.Model(model => model.Id(p => p.ID))
.Read(read => read.Action("GetCalanderData", "ClientViewActLogGrid"))
)
.Events(events => events.DataBound("dataBound"))
)

The data source for master grid is iPort.Models.CalanderItems

public class CalanderItems
{
public long ID {get; set;}
public DateTime CalanderStartTime { get; set; }
public string Time { get; set; }
public DateTime CalanderEndTime { get; set; }        
    }

 


Code for Detail Grid


<script id="template" type="text/kendo-tmpl">
@(Html.Kendo().Grid<iPort.Models.CalanderActivity>()
.Name("grid_#=ID#")
.Columns(columns =>
{
 columns.Bound(o => o.BroadcastEvent).Title("").ClientTemplate( "<img src='" + Url.Content("~/Images/") + "#= BroadcastEvent #.png' />" );
columns.Bound(o => o.OccurranceTime);
columns.Bound(o => o.Title);
columns.Bound(o => o.Place);
columns.Bound(o => o.Description);
})
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("GetCalanderActivities", "ClientViewActLogGrid", new { StartTime = "#=ID#" }))
)
.Pageable()
.Sortable()
.ToClientTemplate()
)
</script>

The datasource for detail grid is
iPort.Models.CalanderActivity

public class CalanderActivity
{
public long ID {get; set;}
public string Title {get; set;}
public DateTime OccurranceDate {get; set;}
public string OccurranceTime { get; set; }
public string Description { get; set; }
public string Place { get; set; }
public string BroadcastEvent { get; set; }
}

Rachel
Top achievements
Rank 1
 answered on 29 Aug 2014
1 answer
113 views
Hello,

Can you please tell me what CSS properties will allow me to set the
'Reports' Menu Header text to White and the Header background to Black
(default background color) when a dropdown option 'Purchase History' is
selected.

Please see attached image.

Thank You in Advance!

Robert
Kiril Nikolov
Telerik team
 answered on 29 Aug 2014
3 answers
137 views
I have a very simple demo of the Gantt in MVC and scroll isn't working correctly. Only the data scrolls, not the header. Attached are photos.

Here is my source code (very basic):

<div class="row">
@(Html.Kendo().Gantt<Gantt.Models.TaskViewModel, Gantt.Models.DependencyViewModel>()
    .Name("gantt")
    .Columns(columns =>
    {
        //columns.Bound(c => c.TaskID).Title("ID").Width(50);
        columns.Bound("title").Editable(false).Sortable(true);
        columns.Bound("start").Title("Start Time").Format("{0:MM/dd/yyyy}").Width(100).Editable(false).Sortable(true);
        columns.Bound("end").Title("End Time").Format("{0:MM/dd/yyyy}").Width(100).Editable(false).Sortable(true);
    })
    .Views(views =>
    {
        views.DayView();
        views.WeekView(weekView => weekView.Selected(true));
        views.MonthView();
    })
    .Height(800)
    .ShowWorkHours(false)
    .ShowWorkDays(false)
    .Snap(true)
    .Editable(false)
    .Selectable(true)
    .DataSource(d => d
        .Model(m =>
        {
            m.Id(f => f.TaskID);
            m.ParentId(f => f.ParentID);
            m.OrderId(f => f.OrderId);
            m.Field(f => f.Expanded).DefaultValue(true);
        })
        .Read("ReadTasks", "Home")
        //.Create("CreateTask", "Gantt")
        //.Destroy("DestroyTask", "Gantt")
        //.Update("UpdateTask", "Gantt")
    )
    .DependenciesDataSource(d => d
        .Model(m =>
        {
            m.Id(f => f.DependencyID);
            m.PredecessorId(f => f.PredecessorID);
            m.SuccessorId(f => f.SuccessorID);
            m.Type(f => f.Type);
        })
        .Read("ReadDependencies", "Home")
        //.Create("CreateDependency", "Gantt")
        //.Destroy("DestroyDependency", "Gantt")
        //.Update("UpdateDependency", "Gantt")
    )
)</div>
Kiril Nikolov
Telerik team
 answered on 29 Aug 2014
1 answer
237 views
Hello,

Does anyone have a working sample or know of complete documentation that shows how to create a dynamic menu that is built upon hierarchy settings that are retrieved from SQL Server, utilizing C# and MVC?

Thank You in Advance!

Robert
Dimo
Telerik team
 answered on 29 Aug 2014
4 answers
114 views
How do I get the drop down box wider.  See attached image.
Georgi Krustev
Telerik team
 answered on 28 Aug 2014
3 answers
363 views
Hi Guys,

I was trying to list of values from Action, but the action always get null value.

my cshtml
<div class="form-group">
    @Html.LabelFor(m => m.OrganizationName, new { @class = "col-md-4 control-label" })
    <div class="col-md-4">
        @Html.Kendo().AutoCompleteFor(m => m.OrganizationName)
.MinLength(3).Name("OrganizationName")
.DataSource(s => { s.Read(r => { r.Action("FindVets", "General"); }); })
.DataTextField("Name")
.HtmlAttributes(new { @class = "form-control" })
    </div>
</div>


Action :
public JsonResult FindVets(string OrganizationName)
{
    var Vets = General.GetRegularVet();
    var a = (from v in Vets
             where v.Name.ToUpper().Contains(OrganizationName.ToUpper())
             select v).ToList();
    return Json(a, JsonRequestBehavior.AllowGet);
}



Daniel
Telerik team
 answered on 28 Aug 2014
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
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
ColorPicker
DateRangePicker
Wizard
Security
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
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?