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

Hi,

I am using a treeview to load data and on edit of a row, i would want to display a dropwon to choose data, i tried below to get the dropdown, but this does not give me a dropdown, please advise if this is possible or how to achieve this.

columns.Add().Field(e => e.InActive).Editor("StatusType").Width(100) ;

below is a partial view i added under the EditorTemplate folder

@model CodedValues
@(Html.Kendo().DropDownListFor(m => m)
        .AutoBind(true)
        .DataTextField("DisplayText")
        .DataValueField("KeyText")
        .DataSource(dataSource =>
        {
            dataSource.Read(read => read.Action("GetTypes", "my"))
                    .ServerFiltering(true);
        })
)
@Html.ValidationMessageFor(m => m)

 

Thanks in advance.

Konstantin Dikov
Telerik team
 answered on 25 Jan 2018
8 answers
1.0K+ views

Assembly Reference "...\lib\KENDOUIMVC\2017.2.504.545\Kendo.Mvc.dll" was not updated properly. This usually happens when an assembly exists both in the GAC and in a local folder. Please, use the GAC reference instead.

 

How do I only use the GAC? And what is the GAC ;)

 

Maurice

Nikola
Telerik team
 answered on 25 Jan 2018
5 answers
231 views
Hello Team,

I am not able to close the event popup after I successfully create an event from KendoUI Scheduler.
Below is the error which I am able to see in firebug :

TypeError: e is undefined

Please guide... how to resolve this.
Ianko
Telerik team
 answered on 25 Jan 2018
1 answer
1.2K+ views
We need the Selectable option because it says without it the allowCopy() option will no longer work. We want it so that people can select a column with the checkbox and use the allowCopy functionality. The problem is that when the column select is on and Selectable is on when we check a row with the checkbox none of the checkboxes work.
Viktor Tachev
Telerik team
 answered on 25 Jan 2018
4 answers
1.2K+ views

