Telerik Forums
UI for ASP.NET MVC Forum
0 answers
47 views

Requirements

Kendo UI Suite and Version


jQuery Version


Supported Browsers and Platforms


Components/Widgets used 



PROJECT DESCRIPTION 
[enter description here, together with step-by-step instructions on how to use the project]
Zinnia
Top achievements
Rank 1
 asked on 19 Oct 2012
0 answers
124 views
Migrate to ASP.net platform to build a better product. ASP.Net is a free web framework to build great web-based applications. The three main advantages of ASP.net are ease of development, better efficiency with master pages and the availability as well as security of the source code. ASP.Net development helps you achieve better performance, higher scalability and improved agility. ASP to ASP.net Migration will help you work on a flexible platform and will facilitate product enhancements at a later stage. If you want to build a robust and well-architected software product using the ASP.Net framework, contact us today!
Poushali
Top achievements
Rank 1
 asked on 18 Oct 2012
2 answers
960 views
I've declared a NumericTextBox using the MVC helpers, and specified a custom HTML attribute as follows:

@(Html.Kendo().NumericTextBoxFor(a => costRow.FTE)
    .Name(costRow.CostRowId + "_FTE")
    .Step(new decimal(0.5))
    .Events(e => e
        .Change("fteChanged")
        .Spin("fteChanged")
        )
    .HtmlAttributes(new { guid=costRow.CostRowId })
)

Is there any way of getting the value of the 'guid' attribute from the 'fteChanged' function in JavaScript? I've tried $(this).attr('guid') but that doesn't give me anything.
Atanas Korchev
Telerik team
 answered on 18 Oct 2012
1 answer
957 views
Hello I am using Kendo grid to edit price lists.

I am trying to edit single value in table:

@(Html.Kendo().Grid(Model).Name("PriceList")
    .Columns(columns =>
    {
        columns.Bound(p => p.Id).Hidden();
        columns.Bound(p => p.Name);
        columns.Bound(p => p.ValidFrom).Format("{0:dd.MM.yyyy h:mm:ss}");
        columns.Bound(p => p.ValidTill).Format("{0:dd.MM.yyyy h:mm:ss}");
        columns.Bound(p => p.Created).Format("{0:dd.MM.yyyy h:mm:ss}");
        columns.Bound(p => p.UserName);
        columns.Bound(p => p.FilePath);
        columns.Command(command => { command.Edit(); command.Destroy(); });
    })
    .DataSource(dataSource => dataSource.Ajax()
            .Model(model =>
            {
                model.Id(p => p.Id);
                model.Field(p => p.ValidFrom).Editable(false);
                model.Field(p => p.ValidTill).Editable(true);
                model.Field(p => p.Created).Editable(false);
                model.Field(p => p.UserName).Editable(false);
                model.Field(p => p.FilePath).Editable(false);
                model.Field(p => p.Name).Editable(false);
        })
        .Read("PriceList_Read", "Admin")       
        .Destroy("PriceList_Editing_Destroy", "Admin")
        .Update(update=>update.Action("PriceList_Editing_Update", "Admin"))
        .Events(e=>e.Error("error_handler"))
    )   
    .Editable(editable => editable.Mode(GridEditMode.InLine))
    .AutoBind(true)
)

And I am having troubles passing edited value in grid to my controller:

public ActionResult PriceList_Editing_Update([DataSourceRequest] DataSourceRequest request, PriceListViewModel model)
        {
             
                    int Id = model.Id;
                    string Name = model.Name;
                    DateTime date = model.ValidTill; // 0001 00:00:00 value all the time
          
            return View("Index", GetViewResult());
        }

I am always getting back empty datetime value (by empty I mean {1. 1. 0001 0:00:00}) same problem is with 2 other columns using DateTime property (Created and ValidFrom). Rest of the values are posted back correctly. I was trying to get those values using string DateTillStr = Request.Params["ValidTill"]; but if I check my GET in firebug I can see grid is not sending back this value inside Request it sends only NON Datetime values of my model object. Like this:

Actual  false
FilePath    D:\Projects\CPSkla\CPSkla\App_Data\Cen°k 2012_10.xlsx
Id  23
Name    Testovací ceník
User    0
User1   null
UserName    djezek

Nothing more nothing less, only these 7 attributes I am missing rest 4 from my model:

public partial class PriceListView
    {
        public int Id { get; set; }
        public int User { get; set; }
        public string Name { get; set; }
        public System.DateTime ValidFrom { get; set; }
        public System.DateTime ValidTill { get; set; }
        public string FilePath { get; set; }
        public Nullable<System.DateTime> Created { get; set; }
        public Nullable<System.DateTime> Updated { get; set; }
        public bool Actual { get; set; }
        public string UserName { get; set; }
    }


Is there some other way to post these data back? I figured out I can attach additional data to Update request but I had an issue how to identify edited row in the table in javascript function (I know how to identify selected value but not edited).

Please help me I am quite desperate.

David Ježek
ANDREW REED
Top achievements
Rank 1
 answered on 18 Oct 2012
