Telerik Forums
UI for ASP.NET MVC Forum
2 answers
73 views
Hi there.

I have an Uploader control appearing in a dialog pop up, and the file count is always 0.

If i embed the control onto the main page, it works as expected, but i cannot get it work when in the pop up dialog box.

Is there a way i can get this work in a dialog please?

regards 
Michael
Top achievements
Rank 2
 answered on 10 Sep 2012
1 answer
106 views
Hello,
I need to perform some changes to the labels that appear in the pop-up editor before it is displayed to the user.  In ASP.NET MVC, I make these changes to the viewmodel that is sent to the view, but I am not sure how I can accomplish this same task using the pop-up editor.  Is there a way to intercept some kind of event?  I love this editor and hope to use it, but I need to resolve this issue.  I'd appreciate your comments and suggestions.

Thanks,
Mike
Rosen
Telerik team
 answered on 10 Sep 2012
1 answer
216 views
I've problems to format the (nullable) DateTime within a grid cell.
It shows me "/Date(1346849354810)/" instead the formatted date:

My Binding 

columns.Bound(p => p.Incentiv.CreatedDate).Format("{0:d}")
.ClientTemplate("#= (Incentiv.CreatedDate==null ? '':Incentiv.CreatedDate) #");

The second problem is, if I check of HasValue i get an undefined:

columns.Bound(p => p.Incentiv.CreatedDate).Format("{0:d}")
.ClientTemplate("#= (Incentiv.CreatedDate.HasValue ? '':Incentiv.CreatedDate.Value) #");

if i use GetValueOrDefault()  I get an error: "Bound columns require a field or property access expression."

columns.Bound(p => p.Incentiv.CreatedDate.GetValueOrDefault()).Format("{0:d}")
.ClientTemplate("#= (Incentiv.CreatedDate == null ? '':Incentiv.CreatedDate) #");
Mario Priebe
Top achievements
Rank 1
 answered on 10 Sep 2012
1 answer
263 views
Hi,

Using MVC 4 and Kendo UI Q2.

I have a PanelBar with a Listview in one of the panels, loaded from a PartialView. This works great.

However, when I add paging to the listview then the panel collapses each time I go to a new page. Happens in both Single and Multiple expand mode. So if thought I could subscribe to a NextPage event and do something to prevent this, but I cannot figure out how to get the paging event.


PanelBar    .vbhtml
@(Html.Kendo().PanelBar() _
    .Name("zone-panelbar") _
    .ExpandMode(PanelBarExpandMode.Single) _
    .Items( _
        Sub(panelbar)
                panelbar.Add().Text("Current Playlist") _
                    .LoadContentFrom("Get", "Playlist", New With {.id = currentZone.Id}) _
                    .Selected(True)
                panelbar.Add().Text("Other") _
                    .Content("<h2>Other</h2>")
        End Sub))


_Playlist.vbhtml
<script type="text/x-kendo-tmpl" id="template-playlist">
    <div class="playlist-panel-song">
${Artist} - ${Title}
    </div>
</script>

@(Html.Kendo.ListView(Of Player.Data.Song) _
    .Name("listview-playlist") _
    .ClientTemplateId("template-playlist") _
    .TagName("div") _
    .Pageable(
        Sub(pager)
                pager.Enabled(True)
                pager.Info(False)
                pager.Input(False)
                pager.Numeric(False)
                pager.PageSizes(False)
                pager.PreviousNext(False)
                pager.Refresh(False)
        End Sub) _
    .DataSource(
        Sub(dataSource)
                dataSource.Read("Read", "Playlist", New With {.id = Model.Id})
                dataSource.PageSize(9)
        End Sub)
)


Any help/advise/suggestions would be appreciated.
Alex Gyoshev
Telerik team
 answered on 07 Sep 2012
0 answers
144 views

Hi ,

When I am updating my server editing gridview from popup , The value which I am getting from other table after JOIN is not getting refreshed.

my grid view code
ResourceGroupTypeName is from other table.

 

