Telerik Forums
UI for ASP.NET MVC Forum
5 answers
773 views
We are using Kendo UI grid to import data from one grid to another grid, For that purpose we need to input some data to the kendo grid in the ADD Mode, Unfortunately Kendo grid input only available in the edit mode,I'm using ClientTemplate to input the data,but that is not support exactly,because kendo feature overridden....Please give me a solution to input data...

 @(Html.Kendo().Grid<Portal.Presentation.Web.BoundedContext.TNA.Template.MVC.Areas.Razor.Models.TaskPoupModel>()
                  .Name("importtaskgrid")
                  .AutoBind(true)
                  .HtmlAttributes(new {style = "border: 0;"})
                  .Columns(c =>
                               {
                                   c.Bound(x => x.TaskId).Hidden();
                                   c.ForeignKey(p => p.TaskGroupId, (System.Collections.IEnumerable) ViewData["TaskGroups"], "Key", "Value").Title("TASK GROUP").Sortable(true);
                                   c.Bound(x => x.TaskName).Title("TASK NAME").Sortable(true);
                                   c.Bound(x => x.LeadTime).Title("LEAD TIME").Sortable(false).
                                       ClientTemplate("<input type='text' name='importtaskgrid[#= ImportPopupHandler.index(data)#].LeadTime' value='#= LeadTime #' validateFor='number'/>");

                                   c.ForeignKey(p => p.UserId, (System.Collections.IEnumerable) ViewData["Users"], "Key", "Value").Title("TASK OWNER").Sortable(true);
                                   c.Bound(x => x.IsImport).ClientTemplate("<input type='checkbox' #= IsImport ? checked='checked' : '' # ></input>").Title("PICK TO IMPORT").Width(100).Sortable(false);
                               })
                  .Sortable()
                  .Editable(x => x.Mode(GridEditMode.InCell))
                  .DataSource(dataSource => dataSource
                                                .Ajax().ServerOperation(true)
                                                .Sort(sort => sort.Add(p => p.TaskName).Descending())
                                                .PageSize(20)
                                                .Events(events => events.Error("error_handler"))
                                                .Model(model =>
                                                           {
                                                               model.Id(p => p.TaskId);
                                                               model.Field(p => p.TaskGroupId).Editable(false);
                                                               model.Field(p => p.TaskName).Editable(false);
                                                               model.Field(p => p.LeadTime).DefaultValue(0);
                                                               model.Field(p => p.UserId).DefaultValue(0);
                                                           })
                                                .Read(read => read.Action("OnPopupTaskRead", "Tna").Data("ImportPopupHandler.getAdditionalData").Type(HttpVerbs.Get)
                                                ))
                  .Scrollable()        
                  )
Vladimir Iliev
Telerik team
 answered on 17 Apr 2014
2 answers
257 views
@(Html.Kendo().Grid<McGladrey.DOTT.DataAccess.EngagementStatusDataItem>()
            .Name("grid")
            .Columns(columns =>
            {
                
                columns.Bound(c => c.ClientName).Width("9%").Title("Client Name");
                columns.Bound(c => c.ClientNumber).Width("7%");
                columns.Bound(c => c.TaxYear).Width("7%");
                columns.Bound(c => c.EngType).Width("7%").Title("Eng Type");
                columns.Bound(c => c.MasterClient).Width("7%");
                columns.Bound(c => c.Assembler).Width("7%");
                columns.Bound(c => c.Status).Width("7%");
                columns.Bound(c => c.Amended).Width("9%");
                columns.Bound(c => c.ReturnTypes).Width("10%");
                columns.Bound(c => c.EIMessage).Width(175).Title("Comments");
                columns.Bound(c => c.ToDoUsers).Width("9%").Title("To Do");
                columns.Bound(c => c.eUpdated).Width("10%").Title("Last Updated").ClientTemplate("#= eUpdated ? kendo.toString(kendo.parseDate(eUpdated), 'MM/dd/yyyy') : '' #");
                columns.Bound(c => c.IsInEngagement).Width("10%");
            })
        .HtmlAttributes(new { style = "height: 380px;" })
        .ClientDetailTemplateId("template")
        .Scrollable()
        
        .Sortable()
         
        .Pageable(pageable => pageable
            .Refresh(true)
            .PageSizes(true)
            .ButtonCount(5))
        .Events(events => events
            .DataBound("dataBound")
            .DetailExpand("expand"))
   
)
</div>
 
 
<script id="template" type="text/x-kendo-template">
 
    @(Html.Kendo().Grid<McGladrey.DOTT.DataModel.WorkSiteDOTT.IManWorkspaceSerializeable>()
                .Name("grid_#=eFolderID#")
                .Columns(columns =>
                {
                    columns.Bound(ws => ws.Name).Width(110);
                    columns.Bound(ws => ws.Owner).Width(110);
                    columns.Bound(ws => ws.CreationDate).ClientTemplate("\\#= CreationDate ? kendo.toString(kendo.parseDate(CreationDate), 'MM/dd/yyyy') : '' \\#");
                    columns.Bound(ws => ws.Description).Width(200);
                })
                .DataSource(dataSource => dataSource
                    .Ajax()
                    .Read(read => read
                            .Action("WorksiteRequest", "Admin", new { clientNumber = "#=ClientNumber#", taxYear = "#=TaxYear#", amended = "#=Amended#", engType = "#=EngType#" })
                         )                  
                )
                .Events(events => events.DataBound("dataBinding"))
                .HtmlAttributes(new { style = "height: 180px;" })
                .ToClientTemplate()
        )
 
