Telerik Forums
UI for ASP.NET MVC Forum
5 answers
328 views
Prior to the recent 2014.1.318 release, it was possible to obtain the id of a table in the event object in javascript, like so:

function DoSomethingForThisTable(e){
    var id = e.sender.options.table.context.id;
    //get the table with this id and do things
}

However, after the release, this process fails, as the table object on the e.sender.options is now always null.  Is there an alternative to doing this, or is this a bug?

Vladimir Iliev
Telerik team
 answered on 24 Apr 2014
6 answers
100 views
I have just upgraded to 2014.1.415 and some things no longer work.  I would like to revert back to 2013.2.918 but the installer removes the old version from my machine.  How can I get the older version reinstalled?
Stephen
Top achievements
Rank 1
 answered on 23 Apr 2014
7 answers
1.1K+ views
I am trying to disable the delete buttons of a grid in jquery depending on certain conditions.  If I check my conditions on document.ready the code to disable the buttons is not working, seemingly because the grid has not been initialized yet.  I am trying to figure out how to check if it is initialized so I can do my check and then disable the buttons if necessary.  I have tried it onDataBinding but that doesn't seem to do it.  Here is the relevant code:

    @(Html.Kendo().Grid<PASS.ViewModels.Proposals.AttachmentsViewModel>()
        .Name("gridAttachments")
        .Columns(columns =>
        {
            columns.Bound(c => c.File_Name).ClientTemplate("<a href='" + Url.Action("LoadAttachment", "Proposals") + "/#= ID #'>" + "#= File_Name #" + "</a>").Title("File Name");
            columns.Bound(c => c.File_Size).Title("Size");
            columns.Bound(c => c.Content_Type).Title("Type");
            columns.Command(command => { command.Destroy(); }).Width(90);
        })
        .Sortable()
        .Events(events => events.DataBinding("onDataBinding"))
        .DataSource(dataSource => dataSource
            .Ajax()
            .Model(model => model.Id(c => c.ID))
            .Read(read => read.Action("GetAttachments", "Proposals", new { proposalID = Model.Proposal_ID }))
            .Destroy(destroy => destroy.Action("DeleteAttachment", "Proposals"))
        )
    )
 
<script type="text/javascript">
$(document).ready(function () {
    var formDisabled = $('#Form_Disabled').val();
    if (formDisabled == "True") {
        $('#Files').data('kendoUpload').disable();
    }
})
 
$(function () {
    $("#Files").data("kendoUpload").bind("success", function () {
        $("#gridAttachments").data("kendoGrid").dataSource.read();
    })
})
 
function onDataBinding(e) {
    var formDisabled = $('#Form_Disabled').val();
    alert(formDisabled);
    if (formDisabled == "True") {
        $('.k-grid-delete', '#gridAttachments').hide();
    }
}
</script>

I have also tried assigning the onDataBinding in jquery instead of in the razor code but that didn't work either.






Dimiter Madjarov
Telerik team
 answered on 23 Apr 2014
1 answer
210 views
I am using the "Basic usage" of the Upload control in ASP.NET MVC and Internet Explorer version 9.0.8112.16421

After I select the file to upload and click "Submit", my Submit() action is indeed called, but "IEnumerable<HttpPostedFileBase> files" contains zero files in the called method:

public ActionResult Submit(IEnumerable<HttpPostedFileBase> files)
{
:
:
}

How can I get the actual files to be uploaded?

Thanks.
Dimiter Madjarov
Telerik team
 answered on 23 Apr 2014
2 answers
79 views
All of the icons that are placed on the kendo controls are a bit too high (see attached images).  I believe this started when I installed bootstrap, but I am not sure of the best fix.

Thanks
Logan
Top achievements
Rank 1
Veteran
 answered on 22 Apr 2014
4 answers
598 views
Hello,

I need to reload the grid based on a dropdown change but I don't want to do the filtering.  I don't want the grid to preload all of the data and then filter.  I want it only to load based on the dropdown.  But when I set it up the way I think it should work it is calling my controller method twice.  The first time passing the parameter correctly from the dropdown and the second time passing a null.