@(Html.Kendo().Grid(Model)

.Name(

 

"resourceprop")

 

.Columns(columns =>

{

 

columns.Bound(p => p.ResourceGroupId).HtmlAttributes(

 

new { style = "text-align: left" }).Width(185); ;

 

columns.Bound(p => p.ResourceGroupName).HtmlAttributes(

 

new { style = "text-align: left" }).Width(190); ;

 

columns.Bound(p => p.ResourceGroupTypeName).HtmlAttributes(

 

new { style = "text-align: left" }).Width(230); ;

 

 

 

// columns.Bound(p => p.Description);

 

 

 

 

 

 

columns.Bound(p => p.Status).HtmlAttributes(

 

new { style = "text-align: center" }).Width(80);

 

columns.Bound(p => p.CreationDate).HtmlAttributes(

 

new { style = "text-align: right" }).Width(150).Format("{0:MM/dd/yyyy}");

 

columns.Command(command => { command.Edit(); });

})

 

 

// .ToolBar(toolbar => toolbar.Create())

 

 

 

 

 

 

.Editable(editable => editable.Mode(

 

GridEditMode.PopUp).TemplateName("popupgroup")

 

.Window(w => w.Title(

 

" Edit Resource Group").Name("editWindow")))

 

.Pageable(p => p.PageSizes(

 

true))

 



my dropdown in popup

@(Html.Kendo().DropDownList()

.Name(

 

"ResourceGroupTypeName")

 

.Value(

 

"ResourceGroupTypeId")

 

.OptionLabel(

 

"Select Group Type")

 

.DataTextField(

 

"ResourceGroupTypeName")

 

.DataValueField(

 

"ResourceGroupTypeId")

 

 

.DataSource(source =>

{

source.Read(read =>

{

read.Action(

 

"GetResourcetype", "ManageResource");

 

});

})

)

Vidushi
Top achievements
Rank 1
 asked on 07 Sep 2012
0 answers
128 views
i am not able to move to the next page in my grid my view code is
@(Html.Kendo().Grid<kendoglobalexample.Models.ViewModel.ProgramViewModel>(Model)
    .Name("Grid")
    .HtmlAttributes(new { style = "width: 700px; float: left;" })
    .Columns(columns =>
    {
        columns.Bound(p => p.Progarm1);
       
        
        columns.Command(command => { command.Edit(); command.Destroy(); }).Width(220);
    })
    .ToolBar(toolbar => toolbar.Create())
    .Editable(editable => editable.Mode(GridEditMode.InLine))
    .Pageable()
    .Sortable()
    
    .DataSource(dataSource => dataSource
        .Ajax()
        .Events(events => events.Error("error"))
        .ServerOperation(false)
        .Model(model => model.Id(p => p.ProgramId))
        .Create(update => update.Action("Globalization_Create", "Program"))
        .Read(read => read.Action("Globalization_Read", "Program"))
        .Update(update => update.Action("Globalization_Update", "Program"))
        .Destroy(update => update.Action("Globalization_Destroy", "Program"))
    )
)
and my controller code is

 public ActionResult Index()
        {
            return View(ProgramRespository.All());
            
        }
        public ActionResult Globalization_Read([DataSourceRequest] DataSourceRequest request)
        {
            return Json(ProgramRespository.All().ToDataSourceResult(request));
        }

        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult Globalization_Create([DataSourceRequest] DataSourceRequest request, ProgramViewModel product)
        {
            if (product != null && ModelState.IsValid)
            {
                ProgramRespository.Insert(product);
            }

            return Json(new[] { product }.ToDataSourceResult(request, ModelState));
        }

        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult Globalization_Update([DataSourceRequest] DataSourceRequest request, ProgramViewModel product)
        {
            if (product != null && ModelState.IsValid)
            {
                var target = ProgramRespository.One(p => p.ProgramId == product.ProgramId);
                if (target != null)
                {
                    target.Progarm1 = product.Progarm1;
                    
                    ProgramRespository.Update(target);
                }
            }

            return Json(ModelState.ToDataSourceResult());
        }

        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult Globalization_Destroy([DataSourceRequest] DataSourceRequest request, ProgramViewModel product)
        {
            if (product != null)
            {
                ProgramRespository.Delete(product);
            }

            return Json(ModelState.ToDataSourceResult());
        }
    }