I am trying to use the events(e => e.Error("onError") in my grid that is ajax bound.  I keep getting a javascript error "onError" is undefined.  the grid is on a partial page that is loaded via ajax call. 

when I put the script in the main view the onError function runs event if there is no error thrown.  if I put it in a document ready function  I get undefined.

not sure what to do.

index view

@model Jlo4MVC.Models.UserToSend
 
@{
    ViewBag.Title = "JLO";
}
 
<div id="userinput" class="row">
    <ul class="userrentry">
        <li>
            @Html.Label("User ID")
            @Html.Kendo().TextBox().Name("searchuserid")
        </li>
        <li>
            @Html.Kendo().Button().Name("findUser").Content("Search for Sessions").HtmlAttributes(new { @class = "k-button" })
        </li>
    </ul>
</div>
<div id="sessionsfound" class="row grid-centered" style="display:none">
 
</div>
<div id="status" class="row grid-centered" style="display:none">
</div>
<script type="text/javascript">
 
    $(document).ready(function(){
        function onError(e) {
            alert("Some Error");
        }
    })
 
    $('#findUser').click(function () {
        var myurl = '@Url.Action("getSessionsView", "home")';
        var model = { userID: $("#searchuserid").val() };
        $('#userinput').css("display", "none");
        $('#sessionsfound').css("display", "block");
        $.ajax({
            url: myurl,
            type: "POST",
            datatype: "html",
            data: model,
            success: function (data) {
                $('#sessionsfound').html(data);
            }
        });
 
    });
</script>

 

Partial view

@model Jlo4MVC.Models.UserToSend
 
 
<div>
    @(Html.Kendo().Grid<Jlo4MVC.Models.SessiondataDTO>()
        .Name("VSM_Grid")
        .NoRecords("NO Sessions Found")
        .Columns(c =>
            {
                c.Template(t => { }).ClientTemplate("<input type='checkbox' class='checkbox' />");
                c.Bound(i => i.id).Title("ID").Width(10);
                c.Bound(i => i.farmName).Title("Farm").Width(25);
                c.Bound(i => i.domainName).Title("Domain").Width(25);
                c.Bound(i => i.applicationName).Title("App Name").Width(75);
                c.Bound(i => i.serverName).Title("Server").Width(25);
                c.Bound(i => i.sessionID).Title("Session ID").Width(10);
                c.Bound(i => i.userID).Title("User ID").Width(40);
            })       
         
        .DataSource(data => data       
        .Ajax()
        .Events(events => events.Error("onError"))
        .Model(m => m.Id(p=>p.id))      
        .Read(read => read.Action("sessionsread", "Home", new {userID = Model.userID})))
        
    )
 
 
</div>
 
<div id="imentry" class="userrentry-gridsession">
    <label for="tbIMnumber" class="required">Incident Number</label>
    <input type="text" id="imnum" name="tbIMnumber" class="k-textbox" placeholder="Incident num" required validationmessage="Enter a valid Incident ID" style="width: 220px;" />   
</div>
<div class="kbutton-centered">  
    @Html.Kendo().Button().Name("endselected").Content("End Sessions").HtmlAttributes(new { @class = "k-button" })
</div>
<div id="showErrors" style="display:none">
 
</div>
<script>
 
   
    var checkedvalues = [];
    var jsonObj = [];
 
    $(function () {
        var validator = $("#imentry").kendoValidator().data("kendoValidator");
        var myurl = '@Url.Action("SessionsEnded", "home")';
 
        $("#endselected").click(function () {
            if (validator.validate()) {
                var imnum = $('#imnum').val();
 
                var datatosend = {
                    imnumber: imnum,
                    sessionDTO: jsonObj
                };
 
                $('#sessionsfound').css("display", "none");
                $('#status').css("display", "block");
                $.ajax({
                    url: myurl,
                    type: "POST",
                    datatype: "html",
                    data: datatosend,
                    success: function (data) {
                        $('#status').html(data);
                    }
                });
 
 
            }
 
        });
 
 
        var grid = $("#VSM_Grid").getKendoGrid();
        grid.table.on("click", ".checkbox", selectRow);
 
 
    })
 
    
 
    function selectRow() {
        var checked = this.checked,
            row = $(this).closest("tr"),
            grid = $("#VSM_Grid").data("kendoGrid"),
            dataItem = grid.dataItem(row);
        jsonObj.push(dataItem);
 
 
 
        //checkedvalues[dataItem.userID] = checked;
        if (checked) {
            //-select the row
            row.addClass("k-state-selected");
        } else {
            //-remove selection
            row.removeClass("k-state-selected");
        }
 
    }
 
 
     
 
</script>

 

public class HomeController : Controller
   {
       [HttpGet]
       public ActionResult JLO()
       {
           UserToSend usertoSend = new UserToSend();
           return View(usertoSend);
       }
 
 
       public ActionResult sessionsread([DataSourceRequest] DataSourceRequest request, UserToSend usertosend)
       {
 
           List<SessiondataDTO> sdto = new List<SessiondataDTO>();
           sdto.Add(new SessiondataDTO { applicationName = "testapplication", farmName = "testFarm", domainName = "MS", id = 1, serverName = "server01", userID = usertosend.userID, sessionID = 01 });
           sdto.Add(new SessiondataDTO { applicationName = "testapplication4", farmName = "testFarm", domainName = "MS", id = 2, serverName = "server02", userID = usertosend.userID, sessionID = 18 });
           sdto.Add(new SessiondataDTO { applicationName = "testapplication3", farmName = "testFarm", domainName = "MS", id = 3, serverName = "server12", userID = usertosend.userID, sessionID = 15 });
           sdto.Add(new SessiondataDTO { applicationName = "testapplication7", farmName = "testFarm", domainName = "MS", id = 4, serverName = "server00", userID = usertosend.userID, sessionID = 8 });
 
           //List<SessionData> sessiondatas = new List<SessionData>();
           //FarmInterfaceserviceClient svc = new FarmInterfaceserviceClient();
 
           //SessiondataDTO sessiondatadto = new SessiondataDTO();
 
           //List<SessiondataDTO> sdto = sessiondatadto.sessiondataTOSessionDTO(svc.GetSessionData(usertosend.userID));
 
           DataSourceResult result = sdto.ToDataSourceResult(request);
 
           return Json(result, JsonRequestBehavior.AllowGet);
       }
 
      [HttpPost]
       public ActionResult getSessionsView(UserToSend usertosend)
       {
 
           return PartialView("_GetSessionsView", usertosend);
       }
J
Top achievements
Rank 1
 answered on 24 Jan 2018
3 answers
398 views

When I put code in the onRender(e) event, the OnRender event keeps firing causing stack overflow errors.

What I've succeeded in doing is:
loading my model (Columns A-N) 

 

What I'd like to do after the model has loaded is:

1. Disable columns A:B

2. Add formulas in Columns (O-Q)

 

How do I do this?

 

Dimitar
Telerik team
 answered on 24 Jan 2018
1 answer
218 views

Hi,

 

I am using a Custom Editor Template for my Scheduler grid. When saving details of an Event is there a way of ensuring that the user does not click the Submit button multiple times? The issue is the validation operations on the server that are taking a few seconds to complete.

Is there a way to display a progress bar for any server operations that are occurring?

 

Cheers.

Phil

Dimitar
Telerik team
 answered on 24 Jan 2018
4 answers
226 views

hello telerik team.

can i customize the whole look and feel of gantt chart for mvc ? i want to have my own styling look and feel. I dont want to use the provided one. is that possible ?

Ivan Danchev
Telerik team
 answered on 24 Jan 2018
1 answer
190 views

Hi,

 

Currently i am experiencing an issue with the built in Editor, It is pre-filling with content fine, saving and submitting fine, however in Chrome and Edge when pasting content of any type e.g just a single word at the top of the content,the editor scrolls down to the bottom of the content. The pasting works fine and everything is displayed as it should be after scrolling up to find it.

 

This works as expected in Firefox just not in Chrome and Edge.

 

I am building up the editor as follows, I have tried removing the stylesheets and encode attribute to see if these were causing any issues to no avail, the content would just be some HTML, i have tested with some plain text and still get the issue:

 

@(Html.Kendo().Editor()
                    .Name("reportContent")
                    .HtmlAttributes(new { style = "width: 100%; height: 500px" })
                    .Tools(tools => tools
                        .Clear()
                        .ViewHtml()
                        .Bold().Italic().Underline().Strikethrough()
                        .JustifyLeft().JustifyCenter().JustifyRight().JustifyFull()
                        .InsertUnorderedList().InsertOrderedList()
                        .TableEditing()
                        .CleanFormatting()
                        .Formatting()
                        .FontName()
                        .FontSize()
                        .FontColor().BackColor()
                    )
                .Value(@template)
                .Encode(true)
                .StyleSheets(c => c
                    .Add(Url.Content("~/Styles/CKEditor.css")))
            )

Any help would be appreciated :)

 

Neli
Telerik team
 answered on 23 Jan 2018
1 answer
317 views

My client has a requirement for a drop down to appear in two different places on the same form. This hasn't been an issue until I went to convert all my dropdowns to Telerik dropdowns. To maintain integrity I attached a handler that meant that changing one dropdown also affected the other.

It doesn't seem, however, that Telerik likes this. It seems to only affect the first instance of the element it encounters on the page.

01.@(Html.Kendo().DropDownListFor(model => model.GrantType)
02.                      .OptionLabel("Please Select...")
03.                      .BindTo((IEnumerable<SelectListItem>)ViewBag.GrantTypes)
04.                      .Filter(FilterType.Contains)
05.                      .Events(events =>
06.                      {
07.                          events.Select("caseBuildingGrantTypeSelectHandler");
08.                          events.DataBound("caseBuildingGrantTypeOnDataBoundHandler");
09.                      })
10.                      )

 

The second element for this model property is left as a text element.

See the attached file for example of what is happening.

 

Neli
Telerik team
 answered on 23 Jan 2018
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
DropDownButton
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
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
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?