Telerik Forums
UI for ASP.NET MVC Forum
8 answers
283 views
HI, it is my first time attempting to use the asynchronous file upload method. Normally, I would use the synchronous method for smaller files. But now, I am dealing with video files, which can sometimes be bigger in size, so I want to use the asynchronous method so the user can see the progress (better user experience). I have attached my screenshots for reference.

I also am wondering, is it possible for me to use the ProgressBar in an synchronous file upload? My objective is to use Telerik 100% for my website, so as far as possible, I do not want to rely on any other external script that is not Telerik.
Dimiter Madjarov
Telerik team
 answered on 04 Dec 2014
1 answer
138 views
I have a grid with too many rows to fit on the screen. When exporting to Excel, only those rows visible on the screen are exported to the PDF page.  With exporting to Excel, I can set excel.allPages = true to save all rows to an Excel file. Is there a way to do so for exporting to PDF?

Thanks. 
Dimiter Madjarov
Telerik team
 answered on 04 Dec 2014
8 answers
286 views
Hello,

I'm trying to accomplish the following: I need an ajax enabled grid (declared with wrappers); the entities of the grid (let's say of type DocumentData) have a reference to another entity (that would be Country) .

Now, when in view mode, the grid should display the Description of the Country: this I accomplish by using the ClientTemplate of the BoundColumn.

When in edit mode, the grid should display a combobox; this combobox must be bound to the action of a controller: this gives us also filtering.

Filtering Country and saving DocumentData with the new selected data works perfect. 

The problem appears when we try to edit again: when switching the row to edit mode, the combox does not display the text (the Description property of the Country), but the Id; even so, if we delete the number in the combox, the filtering works again, and also the updating.

Below the code :

@{
    Html.Kendo()
        .Grid<Teamnet.eViza.Model.Entities.App.DocumentData>()
        .Name("gridDocumentData")
        .Columns(columns =>
        {
            columns.Bound(c => c.Id);
            columns.Bound(c => c.IssuedByAuthority);
            columns.Bound(c => c.IssuedCountry)
                       .ClientTemplate("#=(IssuedCountry == null) ? '' : IssuedCountry.roDescription #")
                       .EditorTemplateName("NomLookup");
            columns.Command(command => { command.Edit(); command.Destroy(); }).Width(200);
        })
        .DataSource(dataSource =>
        {
            dataSource.Ajax()
               .CrudWithQueryAndDefaultCommands(
                   new Teamnet.eViza.Business.Queries.AllEntitiesOfTypeName(typeof(Teamnet.eViza.Model.Entities.App.DocumentData)),
                  "DocumentData")
               .AutomaticRefreshed();
             
            dataSource.Ajax()
                .Model(model => model.Id(a => a.Id));
            dataSource.Ajax().PageSize(10);
        })
        .ToolBar(toolbar => toolbar.Create())
        .Editable(editable => editable.Mode(GridEditMode.InLine))
        .AutoBind(true)
        .Pageable()
        .Filterable()
        .Sortable()
        .Render();
}

And, the editor template:

@model Teamnet.eViza.Model.Entities.BaseNom
 
@(Html.Kendo().ComboBoxFor(a => a)
                .DataTextField("roDescription")
                .DataValueField("Id")
                .Filter(FilterType.StartsWith)
                .HighlightFirst(true)
                .MinLength(1)
                .DataSource(dataSource =>
                            dataSource.Read(read =>
                                read.Action("Read", "NomComboBox", new { nomType = Teamnet.eViza.WebCommon.Utils.TypeUtils.FullNameWithAssembly(ViewData.ModelMetadata.ModelType) })
                            ).ServerFiltering(true))
                .SelectedIndex(0)
)

Attached you can find some pictures of the grid in view mode and edit mode.

Do you have any idea why this might happen ?

Thank you,
Bogdan
Daniel
Telerik team
 answered on 04 Dec 2014
7 answers
137 views
Where can I get the demo project source code to look into ?
I was looking for this demo: http://demos.telerik.com/aspnet-mvc/treelist/remote-data-binding.

Also we are also looking for binding the Treelist to dataTable object, which I think should be straight forward like the TreeView, correct ? 
Nikolay Rusev
Telerik team
 answered on 04 Dec 2014
2 answers
153 views
Dear all,

I am confused why my editor template doesn't work in the child grid then I used ("\\#=EditorTemplateName\\#") but it still didn't work . But if I use the editor template in the parent grid, it works. Do anyone here could help me?

Regards,

Rudy
Rosen
Telerik team
 answered on 04 Dec 2014
8 answers
975 views
Hi,

I have a couple of columns on a grid, some are editable and others are not. I want to be able to click in cell and change its value and then tab out of the cell.
Once I have tabbed out of a cell I want to be able to get that cell row and then pass that to a controller to perform a calculation and then return and update the grid. I need to pass the data item back to the controller I do not want to use the aggregates sum, count etc as my calculations are more complicated.

I have seen the following example:

http://www.telerik.com/forums/working-with-bound-data-on-client-side

But this doesn't really work as I expected, can you explain how I can achieve the above, I'm using Telerik MVC Grid. Thanks

Below is the code I'm trying to get to work.

Would it be possible to have a sample project?