and also i am not able to add nor edit nor delete the data plz can you point out my mistake
siddharth
Top achievements
Rank 1
 asked on 06 Sep 2012
0 answers
156 views
Hello Team
Can I have a treeview as a column inside a grid. I am trying to show a representation of the what I have in mind below:

      Name     |              Description    |  Status
--------------------------------------------------------------------------------------------
+MyOrganisation          My Org                 Active.

Now when I open up "MyOrganisation" I get the display as below. Basically "MyOrganisation" is a tree node which I can  expand/collapse 

  Name |                     Description    |   Status
-------------------------------------------------------------------------------------------- 
-MyOrganisation           My Descp    Active. 
-MyDept1     My Descp  Active
+MySubDept My Descp  Active

Pls give me pointers if this can be done and what feature of the grid and treeview support this.

Thanks 
Anu
Top achievements
Rank 1
 asked on 06 Sep 2012
0 answers
89 views
I have created a chart using Telerik controls and it shows an error in IE 8 but works fine in IE 9 and other browsers. Once I click on the chart it shows an error and the chard does not work thereafter. Can anyone assist me.
Malin
Top achievements
Rank 1
 asked on 06 Sep 2012
5 answers
1.2K+ views
I'm trying to pull some simple data into a kendo grid.  I can see the json data in firebug fine but the grid on the page is empty.  I don't see any errors in firebug or elsewhere.  Please let me know what I'm doing wrong and how to better debug.

Controller:
        [HttpPost]
        public ActionResult GetMilestonesJson()
        {
            Milestone viewModel = new Milestone();
            viewModel.Milestones = new QuerySvc.QuerySvcClient().GetMilestones(this.xLMContext.Worker, null);
            
            return Json(viewModel.Milestones.Select(p => new {ID = p.ID, Name = p.Name, Sequence = p.Sequence, TemplateType = p.TemplateType}).ToArray(), JsonRequestBehavior.AllowGet);            
        }