Here is the view:
<div class="filter">
    <label class="filter-label" for="filter">Filter:</label>
    @(Html.Kendo().DropDownList()
        .Name("filter")
        .DataTextField("Text")
        .DataValueField("Value")
        .Events(e => e.Change("onChange"))
        .BindTo(new List<SelectListItem>() {
            new SelectListItem() {
                Text = "Pending Reviews",
                Value = "N"
            },
            new SelectListItem() {
                Text = "Complete Reviews",
                Value = "Y"
            }
        })
    )
</div>
 
<br class="clear" />
<br />
 
      
@(Html.Kendo().Grid<PASSAdmin.ViewModels.ResourceReviewer.ResourceReviewViewModel>()
    .Name("gridResourceReviews")
    .Columns(columns =>
    {
        columns.Command(command => { command.Edit(); }).Width(50);
        columns.Bound(m => m.Proposal_ID).Title("Proposal ID");
        columns.Bound(m => m.Proposal_Title).Title("Title");
        columns.Bound(m => m.PI_BNL_ID).Title("PI");
        columns.Bound(m => m.Date_Submitted).Title("Date Submitted");
    })
    .Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("ResourceReviewer/ResourceReview").Window(window => window.Width(700)))
    .Pageable()
    .Sortable()
    .Events(e => e.Edit("onEdit"))   
    .DataSource(dataSource => dataSource
        .Server()
        .Model(model =>
        {
            model.Id(m => m.Beamtime_Request_ID);
            model.Field(m => m.Beamline_Request_ID);
        })
        .Read(read => read.Action("GetResourceReviews", "ResourceReviewer"))
        .Update(update => update.Action("AddResourceReview", "ResourceReviewer"))     
    ))
 
<script type="text/javascript">
function onEdit(e) {
    $(e.container).parent().css({
        width: '700px',
        height: '350px'
    });
    $(e.container.find(".k-edit-buttons.k-state-default")).css("width", "660px");
}
 
function onChange() {
    var filter = this.value();
    alert(filter);
    $.get('/ResourceReviewer/GetResourceReviews', { reviewComplete: filter }, function (data) {
        var grid = $("#gridResourceReviews").data("kendoGrid");
        grid.dataSource.read();
    });
}
</script>


And here is the controller method:
public ActionResult GetResourceReviews(string reviewComplete, [DataSourceRequest]DataSourceRequest request)
{
    User user = new User();
    int user_id = user.GetUserIDByBNLAccount(User.Identity.Name);
    int resource_id = UserSession.LastViewedResourceID.GetValueOrDefault();
 
    if (UserPermissions.VerifyResourceRole(user_id, resource_id, "Resource_Reviewer"))
    {
        using (PASSEntities context = new PASSEntities())
        {
            var vm = (from a in context.Beamtime_Requests
                      join b in context.Proposals on a.Proposal_ID equals b.ID
                      join c in context.Technique_Requests on a.ID equals c.Beamtime_Request_ID
                      join d in context.Beamline_Requests on c.ID equals d.Technique_Request_ID
                      join e in context.Beamlines on d.Beamline_ID equals e.ID
                      join f in context.Users on b.PI_User_ID equals f.ID
                      where a.Status == "BLREV" && d.Beamline_ID == resource_id && d.Beamline_Review_Complete == reviewComplete
                      select new ResourceReviewViewModel()
                      {
                          Date_Submitted = a.Date_Submitted,
                          Beamline_Request_ID = d.ID,
                          Beamtime_Request_ID = a.ID,
                          Proposal_ID = b.ID,
                          Proposal_Type_ID = b.Proposal_Type_ID,
                          Beamline_Review_Complete = d.Beamline_Review_Complete,
                          Current_Cycle_Request = a.Current_Cycle_Request,
                          PI_User_ID = b.PI_User_ID,
                          PI_BNL_ID = b.User.BNL_ID,
                          Proposal_Title = b.Title,
                          Refused_By_Beamline = d.Refused_By_Beamline
                      }).ToList();
 
            DataSourceResult result = vm.ToDataSourceResult(request);
            return Json(result, JsonRequestBehavior.AllowGet);
        }
    }
    else
    {
        return RedirectToAction("Index");
    }
}











Stephen
Top achievements
Rank 1
 answered on 22 Apr 2014
4 answers
957 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
75 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.9K+ 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
271 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
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?