0 answers
219 views
Hi,
Im trying the telerick mvc chart control:
<% Chart<CollectionItem<decimal?>> chart =
                                            Html.Telerik().Chart(Model.GraphData)
                                                .Name("chart")
                                                .Title(title => title
                                                    .Text(Model.GraphTitle)
                                                    .Visible(false)
                                                )
                                                .Legend(legend => legend
                                                    .Position(ChartLegendPosition.Top)
                                                    .Visible(false)
                                                )
                                                .SeriesDefaults(series =>
                                                {
                                                    series.Column().Stack(false);
                                                })
                                                .Series(series =>
                                                {
                                                    series.Column(s => s.Value)
                                                        .Name("Totalen")
                                                        .Color("#1f3975")
                                                        .Labels(labels => labels
                                                            .Margin(-6)
                                                            .Visible(true)
                                                            .Template("<#= value #>")
                                                            .Position(ChartBarLabelsPosition.OutsideEnd));
                                                })
                                                .CategoryAxis(axis => axis
                                                    .Categories(s => s.Text)
                                                    .Color("#000000")
                                                    .Labels(labels => labels.Margin(-6).Visible(true))
                                                    .MajorGridLines(majorGridLines => majorGridLines.Color("#ddd"))
                                                )
                                                .ValueAxis(axis => axis
                                                    .Numeric().Labels(labels => labels.Margin(0).Format("{0:#,##0}")).Min(0)
                                                    .MajorUnit(Model.GraphMajorUnit)
                                                    .Color("#000000")
                                                    .Labels(labels => labels.Visible(false))
                                                    .MajorGridLines(majorGridLines => majorGridLines.Color("#ddd"))
                                                                 )
                                                .Tooltip(tooltip => tooltip
                                                    .Visible(false)
                                                    .Template("<#= category #>: <#= value #>")
                                                    .Format("{0:#,##0}")
                                                )
                                                .HtmlAttributes(new { style = "width: 225px; height: 78px;" });
 
               chart.Render();
            %>


The problem is that when one of my bars, has 0 as value, i dont' see the value on the bar, it's then empty. How can i show the 0 on the bar? i tried :
.ValueAxis(axis => axis
                                                   .Numeric().Labels(labels => labels.Margin(0).Format("{0:#,##0}")).Min(0)
                                                   .MajorUnit(Model.GraphMajorUnit)
                                                   .Color("#000000")
                                                   .Labels(labels => labels.Visible(false))
                                                   .MajorGridLines(majorGridLines => majorGridLines.Color("#ddd"))
But it does not work. 
A
Top achievements
Rank 1
 asked on 18 Oct 2012
0 answers
292 views
Is it even possible to create hierarchy tables using local data with MVC Razor? Doesn't appear so. The examples don't work. I've had no trouble with any of the other Kendo controls until now and I'm pulling my hair out...
    @(Html.Kendo().Grid<TaskDTO>(Model.Tasks)
    .Name("tasksTable")
    .Columns(columns =>
    {
        columns.Bound( p => p.ID ).Width( 300 );
        columns.Bound( p => p.Name );
        columns.Bound( p => p.TaskType );
    })
    .ClientDetailTemplateId( "testTemplate" )
    .Pageable()
    .Sortable()
    .Resizable( resize => resize.Columns( true ) )
    .Events( events => events.DataBound( "dataBound" ) )
)

This all works fine without the client template, but when I add in the ClientDetailTemplateId and it's corresponding script, all the columns in the parent table shift one column to the left. DataBind is NOT being called and in fact the template is never even executed.

I was hoping something like this would work

    <script id="testTemplate" type="text/kendo-templ">
@(Html.Kendo().Grid<CustomFieldDTO>( Model.Tasks.Where( f => f.ID == Guid.Parse( "#=ID#" ) ).FirstOrDefault().CustomFields )
        .Name( "CustomTaskFields_#=ID#" )
        .Columns( columns =>
        {
            columns.Bound( q => q.PropertyID );
            columns.Bound( q => q.FieldName );
            columns.Bound( q => q.Value );
        } )
        .Pageable()
        .Sortable()
        .ToClientTemplate()
)
    </script>

but doesn't appear so.

I got it working almost working using DataSource to the controller but I need to send both the Project and Task IDs and ProjectID is not in the bound data that the template gets. I can't find anyway to pass additional data to the template.

Tag
Top achievements
Rank 1
 asked on 17 Oct 2012
1 answer
370 views
I have a grid of Contact data. I am using a custom editor template. The user can edit more data in the editor template than is displayed in the grid. One of the properties on the Contact object is an Array of Phones. In the UI the user can enter as many phone numbers as they want. I have additional fields dynamically added using jquery. Currently, I am running into three issues:

1) Inputs that I dynamically add are not included in the post of the form. Here's an example of a dynamically added input:
<select name="Phones[0].PhoneTypeId">
    <option value="2">Mobile</option>
    <option value="3">Home</option>
    <option value="4">Work</option>
    <option value="5">Main</option>
    <option value="6">Fax</option>
