Telerik Forums
UI for ASP.NET MVC Forum
3 answers
485 views
I'm currently using the grid control with the edit mode set to popup. When I click the add button I get the form based on my model. In this case I have several string fields defined that it turns into input text boxes.  Clicking the first field with the mouse gives focus to the field, when I edit the field it updates the model. Then clicking with the mouse on the next field doesn't cause the field to gain focus and therefore any changes made are not in the model. (if I were to doubleclick the second field it would resolve this problem). Clicking the update button causes only data from the first field to be submitted. 

This issue seems to occur on IE and on touch devices (i.e. IPad, IPhone), however works correctly in Firefox and Chrome. 

This can easily be reproduced on your own demos > Grid > popup editing
Click "Add new record"
With the mouse click and edit the unit price box. Type in a number using the keyboard (not the up/down arrows). 
Then with the mouse click on the product name input box and enter some text. 
With the mouse click "Update"
See that on the grid only the unit price was saved correctly, the product name appears blank. 

Also, if you start with the product name box, click it and add text. Then with the mouse click in the text area of the unit price combo box it did not actually become editable. A second click is required to allow text to be entered. 

I'm currently using version v2012.3.1114 of both 
kendo.web.min.js
kendo.aspnetmvc.min.js

And have tried both 1.8.2 and 1.8.3 versions of jquery. 


Dimo
Telerik team
 answered on 10 Dec 2012
1 answer
303 views
I have a Hierarchy style Kendo grid and the inner grid doesn't seem to accept client templates. (I stripped the code irrelevant grid configuration columns out )  
I really would like the client template to be something like
        <a title="#=AlarmStatusDescription#">#=AlarmStatus#</a>`   but anytime I put anything other than a simple string in the ClientTemplate, the whole grid fails to load.        
   