@model IEnumerable<InlineEditing.Models.ProductViewModel>

  @(Html.Kendo().Grid(Model)
    .Name("gridCustom")
    .Columns(columns =>
    {
        columns.Bound(p => p.ProductID).Width(120);
        columns.Bound(p => p.ProductName).Width(400);
        columns.Bound(p => p.UnitPrice).Width(120);
        columns.Bound(p => p.UnitsInStock).Width(120);
        columns.Bound(p => p.Total).Width(120);
    })
    //.ToolBar(toolBar =>
    //    {
    //        toolBar.Create();
    //        toolBar.Save();
    //    })
    .Editable(editable => editable.Mode(GridEditMode.InCell))
    .Pageable()
    .Sortable()
    .Scrollable()
    .Navigatable()
    //.HtmlAttributes(new { style = "height:430px;" })
    .DataSource(dataSource => dataSource
        .Ajax()
        .Batch(true)
        .ServerOperation(false)
        .Events(events => events.Change("Edit"))
        .Model(model =>
        {
            model.Id(p => p.ProductID);
            model.Field(p => p.ProductID).Editable(false);
            model.Field(p => p.Total).Editable(false);
        })
        .PageSize(20)
        .Read(read => read.Action("EditingCustom_Read", "Home"))
        .Create(create => create.Action("EditingCustom_Create", "Home"))
        .Update(update => update.Action("EditingCustom_Update", "Home"))
        .Destroy(destroy => destroy.Action("EditingCustom_Destroy", "Home"))
        
    )
)



Alexander Popov
Telerik team
 answered on 04 Dec 2014
1 answer
224 views
Hi,

I having an issue setting the chart colours using. Up to 8 seems to work fine but anything over 8 stops the colours
being displayed in the right sequence. The first colour #008000 is displayed third.


mvc


.ColorHandler("setChartColour")

javascript

var idx = -1;

function setChartColour()
{
  if (idx == 9) //<------ 8 works
    idx = 0;
  else
    idx++;

  switch(idx)
  {
    case 0:
   {
     return '#008000';//<----Green
   }
   case 1:
   {
     return '#FF0000';//<---Red
   }
   case 2:
   {
     return '#0D0DFF';
   }
   case 3:
   {
     return '#993300';
   }
   case 4:
   {
     return '#9933FF';
   }
   case 5:
   {
     return '#FFCC00';
   }
   case 6:
   {
      return '#00CCFF';
   }
   case 7:
   {
     return '#5F5F5F';
   }
   case 8:
   {
     return '#FF33CC';
   }
   case 9:
   { 
     return '#FFCC00';
   }
  }//end switch
}
T. Tsonev
Telerik team
 answered on 04 Dec 2014
1 answer
178 views
Hi,

I have a grid in which I have bound the DropDownLists to data, but on one of the list, the data is a very large list of products. I don't want to load the entire list, I want to have the user type in 3 letters, then automatically load the dropdownlist and allow selection. As the user types in more, the DropDownList will have fewer products to choose between. I want to save the productID, but display Category -> Product Name. 

Is this possible?
Vladimir Iliev
Telerik team
 answered on 04 Dec 2014
0 answers
133 views
I hope u can help me. 
I am coding for the grid that is used in the Telerik MVC Extensions.
I know that it is not supported any more but I thought maybe the current grid has the same style and format.
What I am needing to do is register for the click event for the filter button that is clicked on to apply the filters the user chooses. This is the button that appears in the popup where the user chooses the filters. This is the button that when clicked on causes the server's action method for the Select event to be called.The attached photo shows the filter button I am talking about.

What I am trying to do is write client side code would register one event handler for all the individual click events associated with each filter button in each column filter pop up iin a grid, and also individual event handlers for each click event.

I added code in the grid onLoad event handler to register for the click event but it does not work
I tried first registering for filter button click event the is associated with the first column
   function gud_onLoad(e) {
$('#UnAssignedDevices th:eq(1)')
.find(".t-filter-button") //find the filter button
.click(function (e) { // subscribe to its click event
alert("filter  button 1");
});

That did not work so I then tried for any filter button click event,
   function gud_onLoad(e) {
$("#UnAssignedDevices .t-filter-button").click(function (e) { // subscribe to
its click event
alert("filter button 1");
});
That did not work either

Below is the code for the grid
<%=
Html.Telerik().Grid((IEnumerable<CommandCenter.Models.DeviceViewModel>)ViewData["Devices"])
.Name("UnAssignedDevices")
.Columns(columns =>
{
columns.Bound(d => d.HostId).Visible(false);
columns.Bound(d => d.HostName)
.ClientTemplate("<input type='checkbox' name='chk_add_devices'
value='<#= HostName #>' onclick='select_grp_ua_device(this,this.checked, this.value)'
/>")
.HeaderTemplate("<input type='checkbox'
name='chk_select_grp_ua_devices_hdr' onclick='select_all_grp_ua_devices(this.checked)' />
<span class='box_sep'>Check All</span>")
.Title("Check")
.Width("10%")
.HtmlAttributes(new { style = "text-align:center" });
columns.Bound(d => d.HostName)
.Width("25%");
columns.Bound(d => d.SerialNo)
.Width("25%");
columns.Bound(d => d.TopAssembly)
.Width("25%");
columns.Bound(d => d.MacAddress).Width("25%");
columns.Bound(d => d.Installed).Width("25%");
})
.DataBinding(dataBinding =>
{
dataBinding.Ajax()
.Select("UnAssignedDevices", "DeviceManagement", new { cid =
ViewData["sel_cid"], gid = ViewData["gid"] });
})
.ClientEvents(events => events
.OnDataBinding("gud_onDataBinding")
.OnDataBound("gud_onDataBound")
.OnRowDataBound("gud_onRowDataBound")
.OnLoad("gud_onLoad")

)
.Pageable()
.Filterable()
%>
steven
Top achievements
Rank 1
 asked on 04 Dec 2014
1 answer
87 views
I 'd like to know if I could change the data source of Autocomplete component dynamicly
I means I will use one data source and depending on what user select I will change the data source to another one.
Georgi Krustev
Telerik team
 answered on 03 Dec 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?