</select>

<input name="Phones[0].Number" type="text">


As mentioned, these values aren't included in the data posted to the server at all.

2) I have created an EditorTemplate for the phone. When I use Html.EditorFor(m => m.Phones) it appears to be completely ignored. I have also tried iterating through the Phone array like this:
@foreach(var phone in Model.Phones)
{
    Html.EditorFor(m => phone)
}

That also gets completely ignored and doesn't produce anything when the data provided should cause phone numbers to show.

3) Due to issue number two mentioned above when editing an existing Contact I have resorted to adding code to just display the first phone number: Html.EditorFor(m => m.Phones[0]) When I do that, the phone number shows up as expected, but if I make a change to the number and submit the form, the data gets submitted like this: Phones[0][Number] instead of like this Phones[0].Number. The default ModelBinder doesn't seem to be able to handle the value being submitted like that, so the values don't get bound to my model.

Any help would be greatly appreciated.
Petur Subev
Telerik team
 answered on 17 Oct 2012
4 answers
256 views
Hi,

The grid fails to render properly when using the following:
datasource =>
             datasource.Ajax().ServerOperation(true)
             .Read(config => config.Url(myActionUrl))
             .Group(config => config.Add(i => i.MyField))

None of the rows gets displayed correctly. It will display the group header with MyField: (undefined) and empty child rows 

It works correctly with :
datasource =>
             datasource.Ajax().ServerOperation(true)
             .Read(config => config.Url(myActionUrl))
             .Group(config => config.Add(i => i.MyField))

Is there a workaround to have initial grouping and client filtering/sorting... ? 

Happens on version : 2012.2.723.340

Thanks for helping
Nikolay Rusev
Telerik team
 answered on 17 Oct 2012
4 answers
622 views
Hi,

First, let me just say that I'm not satisfied by this change asp.net Mvc->kendo ui MVC. It's now a mess to find any information about products I've to maintain, and it's a shame to have to navigate between differents forums to post something(And I'm talking about the main website where we have to read the footer to find the correct page fastly). And there is no way to display by default asp.net Mvc code instead of the javascript synthax... And there is missing code for c#(e.g. no c# example for http://demos.kendoui.com/web/grid/events.html , no controller example for http://demos.kendoui.com/web/grid/editing-inline.html 
) If your goal was to make my work less productive, you won. Hopes it will not continues this way.

I've an Asp.Net MVC website. I've to create a form on which I can edit an object with a small list of elements. 

My model can be simplified like this:

MyModel
public class MyModel{
   public String Name{get;set;}
   public String Description{get;set;}
   public List<Step> Steps{get;set;}
}
 
public class Step{
  public int Id  {get;set;}
  public String Name {get;set;}
  public String Description{get;set;}
}

I would like to be able to add/remove/edit "Steps", and that when I submit my form containaing MyModel fields, I also receive in the POST data the Steps data.

Is it possible with the telerik Grid? I saw demos, but I didn't make them work for my case, only found ajax instant updating or batch editing

Thank you for your help.
Darryl
Top achievements
Rank 1
 answered on 17 Oct 2012
1 answer
185 views
I have a grid as below

@{
    Html.Kendo().Grid<InEnumerable........>()
    .Name("IniParamGrid")
    .HtmlAttributes(new { style = "width: 100%;" })
    .Events(events => events.DataBound("Grid_onRowDataBound"))
    .Events(events => events.Change("Grid_OnRowSelectUID"))  
    .AutoBind(false)
    .Columns(col =>
    {
        col.Bound("NP_PARAM_UID").Hidden();        
        col.Bound("PROCESS_GRP").Title("Process Group").HeaderHtmlAttributes(new { style = "text-align:center;" });
        col.Bound("PARAM_NAME").Title("Parameter Name").HeaderHtmlAttributes(new { style = "text-align:center;" });
        col.Bound("PARAM_VALUE").Title("Parameter Value").HeaderHtmlAttributes(new { style = "text-align:center;" });
        col.Bound("EXTERNAL_ID").Title("Table Name").HeaderHtmlAttributes(new { style = "text-align:center;" });
        col.Bound("EXTERNAL_FK").Title("Key Value").HeaderHtmlAttributes(new { style = "text-align:center;" });
        col.Bound("DEL_FLG").Hidden();
    })
    .DataSource(dataBinding =>
    {
        dataBinding.Ajax().Read(read => read.Action("SrchDataIniParam", "Admin",
            new
                {
                    area = "Admin",
                    strParam1 = ViewBag.Param1
                }))
                .ServerOperation(false);
    })
    .Resizable(resizing => resizing.Columns(true))
    .Selectable() 
    .Reorderable(reorder => reorder.Columns(true))
    .Pageable()
    .Sortable()
    .Filterable()
    .Render();
}

Now the grid loads empty at starup which is ok. But if the user clicks the grid header then also the underlying controller action gets called which is not desirable. I want the grid to get populated on button click which its doing fine.

Please help me to find where I am going wrong.
Atanas Korchev
Telerik team
 answered on 17 Oct 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?