Telerik Forums
UI for ASP.NET MVC Forum
0 answers
250 views
(the sample application that I wanted to attached is slightly above 2MB  after having removed binaries, etc... can I email it to someone for support?)

We have a requirement to drag data from multiple sources and drop it to a treeview. To illustrate the problem(s)...  I am including a VS 2012 Sample project that includes a destination treeview on the left side and another treeview and grid on the right side. The treeview on the left is populated from one database and the treeview and grid on the right from another. The goal is to copy (and not "move) data from one database (on the right) to the other (on the left).
The sample is based on the Northwind database.

I couldn't find solutions to many many problems so I just rather to provide a clean sample project so hopefully it can be completed (instead of creating multiple different support tickets). Other that some fragments of JavaScript I could not find any functional and practical sample fully implementing a typical drag and drop scenario on an MVC project with Kendo.

These are the needs which hopefully can be addressed on the provided sample app.:

1) We want to drag from the source treeview to the destination treeview... How can we configure the source treeview visual indicators so users know that they can "drag" but not "drop"on the (same) source treeview but on the treeview on the left?

2) How can we identify the parent node (the target) to which data is being dropped? (I tried the target and dropTarget field but got "undefined"). The other problem is that in our real application, for some reason when data is being  dragged from the grid we do not see any target information (all objects are "undefined").

3) The treeview is very smart and adds the dragged node automatically when dragging from one treeview to the other... However, it is not the case when dragging from the Grid. Can we get some code about how to accomplish this (even better... modify the sample)  so when dragging from the grid instead of a TreeView, the destination treeview behaves exactly the same (e.g. so it displays the same built-in visual effects when hovering between sibling nodes, a parent node or on a node that doesn't allow child nodes, 
etc..)

4) Since we had problems retrieving the destination treeview's targetNode, I could not go further and persist the dragged node to the database implementing an Ajax post to a controller action. It would be great to have that part.

5) The idea is to copy and not move data... How can we prevent Kendo to visually remove automatically the source node from the source treeview once it's been dragged out?


Basically... if someone can complete the sample so it allows transferring data from one Northwind database to another (using either the treeview or the grid on the right to the one on the left) it would be great

Alejandro
Top achievements
Rank 1
 asked on 12 Jun 2013
2 answers
295 views
Hi, I am new to the Kendo UI controls and am evaluating them for potential use in a new project. I am having difficulty getting unobtrusive validation to work for a numeric text box. On the same view, I am able to get unobtrusive validation to work for a Kendo date picker. I am at a loss to understand what I am missing from my MVC4 project. 

I have attached the source for my view, my model, my controller and the html output. I have also attached a screen grab of the unobtrusive validation working for the date picker and not the numeric text box.

Any help would be appreciated. Thanks!
Scott
Top achievements
Rank 1
 answered on 12 Jun 2013
5 answers
2.0K+ views

Hi,

Is it possible to find a node by id (clientside)?

Here is how we populate the treeview.

public JsonResult _AjaxLoading(string id)
{
IEnumerable nodes = from item in GetDirectorys()
where (id == null ? item.parent == "" : item.parent == id)
select new
{
id = item.directory,
Name = item.name,
hasChildren = item.aantal > 0,
};
return Json(nodes, JsonRequestBehavior.AllowGet);
}
Shruthika
Top achievements
Rank 1
 answered on 12 Jun 2013
2 answers
138 views
Has anyone successfully placed the RadEitor within a TabStrip control. ? The Radeditor is always displayed outside of the tabstrip at the top of the form (see attached image).

//sample code
@(Html.Kendo().TabStrip()
    .Name("configuration")
    .SelectedIndex(0)
    .Items(tabstrip =>
     {
     tabstrip.Add()
         .Text("General Settings")
         .Content(@<text>
                   @Html.LabelFor(model => model.Appcutoffdate)    
                   @Html.EditorFor(model => model.Appcutoffdate)           
               </text>);
     tabstrip.Add()
        .Text("Email")        
        .Content(@<text>
                   @{ Html.Kendo().EditorFor(model => model.EmailAcceptBody)
                      .Name("EmailAcceptBody")
                      .Encode(false)
                      .Render();                                                                              
                      }            
               </text>);
     })
)


Thanks
Mike
Mike
Top achievements
Rank 1
 answered on 12 Jun 2013
4 answers
589 views
Hello,

I'm trying to make a grid with PopUp-Mode. Now I need a customized content for the editing-window. I know it is possible to define a "TemplateName" which directs to an EditorTemplate. But in this case I'm not allowed to use an EditorTemplate for different reasons.

