Telerik Forums
UI for ASP.NET MVC Forum
0 answers
150 views
I want to know when a Create/Update/Destroy has successfully completed. Is there an event or some way to do that (it appears the Change event is a bit too generic for my needs)? 

OK, I think I have it - use the RequestEnd and then check the 'type' on the event parameter.
gm
Top achievements
Rank 1
 asked on 21 Sep 2012
0 answers
105 views
Has difficulty
in the table include editing and adding. But after adding the date of checking the writes that need a date! But the date of a?
Here is the code
Html.Telerik().Grid<Predlogenie>()
.Name("Orders_<#= ZaprosId #>")
.DataKeys(keys =>
{
 keys.Add(p => p.PredlogenieId);
})
.Columns(columns =>
{
    columns.Bound(o => o.Predlogau).Width(200).Title("Предлогаю");
 
    columns.Bound(o => o.DateIn).Title("Заезд").Width(100);
    columns.Bound(o => o.DateOut).Title("Выезд").Width(100);
 
    columns.Bound(o => o.Comment).Title("Комментарий");
    columns.Command(commands =>
    {
        commands.Edit().ButtonType(GridButtonType.Image);
        commands.Delete().ButtonType(GridButtonType.Image);
    }).Width(100);
})
.ToolBar(commands => commands.Insert().ButtonType(GridButtonType.Text).ImageHtmlAttributes(new { style = "margin-left:0" }))
   .DataBinding(dataBinding => dataBinding.Ajax()
   .Select("_OrdersForEmployeeDetailsAjax", "Home", new { id = "<#= ZaprosId #>" })
   .Insert("_InsertAjaxEditing", "Home")
   .Update("_SaveAjaxEditing", "Home")
   .Delete("_DeleteAjaxEditing", "Home")
)
.Pageable()
.Editable(editing => editing.Mode(GridEditMode.InForm).InsertRowPosition(GridInsertRowPosition.Top))
.Sortable()
.Filterable()
.ToHtmlString());
Tell me where the defeathering? 
Here's an example where I collected my  http://demos.telerik.com/aspnet-mvc/razor/grid/editingajax 

Dmitriy
Top achievements
Rank 2
 asked on 21 Sep 2012
1 answer
248 views
Hello I am tryint to bind create action from Kendo Grid:

@(Html.Kendo().Grid<CPSkla.Models.GlobalProperties>().Name("GlobalProperties")
    .Columns(columns =>
    {
        columns.Bound(p => p.Id).Hidden();
        columns.Bound(p => p.Name);
        columns.Bound(p => p.Value);
        columns.Command(command => command.Destroy());
    })
    .DataSource(dataSource => dataSource.Ajax().Batch(true)
        .Model(model =>  model.Id(p => p.Id))
        .Create("GlobalProperty_Create", "Admin")       
        .Read("GlobalProperty_Read", "Admin")
        .Update("GlobalProperty_Editing_Update", "Admin")
        .Destroy("GlobalProperty_Editing_Destroy", "Admin")
    )
    .ToolBar(toolbar =>
    {
        toolbar.Create();
        toolbar.Save();
    })
    .Editable(editable => editable.Mode(GridEditMode.InCell))
)


This is supposed to send Create action to my Admin controller (this works)

public ActionResult GlobalProperty_Create(List<GlobalProperties> models)
       {
           using (var db = new CPSkla.Models.CPSklaEntitiesCalculation())
           {
               foreach (GlobalProperties model in models)
               {
                   db.GlobalProperties.Add(model);
                   db.SaveChanges();
               }
           }
           return View(GetViewResult());
       }

Now if I try to create ne record it will trigger my breakpoint in controller but the list (although it has Count=1 for one new record) has GlobalProperty object but with all values (Id,Name,Value) null.

My firebug shows that I have
models[0][id]  0
models[0][name] test
models[0][value] testssss
as a part of my parametres, how do I serialize that to my List?

Please help I was trying to find it but without success.

This thread is copy of http://www.kendoui.com/forums/ui/grid/binding-create-action-null-model.aspx
Petur Subev
Telerik team
 answered on 21 Sep 2012
5 answers
1.0K+ views
I'm new to KendoUI, so I'm probably doing something stupid. When using the MVC wrapper and creating a control:
@(Html.Kendo().DropDownListFor(m => m.CardPayment.State)
                            .OptionLabel("Select state...")
                            .BindTo(new SelectList(Model.States, "Abbreviation", "Name"))
                            .DataTextField("Text")
                            .DataValueField("Value")
                            .HtmlAttributes(new { value = Model.CardPayment.State })
                        )

I'm not getting any data-val attributes rendered on the controls. This goes for all controls that I'm creating, not just the drop down list. All of my Kendo controls are not generating data-val attributes.

<span tabindex="0" style="" unselectable="on" class="k-widget k-dropdown k-header"><span unselectable="on" class="k-dropdown-wrap k-state-default"><span unselectable="on" class="k-input">Select state...</span><span class="k-select"><span class="k-icon k-i-arrow-s">select</span></span></span><input id="CardPayment_State" name="CardPayment.State" type="text" value="" data-role="dropdownlist" style="display: none; "></span>

I'm sure my model is correct, as when adding the line:
@Html.TextBoxFor(m => m.CardPayment.State)
directly under the above control, the data-val attributes are generated correctly.
<input data-val="true" data-val-required="You must enter the billing state for the card." id="CardPayment_State" name="CardPayment.State" type="text" value="">

[Display(Name = "State")]
[Required(ErrorMessage = "You must enter the billing state for the card.")]
[DataMember]
public string State { get; set; }

Am I missing something?
Thanks.
Tonny
Top achievements
Rank 1
 answered on 20 Sep 2012