I've tried 
ClientTemplate(#:AlarmStatus#)
.ClientTemplate(#=AlarmStatus#)
.ClientTemplate(<div class="myclass"></div>) with a separate <script type="text/html" id="myclass">#=AlarmStatus#</script>


   

  
@(Html.Kendo().Grid<AccountModel>()
                   .Name("Accounts_#=Id#")
                   .Columns(columns =>
                                {         
    columns.Command(command => command.Custom("Details").Click("showDetails")).Width(75);
    columns.Bound(o => o.AccountName).Width(150);                 
    columns.Bound(o => o.AlarmStatus).Width(100).ClientTemplate("#:AlarmStatus#");`
            
                                    })
                       .DataSource(dataSource => dataSource
                           .Ajax()
                           .Model(model =>{model.Id(p => p.AccountId);})
                           .Read(read => read.Action("DetailRead", "Csr", new { personId = #=Id#" }))
                       )
                       .Editable(editable => editable.Mode(GridEditMode.PopUp))
                       .ToClientTemplate()
               )


Chad
Top achievements
Rank 1
 answered on 08 Dec 2012
2 answers
175 views
Hi,
here i am attaching Grid image file,please try to give possible solution as soon as possible.i want to set backGround color of row(which consist all 0's) as well as i need to hide total row values (which consist 0)...

Thanks&Regards,
parsanamoni.
Atanas Korchev
Telerik team
 answered on 07 Dec 2012
1 answer
135 views
I have a scrolable, pageable grid which I add to MVC view via html kendo helper with selectable page size

@(Html.Kendo().Grid(Model.AvailableEmployees).Name("EmployeeGrid").Columns(cols =>
{
    cols.Bound(...).
    ClientTemplate("<input type=\"checkbox\" class=\"check_select\" data-id='#= data.ID #' />").
    HeaderTemplate("<input type=\"checkbox\" id=\"headerCheck\" />").Sortable(false).Filterable(false).Width(50);
    cols.Bound(...).HeaderTemplate(...).Width(150);
...
})
.HtmlAttributes(new { style = "width:90%;" })
.Pageable(
    pager => pager.PageSizes(new int[] { 20, 50, 100 })
)
.Sortable()
.Filterable()
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(false)
)
.Selectable
            (selectable => selectable.Mode(GridSelectionMode.Multiple)))

However, when the grid renders it always displays 10(???) users per page on initial render.  And chages it to correct number once you start changing the options on the page size dropdown.  How to make it display the correct number on the first render?
Vladimir Iliev
Telerik team
 answered on 06 Dec 2012
1 answer
121 views
I have a grid that is generated by a template.  How do I reference that grid from my javascript? I am trying to do this to enable editing of a column value on Create but not on Edit.  If there is an easier/better way to do that, I would appreciate your help. Either way, I'd still like to know how to reference the other grid.

My template name and grid name are setup as follows:
<script id="npisTemplate" type="text/kendo-tmpl">
<%: Html.Kendo().Grid<MyModel>()
.Name("Abc_#=PersonId#")
//.............
</script>
And I have tried various ways of referencing it but all generate an error:
<script>
      $("#Npi_#=FacilityAbbreviation#").kendoGrid()...  // error
      $("Npi_#=FacilityAbbreviation#").kendoGrid()...  // error
</script>

Thanks in advance for your help
Petur Subev
Telerik team
 answered on 06 Dec 2012
3 answers
160 views
Project Type: ASP.Net MVC4

In _Layouts folder:
@Styles.Render("~/Content/kendo")

In Bundles config:
 bundles.Add(new StyleBundle("~/Content/kendo").Include(
                        "~/Content/kendo/2012.3.1114/kendo.common.min.css",
                        "~/Content/kendo/2012.3.1114/kendo.default.min.css"));

It is working, when in web.config <compilation debug="true" targetFramework="4.0"/>

But rendered as blank file on browser when <compilation debug="false" targetFramework="4.0"/>


Atanas Korchev
Telerik team
 answered on 06 Dec 2012
1 answer
196 views
In my database menu items are configured in database with user access rights.
I want to add menu item logic to my Controller action or say want to create complete Menu object in controller and generating Kendo menu in View().

How to do that? Is it possible ?
Daniel
Telerik team
 answered on 06 Dec 2012
2 answers
191 views
I've got a Grid with a Custom popup template that contains an Editor control. When clicking the update button with HTML the page doesn't close and when debugging the controller action the breakpoint is never hit as an exception occurs during model binding (I think). When just entering plain text with no markup the model binding works correctly, the window closes and everything is peachy. I've attached a sample project to demonstrate. Try saving with just normal text and then try using HTML in the editor.
Any resolution\work around\ explanation of what I'm doing wrong would be appreciated.

Rob
Robert
Top achievements
Rank 1
 answered on 05 Dec 2012
3 answers
325 views
I followed the sample code and when I load the application, all I get is a spinning circle in the dropdown list. 

I've tried several things, but can anyone find out what's wrong with the code I'm using to get the data in the dropdown list?

Razor Code:

@(Html.Kendo().DropDownListFor(model => model.EquipmentReturnStatusId)
        .Name("_EquipmentReturnStatusId")
        .DataTextField("EquipmentReturnStatusName")
        .DataValueField("EquipmentReturnStatusId")
        .DataSource(datasource => datasource.Read(read => read.Action("Read", "EquipmentReturnStatus")))
        .OptionLabel("Take me to your Leader")
 )

Controller Code:

[HttpPost]
public JsonResult Read()
{
    try
    {
        EquipmentReturnService.EquipmentReturnServiceClient client = new EquipmentReturnService.EquipmentReturnServiceClient();
        var returns = client.GetEquipmentReturnStatuses();
        return Json(returns);
    }
    catch (Exception ex)
    {
        string errorMessage = "An error occurred: " + ex.Message;
    }
    return null;
}

madladuk
Top achievements
Rank 2
 answered on 05 Dec 2012
1 answer
509 views
Hi,

I have a grid and bound data along with kendo upload control in the toolbar. i have written jquery as shown below to upload the files. but files are not being uploaded. none of the methods of upload control are firing. Also i need to restrict file types to upload. how to resolve this. Please help.



@(Html.Kendo().Grid<FileListRow>()
.Name("Grid")
.Selectable()
.Sortable()
    .ToolBar(tools => tools.Template("<div id='UploadArea' class='k-widget k-upload'> Upload a document : <span class='uploadFileType' >Please upload only Microsoft Office, Text, Email or PDF files.</span>" +
   "<div class='k-button k-upload-button' ><span>Select...</span><input id='uploadDocument' name='uploadDocument' type='file'  multiple='multiple' autocomplete='off' ></div>" +
         " <span id='spnValidDoc'>Forbidden file type.</span> <span id='spnValidFileSize'>Upload Failed! You can upload maximum of " + Model.DocumentExplorerMaxUploadSize + " MB</span>" +
   "</div>"))


.Columns(columns =>
{
    columns.Bound(file => file.flFileId).Hidden();
    columns.Bound(file => file.fdFolderId).Hidden();
    columns.Bound(file => file.flFileName).Title("File Name");//.ClientTemplate("<img src='#=FileIconUrl#' />  <span title='#=flFileDesc#'>#=flFileName#</span>").Title("File Name").Width(Model.IsAdministrator ? 300 : 800);
    columns.Bound(file => file.flFileDesc).Title("Description").Hidden();
    columns.Bound(file => file.flFileType).Title("Type").HtmlAttributes(new { style = "text-align:right" }).HeaderHtmlAttributes(new { style = "text-align:right", @width = "3%" }).ClientTemplate("<span style='text-transform: uppercase'>#= flFileType #</span>");
    columns.Bound(file => file.FileSize).Title("Size").HtmlAttributes(new { style = "text-align:right"}).HeaderHtmlAttributes(new { style = "text-align:right" });
    columns.Bound(file => file.flUpdateTime).Format("{0:MM/dd/yyyy hh:mm:ss tt}").Title("Date Uploaded").HtmlAttributes(new { style = "text-align:right", @width = "23%"  }).HeaderHtmlAttributes(new { style = "text-align:right" });
    columns.Bound(file => file.flUpdateTime).Format("{0:MM/dd/yyyy hh:mm:ss tt}").Title("Date Uploaded").HtmlAttributes(new { style = "text-align:right", @width = "23%" }).HeaderHtmlAttributes(new { style = "text-align:right" });
    columns.Bound(file => file.fdDownloadCount).Hidden();

   // columns.Bound(file => file.fdDownloadCount).ClientTemplate("<a href='" + Url.Action("Download", "Home") + "/#=flFileId#'>Download</a>");
    columns.Command(commands =>
    {
       // commands.Custom("Download").Action("Download", "Home", new { area = "Document" }).HtmlAttributes(new { onclick = "RefreshGrid(event, this)", Title = "Download" });
        commands.Edit().HtmlAttributes(new { Title = "Edit" });
        commands.Destroy().HtmlAttributes(new { Title = "Delete" });
       // commands.Custom("DownloadCount").Text("").Action("Download", "Home", new { area = "Document" }).HtmlAttributes(new { onclick = "ShowLog(event, this)", Title = "", id = "btnDownloadCount"});
    }).Width(Model.IsAdministrator ? 150 : 45).HtmlAttributes(new { @class = "t-gridButtonAlignment" });    
}).Events(events => events
            .DataBound("onRowDataBound")
            .Edit("onEdit"))
            .DataSource(dataSource => dataSource.Ajax().ServerOperation(false)
                                .Read("GetFileList", "Explorer", new { area = "Document", id = Model.SelectedFolderId })
                                .Model(model => model.Id(file => file.flFileId))
                                .PageSize(Model.DocumentExplorerPageSize)
                        .Update("Update", "Explorer", new { area = "Document" })
                        .Destroy("Delete", "Explorer", new { area = "Document", folderId = Model.SelectedFolderId })
                        ).Pageable(pager =>
                                    pager.PageSizes(true)
                                  ).Sortable()
                                                .Editable(editable => editable.Mode(Kendo.Mvc.UI.GridEditMode.PopUp).TemplateName("_EditFilePopup"))

        )

my jquery is -

$(document).ready(function () {
      ('#uploadDocument').kendoUpload
      
        ({
            async:
        { saveUrl: '@Url.Action("Upload", "Explorer")',  // $.Site.RelativeWebRoot + "Document/Explorer/Upload", "autoUpload": true },
            autoUpload: true,
            Upload: onUpload,
            Success: onUploadSuccess,
            Error: onUploadError
        }
        });

Petur Subev
Telerik team
 answered on 05 Dec 2012
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
Security
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
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?