I saw in other posts (eg: http://www.kendoui.com/forums/ui/grid/custom-popup-editor-with-additional-fields.aspx#MtaYNNFFv0aHX5-drisScg ) where the Grid was not initialized by the MVC-wrapper, that it is possible to define a template which uses a script (type="text/x-kendo-template") like the following:
<script id="gridEditTemplate" type="text/x-kendo-template">
    Content here
</script>
So in my case I also want to use this kind of template for the editing-window.

Here is my Code of the Grid:
@(Html.Kendo().Grid(Model.Amounts)
    .Name("MyGrid")
    .BindTo(Model.Amounts)
    .ToolBar(commands => commands.Create().Text("add"))
    .DataSource(dataSource => dataSource
        .Ajax()
        .Events(ev => ev.Change("onChange"))
        .Update("Update", "Special")
        .Destroy("Delete", "Special")
        .Create("Insert", "Special")
    .Model(model =>
    {
        model.Id(p => p.ID);
        model.Field(p => p.Amount);
        model.Field(p => p.Type);
    }).ServerOperation(false))
    .Columns(columns =>
    {
        columns.Bound(p => p.Amount).Title("Amount");
        columns.Bound(p => p.Type).Title("Type).Width(70);
        columns.Command(command => { command.Edit(); command.Destroy(); }).Width(160);
    })
    .Editable(editable => editable.Mode(GridEditMode.PopUp).CreateAt(GridInsertRowPosition.Bottom).Window(w => w.Title("Amounts: ")))
)

So what can I do to use a specific template-script? I can't use an EditorTemplate.

Thank you!
BigzampanoXXl
Top achievements
Rank 1
 answered on 12 Jun 2013
1 answer
56 views
I think I found a little bug. I can reproduce it with your demo with the Opera 12 and the IE10 browser.

reproducing steps for the demo:

click "add new record"
move to page 2
move back to page 1
now you have an empty row in the grid

If you press the create button twice, the validation message will show, but if you move the page (you CAN move the page), the validation message won´t show.
Vladimir Iliev
Telerik team
 answered on 12 Jun 2013
0 answers
56 views
I'm trying to do the edit for a grid in separate view. The reason I need to accomplish this is because the information is too large for a modal. Right now this is how I'm moving to the new view.

grid.bind("edit", function (e) {
                grid.cancelChanges();
                window.location = '@Url.Action("AddEditCoalition","InputData",new{coalitionId=Model.CoalitionId})' + '&formId=' + e.model.Id;
}
Is there a cleaner way to do this becuase I little bit of the modal does popup intialy before changin to a new view.
Chrys
Top achievements
Rank 1
 asked on 11 Jun 2013
1 answer
491 views
Hi I'm fairly new in web development so please excuse my ignorance. I'm using the grid and have a custom toolbar command. When the custom command is clicked and a row is selected I want to pass the selected row data to the window. Can someone please tell me what would be the correct/preferred way to do this? Right now I have the selected row data and I can pop up my window. I read through the forums and some hinted about a partial view?? I'm assuming you would have the window display the partial view which has your model of data that you would want to send back to the server when the user clicks a save button for example but as I said I also want to display the additional row data in the window.

Any help would greatly be appreciated especially with a basic example of how to call a window and pass data from the main page.

Vince.
Vince
Top achievements
Rank 1
 answered on 11 Jun 2013
1 answer
68 views
Hello,

Where I can change ressources related to Grid?

In batch mode the french translation button Save changes is incorrect : "Entregistrer les modifications" and should be "Enregistrer les modifications".

Thank you.
Georgi Krustev
Telerik team
 answered on 11 Jun 2013
3 answers
165 views
Im having a problem rendering a detail template which is compose of Kendo Tabstrip. It generates an "Invalid Template" error. Below is my code

@(Html.Kendo().Grid<OrderInfo>()
    .Name("grid")
    .Columns(columns =>
    {
        columns.Bound(e => e.OrderID);
        columns.Bound(e => e.MaterialID);
    })
    .Sortable()
    .Pageable()
    .Scrollable()
    .ClientDetailTemplateId("drawingtemplate")
    .DataSource(dataSource => dataSource
            .Ajax()
            .Read(read => read.Action("ReadOrders","Admin"))
       )
   .Events(events => events.DataBound("dataBound"))
 )
<script>
    function dataBound() {
        this.expandRow(this.tbody.find("tr.k-master-row").first());
    }
</script>
<script id="drawingtemplate" type="text/kendo-tmpl">   
    @(Html.Kendo().TabStrip()
        .Name("my#=OrderID#")
        .SelectedIndex(0)
        .Animation(animation => animation.Open(open => open.Fade(FadeDirection.In)))        
        .Items(items =>
          {
              items.Add().Text("FirstTab")
                  .Selected(true)
                  .Content("try");
          })
          .ToClientTemplate()       
          )
@(Html.Kendo().NumericTextBox<double>()
            .Name("my#=OrderID#")
            .Format("p0")
            .Min(0)
            .Max(0.9)
            .Step(0.01)
            .Value(0.05)
            .ToClientTemplate()
        )
</script>
Dimiter Madjarov
Telerik team
 answered on 11 Jun 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?