View:
@{
    ViewBag.Title = "Column_Reordering";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>
    Column_Reordering</h2>
@(Html.Kendo().Grid<QRC.Models.Milestone>()
    .Name("Grid")
    .Pageable()
    .Scrollable()
    .Columns(columns =>
    {
        columns.Bound(o => o.ID);
        columns.Bound(o => o.Name);
        columns.Bound(o => o.Sequence);
        columns.Bound(o => o.TemplateType);
    })
    .DataSource(dataSource => dataSource
        .Ajax()
        .PageSize(20)
        .Read(read => read.Action("GetMilestonesJson", "Kendo")))


    .Resizable(resize => resize.Columns(true))
    .Reorderable(reorder => reorder.Columns(true))
)

Layout:
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <script src="../../QRC/Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
    <link rel="stylesheet" href="@Url.Content("~/Content/kendo.common.min.css")">
    <link rel="stylesheet" href="@Url.Content("~/Content/kendo.default.min.css")">
    <script src="@Url.Content("~/Scripts/jquery.min.js")"></script>
    <script src="@Url.Content("~/Scripts/kendo.web.min.js")"></script>
    <script src="@Url.Content("~/Scripts/kendo.aspnetmvc.min.js")"></script>
</head>
<body>
    <div class="page">
        <header>
            <div id="title">
                <h1>
                    My MVC Application</h1>
            </div>
            <div id="logindisplay">
                Welcome <strong>@User.Identity.Name</strong>!
            </div>
            <nav>
                <ul id="menu">
                    <li>@Html.ActionLink("Home", "Index", "Home")</li>
                    <li>@Html.ActionLink("About", "About", "Home")</li>
                </ul>
            </nav>
        </header>
        <section id="main">
            @RenderBody()
        </section>
        <footer>
        </footer>
    </div>
</body>
</html>

json from firebug:
[{"ID":1,"Name":"SW Pre-alpha","Sequence":100,"TemplateType":"SW Platform"},{"ID":2,"Name":"SW Alpha1","Sequence":200,"TemplateType":"SW Platform"},{"ID":3,"Name":"SW Alpha2","Sequence":300,"TemplateType":"SW Platform"},{"ID":4,"Name":"SW Alpha3","Sequence":400,"TemplateType":"SW Platform"},{"ID":5,"Name":"SW Beta1","Sequence":500,"TemplateType":"SW Platform"},{"ID":6,"Name":"SW Beta2","Sequence":600,"TemplateType":"SW Platform"},{"ID":7,"Name":"SW Beta3","Sequence":700,"TemplateType":"SW Platform"},{"ID":8,"Name":"SW PC","Sequence":800,"TemplateType":"SW Platform"},{"ID":9,"Name":"SW PV","Sequence":900,"TemplateType":"SW Platform"},{"ID":10,"Name":"SW Pre-alpha","Sequence":100,"TemplateType":"SW Ingredient"},{"ID":11,"Name":"SW Alpha1","Sequence":200,"TemplateType":"SW Ingredient"},{"ID":12,"Name":"SW Alpha2","Sequence":300,"TemplateType":"SW Ingredient"},{"ID":13,"Name":"SW Alpha3","Sequence":400,"TemplateType":"SW Ingredient"},{"ID":14,"Name":"SW Beta1","Sequence":500,"TemplateType":"SW Ingredient"},{"ID":15,"Name":"SW Beta2","Sequence":600,"TemplateType":"SW Ingredient"},{"ID":16,"Name":"SW Beta3","Sequence":700,"TemplateType":"SW Ingredient"},{"ID":17,"Name":"SW PC","Sequence":800,"TemplateType":"SW Ingredient"},{"ID":18,"Name":"SW PV","Sequence":900,"TemplateType":"SW Ingredient"},{"ID":19,"Name":"SW Pre-alpha","Sequence":100,"TemplateType":"SW Platform Configuration"},{"ID":20,"Name":"SW Alpha1","Sequence":200,"TemplateType":"SW Platform Configuration"},{"ID":21,"Name":"SW Alpha2","Sequence":300,"TemplateType":"SW Platform Configuration"},{"ID":22,"Name":"SW Alpha3","Sequence":400,"TemplateType":"SW Platform Configuration"},{"ID":23,"Name":"SW Beta1","Sequence":500,"TemplateType":"SW Platform Configuration"},{"ID":24,"Name":"SW Beta2","Sequence":600,"TemplateType":"SW Platform Configuration"},{"ID":25,"Name":"SW Beta3","Sequence":700,"TemplateType":"SW Platform Configuration"},{"ID":26,"Name":"SW PC","Sequence":800,"TemplateType":"SW Platform Configuration"},{"ID":27,"Name":"SW PV","Sequence":900,"TemplateType":"SW Platform Configuration"},{"ID":28,"Name":"SW Alpha","Sequence":150,"TemplateType":"Any"},{"ID":29,"Name":"SW Beta","Sequence":450,"TemplateType":"Any"},{"ID":30,"Name":"POPL3","Sequence":50,"TemplateType":"Any"},{"ID":33,"Name":"POPL3-3","Sequence":453,"TemplateType":"SW Ingredient"},{"ID":34,"Name":"KerryMilestone2","Sequence":107,"TemplateType":"Any"},{"ID":35,"Name":"validation tester","Sequence":96,"TemplateType":"SW Platform"},{"ID":36,"Name":"TestMilestone","Sequence":888,"TemplateType":"Any"}]

Kushal
Top achievements
Rank 1
 answered on 06 Sep 2012
0 answers
204 views
hello 
i try to create grid that do this (http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/usercontroleditform/defaultcs.aspx)
i try to use kendo UI MVC 4 razor syntax 


kfirb b
Top achievements
Rank 1
 asked on 06 Sep 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?