</script>
 
<script type="text/javascript">
 
    function dataBound() {
        this.expandRow(this.tbody.find("tr.k-master-row").first());
    }
    function dataBinding()
    {
        alert("here");
        
    }
 
    function expand(e) {
        alert("in expand");
    }
 
    $("#ok").bind("click", function (e) {
 
        var dataSource = new kendo.data.DataSource({
            transport: {
                read: {
                    url: "/Admin/EngagmentRequest",
                    dataType: "json",
                    data: {
                        ClientNumber: $('[name=clientNumber]').val(),
                        ClientName: $('[name=clientName]').val(),
                        TaxYear: $('[name=taxYear]').val()
                    }
                }
            }
        });
        dataSource.pageSize(5);
 
        var grid = $("#grid").data("kendoGrid");
        grid.setDataSource(dataSource);
 
    });
</script>

The issue with the above code is the Child Grid ("grid_#=eFolderID#") does not display any data.

The model is correct. This was proven by removing the columns and letting the grid determine them and all columns displayed correctly.
Data is coming back. This was proven via Fiddler. The following request returns data: /Admin/WorksiteRequest?clientNumber=4010574&taxYear=2013&amended=N&engType=Income%20Tax%20Compliance clientNumber=4010574&taxYear=2013&amended=N&engType=Income%20Tax%20Compliance 
{"CreationDate":"\/Date(1382465699000)\/","Description":"...","FolderID":983371,"ID":"!nrtdms:0:!session:XXXXX:!database:XXX:!page:983371:","LastUser":"XXXX XXXX","Name":"XXXXXXXXX","Owner":"XXXXXX","Path":"XXXXXXXXX","WorkspaceID":XXXXXXX}

The above code will also hit any events I tag on to it. The child grid will hit DataBound and DataBinding events

Everything is there it just will not display the data. 
 
Thoughts?


Thanks,
Martin

Dimiter Madjarov
Telerik team
 answered on 17 Apr 2014
1 answer
85 views
I would like to use it to schedule the staffs's shift for 14 days. Is this possible have 14 days as the day view in one page?
Vladimir Iliev
Telerik team
 answered on 16 Apr 2014
2 answers
1.3K+ views
Hello,

I am using Kendo UI for ASP.NET MVC and I am very new to it. I am trying to increase the width of the editor controls in the grid popup editor. Even though I could increase the width of the popup window using 
.Editable(e => e.Mode(GridEditMode.PopUp).TemplateName("CustomEdit").Window(w => w.Title("Edit").Name("customedit").Width(1000)))
the controls inside the window are not widened with it.

Can anyone please advise me how it can be done?

Thanks

Shameer
Shameer
Top achievements
Rank 1
 answered on 15 Apr 2014
5 answers
1.2K+ views
Hi,

I want to apply hyperlink on foreign key column.
I am having a products foreign key column in my grid. During add/edit popup mode user can select the product from dropdown list. Once user adds the data I am displaying product name in my grid.

Now I want to display the product name as a link and clicking on it, user should navigate to product details page.