3 answers
661 views
I'm trying to use the cascading dropdownlist but I have a strange behaviour when the second dropdown datasource is an empty list (which happens sometimes in my project). The second dropdownlist is not clear and keeps the old data previously selected.

Example : 
First dropdown is loaded with some "categories"
I  select "Category1" in the first dropdown => second dropdown is loaded correctly with 2 "products"
I select one product "Product1" in my second dropdown => OK
I select "Category2" in the first dropdown which contains no products (the controller return an empty list) => "Product1" is still selected in the second dropdown!! The data is not cleared!


Here's my code :
<div class="row">
        <span class="editor-label">
            @Html.LabelFor(model => model.Categorie, true, true)
        </span><span class="editor-field">
            @(Html.Kendo().DropDownListFor(model => model.IdCategorie)
                    .Name("CategorieDropDown")
                    .DataTextField("Nom")
                    .DataValueField("IdCategorie")
                    .OptionLabel("Sélectionner une catégorie")
                    .DataSource(source =>
                    {
                        source.Read(read =>
                        {
                            read.Action("GetAllCategories", "Article");
                        }).ServerFiltering(true);
                    })
                    .HtmlAttributes(new { style = "width:250px" })
        )
        </span>
    </div>
    <div class="row">
        <span class="editor-label">
            @Html.LabelFor(model => model.SousCategorie, true, true)
        </span><span class="editor-field">
            @(Html.Kendo().DropDownListFor(model => model.IdSousCategorie)
          .Name("SousCategorieDropDown")
          .DataTextField("Nom")
          .DataValueField("IdCategorie")
          .DataSource(source =>
          {
              source.Read(read =>
              {
                  read.Action("GetAllSousCategories", "Article")
                      .Data("filterCategorie");
              })
              .ServerFiltering(true);
          })
          .OptionLabel("Sélectionner une sous catégorie")
          .Enable(false)
          .AutoBind(false)
          .CascadeFrom("CategorieDropDown")
          .HtmlAttributes(new { style = "width:250px" })
    )
    <script>
        function filterCategorie() {
            return {
                idCategorie: $("#CategorieDropDown").val()
            };
        }
    </script>
        </span>
    </div>
 
Georgi Krustev
Telerik team
 answered on 20 Sep 2012
4 answers
362 views
    

public

 

class UserModel

 

{

 

    public

 

IEnumerable<RoleModel> RoleModels { get; set; }

 

}

public

 

class RoleModel

 

{

 

    public int Id { get; set; }

 

 

    public string Name { get; set; }

 

 

    public bool InRole { get; set; }

 

}
~User.cshtml
@(Html.Kendo().Grid<Mrjiou.Models.UserModel>()

 

.Name(

"Grid")

 

.Editable(editable => {

editable.Mode(

GridEditMode.PopUp).TemplateName("UserEditor"); })

 

.Columns(columns =>

{

columns.Bound(u => u.Name);

columns.Command(command => {

command.Edit();

 

})

 

 

.DataSource(dataSource => dataSource

.Ajax()

.Model(model => model.Id(m => m.Id))

.ServerOperation(

false)

 

.Read(read => read.Data(

"additional_data").Action("User_Read", "User"))

 

 

.Update(update=>update.Action("User_Update", "User"))

 

 

)

~UserEditor.cshtml:
@Html.LabelFor(m => m.Name)

 

@Html.EditorFor(m => m.Name)

 

@Model.RoleModels.Count()

 

@Html.EditorFor(m => m.RoleModels,

"UserRoleEditor")

the problem is i can't get RoleModels in UserEditor.cshtml,it's alway null. what's the problem?

 

Jero
Top achievements
Rank 1
 answered on 20 Sep 2012
0 answers
169 views
Hi,

I want to customize the look of the "select" button in Kendo UI MVC Upload control. I want to display Image instead of "Select.." button.

How to accomplish this?

Thanks,
Suril
Suril
Top achievements
Rank 1
 asked on 19 Sep 2012
8 answers
920 views
Hi everyone,
    I have a page that has a grid which I've set the editing mode to PopUp.
When I click edit on an item, a modal window pops up and it's content is using a partial view based on the Entities I'm editing.
This entities has lots of data which I've separated into sections using a tabStrip.
Each tabstrip should display infos from the entities of the item I've clicked.
I've tried to use LoadContentFrom which loads the content once and after that, it's always the same so, it's not practical when I click on another item's edit button.
So, I've tried the .Content method which works fine but, the model used is empty, nothing is set in it.

What would be the best approach to this scenario?

Thanks.
Stéphan Parrot
Top achievements
Rank 1
 answered on 19 Sep 2012
3 answers
362 views
Hi,
I am using Kendo grid in my application and all the Create,  Update and Delete operation are  being fired in the conroller.
 These are the following Actions in the HomeController which are not firing when i click on Save Changes button in the grid:

Editing_Create
Editing_Update
Editing_Destroy

I am attaching a sample code for the same.

Regards,
Nandan

Please find the Updated attached file


Rosen
Telerik team
 answered on 19 Sep 2012
0 answers
83 views
any ideas on why this would work for the 1st pop-up, but not after? Thank you!

    function SelectorOnChange(e) {
        switch (e) {
            case 1:
                $("#divQuote").show();
                $("#divJob").hide();
                $("#divCustomer").hide();
                break;
            case 2:
                $("#divCustomer").show();
                $("#divJob").hide();
                $("#divQuote").hide();
                break;
            default:
                $("#divJob").show();
                $("#divQuote").hide();
                $("#divCustomer").hide();
                break;
        }
    }

MelF
Top achievements
Rank 1
 asked on 18 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?