Thanks,
Nirav
Amitkumar
Top achievements
Rank 1
 answered on 15 Apr 2014
3 answers
195 views
I have a reusable view for displaying project information in a handful of places.  In two places, I use this view to update a model and send it to the server for processing.  I'm seeing some strange formatting issue with the DatetimePicker when the same view is used on different pages (see attached screenshots).  I don't explicitly apply a format string to the Datepicker, but even having done so it doesn't make a difference.  If I edit the value, the format gets applied, but on load it is incorrect.  Both of the views are being called slightly different from my controller, but return the same partial with the same model:

[HttpPost]
public ActionResult UpdateView(Project project)
{
    var pipelineProject = project;
    ViewBag.IsUpdate = true;
    return PartialView("_CreateUpdateProject", pipelineProject);
}
 
 
[HttpPost]
public ActionResult UpdateViewForProjectDocumentGuid(string projectDocumentGuid)
{
    var projectRepository = new ProjectRepository(SystemConnection, CurrentUser, WebConfigHelper.GetConfigurationValue("DefaultProgram"));
    var pipelineProject = projectRepository.Read(new ProjectSearchModel() { AccountNames = AccessibleProjects.Select(a => a.ProjectAccountName).ToList(), DocumentGuid = projectDocumentGuid}).First();
    ViewBag.IsUpdate = true;
    ViewBag.CollapseGeneral = true;
    return PartialView("_CreateUpdateProject", pipelineProject);
}

The GoodDatepickerFormat image comes from result of UpdateViewForProjectDocumentGuid and the BadDatepickerFormat comes from UpdateView,  Everything looks the same in both cases (other than UpdateView returning the DateTimes in question with a Kind of Local rather than Unspecified), and I attempted to read it exactly the same as the working case but that made no difference.  Is there any workaround to force format on the field?

Petur Subev
Telerik team
 answered on 14 Apr 2014
6 answers
1.0K+ views
I am trying to disable an entire form or all form fields within a parent div.  This works by disabling the div with the following jquery:
$('#timerequest-details').attr('disabled', 'disabled');

except for the Kendo Editor controls within that div.  I have seen posts that show to use the following jquery to disable the content of an Editor:
$($('#editorName').data().kendoEditor.body).attr('contenteditable',false)

but I would like to do this from the parent div or form so that I don't have to do it for each form field.  More specifically, some of my form fields are loaded through various partial views and I don't want to have to check if they should be disabled and set them as disabled on each partial view.

Is this possible to do?






Stephen
Top achievements
Rank 1
 answered on 11 Apr 2014
1 answer
561 views
Howe to create a dynamic column grid with multiple cell values. I've managed to create a dynamic column grid, not clear on how to add multiple values to a dynamic column cell. I have attached the mock screen of what I want to create. The right side of the grid is dynamic columns which each cell of the column display's 2 data valued.

Thanks.
Dimo
Telerik team
 answered on 11 Apr 2014
1 answer
262 views
  model
public class OModel
{
public IEnumerable<REF_OTRASLEVAYA_PRENADLEGNOST> RefOtraslevayaPrenadlegnost { get;set; }
public int OTRASL_ID { get; set; }
}

html
@model OModel
@Html.Kendo().DropDownListFor(m => m.OTRASL_ID).Name("Otraslevaya").DataTextField("Text").DataValueField("Value").BindTo(Model.RefOtraslevayaPrenadlegnost)

control
public ActionResult Update()
        {    
            return View(new OModel{RefOtraslevayaPrenadlegnost=dataManager.RefOtraslevayaPrenadlegnosts.GetRefOtraslevayaPrenadlegnosts());
        }


[HttpPost]
        public ActionResult Update(Model model)
        {
                  int i = model.OTRASL_ID   //  =0  ?????????????
            return View(model);
        }


when I select a value in DropDoschnListFor nazhimatyu and submit, then the selected value does not come to the server. Why?





Georgi Krustev
Telerik team
 answered on 10 Apr 2014
5 answers
277 views

Hello,

after the page containing the tree view is refreshed, the state isn’t remembered so the tree view is collapsed totally. We have the requirement that the state is unchanged on a refresh or navigation operation on the browser.

So our question: Is it possible to store the state in any way (cookies etc.) to restore it on a page load?

Thanks in advance.

Daniel
Telerik team
 answered on 10 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?