Telerik Forums
UI for ASP.NET MVC Forum
3 answers
888 views

What is the correct way to have a column in a Telerik MVC Razor page that contains a link for a person to click and view an image in another window?

 

The images will be on a network directory share.  

Each row image location is passed in the data view model.

 

Something like <a href = "file://///ccijisdevbt01m\d$\pictures\Graffiti_London.jpg" target="_blank"> Link to image </a>

Konstantin Dikov
Telerik team
 answered on 14 Sep 2016
9 answers
974 views
Hello,

I am invoking a popup (which is a partial view) from a link  in a main grid. I have a popup with checkbox column and other column which is non editable. The popup window (with Grid) opens correctly and if I keep "Edit" button then I am able to select a checkbox and when I say "update" then I get correct value of checkbox in the controller "update" function. Line by line editing without Batch (without SaveChanges) works correctly and I get CheckBox value as true.

However it is not working in Batch mode. I have set inline mode but no help. The Save button click doesnot invoke my update function. What is missing?

Following is code to invoke a popup from link on  main grid.
-----------------------------------------------------------
 columns.Template(@<text> </text>)
                              .ClientTemplate("<a href='" + Url.Action("ShowPopup", "Events") + "/#= EventId #'" + ">Customers</a>");
--------------------------------------------------------------
Following is code for PopUp:  

-------------------------------------------------------------------------
@using SampleAppModelsAndServices.Areas.AreaOne.Models

   @(Html.Kendo().Window()
    .Name("Window1")
    .Title("Customers")
    .Content(@<text>  
       @(Html.Kendo().Grid<CustomerModel>()
        .Name("GridPopup")
        .Columns(columns =>
        {
            //columns.Bound(p => p.CustomerId);

            columns.Bound(p => p.CheckSelect).Title("Select").Width("10%").HtmlAttributes(new { @style = "font-size:x-small" }).ClientTemplate("<input type='checkbox' #= CheckSelect ? Checked='Checked' : ''# > </input>");
            columns.Bound(p => p.CustomerName).Title("Customer Name").Width("20%");
           
            //columns.Command(c =>
            //{
            //    c.Edit().Text(" ");

            //}).Title("Commands").Width("20%");


        })

                        .ToolBar(tools =>
                                {

                                    tools.Save();
                                })
                            .Editable(editable => editable.Mode(GridEditMode.InCell))

        //  .Sortable()
               //  .Pageable()
               // .Filterable()
          
          .DataSource(dataSource => dataSource
                  .Ajax()
                  .Batch(true)
                  .ServerOperation(false)
                  .Model(model =>
                  {
                      model.Id(m => m.CustomerId);
                      model.Field(m => m.CheckSelect).Editable(true);
                      model.Field(m => m.CustomerName).Editable(false);
                     // model.Equals(m => m.SelectCheck);
                  })


              
              // .Read(read => read.Action("GetCustomers", "Events", new { area = "AreaOne" , @id = Model.ContextId }))
              .Read(read => read.Action("GetCustomers", "Events", new { area = "AreaOne"}))
              // .Update(update => update.Action("Update", "Customers", new { area = "Sales" }))
                //.Update(update => update.Action("UpdateCustomers", "Events", new { area = "AreaOne" , @id = Model.ContextId }))
                .Update(update => update.Action("UpdateCustomers", "Events", new { area = "AreaOne"}))

                           ))
    
    
    
    </text>)

    .Resizable()
    .Draggable()
   // .Width(600)
    .Actions(actions => actions.Minimize().Maximize().Close())
            //.Events(ev => ev.Close("Window1_onClose"))
   // .Visible(true)

    )
Rosen
Telerik team
 answered on 14 Sep 2016
3 answers
169 views

Are there any plans on updating the Telerik.Web.Spreadsheet.dll to work with .Net Core?

I'm working on an ASPNET CORE project and I need a way for a user to select an excel file from a dropdown and then load it into the spreadsheet control.

 

Thanks,

Rumen
Telerik team
 answered on 14 Sep 2016
1 answer
132 views

Dear kendo ui team.

You publish really helpful sample projects. Taking a closer look you use unofficial APIs to solve the problems. This means you don't support those solutions in typescript and tehre is no documentation for them to understand what else could be done with those APIs. That's really unfortunate.

One of those helpful examples is found here. kendo.timezone and kendo.date seem to be unofficial APIs, since they are not includede in the typescript definition.

<script>   
    function getAdditionalData() {
        var scheduler = $("#scheduler").data("kendoScheduler");
 
        var timezone = scheduler.options.timezone;
        var startDate = kendo.timezone.convert(scheduler.view().startDate(), timezone, "Etc/UTC");
        var endDate = kendo.timezone.convert(scheduler.view().endDate(), timezone, "Etc/UTC");
 
        //optionally add startTime / endTime of the view
        var startTime = kendo.date.getMilliseconds(scheduler.view().startTime());
        var endTime = kendo.date.getMilliseconds(scheduler.view().endTime());
        endTime = endTime == 0 ? kendo.date.MS_PER_DAY : endTime;
 
        var result = {
            Start: new Date(startDate.getTime() - (startDate.getTimezoneOffset() * kendo.date.MS_PER_MINUTE) + startTime),
            End: new Date(endDate.getTime() - (endDate.getTimezoneOffset() * kendo.date.MS_PER_MINUTE) + endTime)
        }
 
        return result;
    }
</script>

Using those APIs in your official sample projects makes those APIs somehow official. Would be nice if you honor that in your documentation and typescript definitions.

Kind regards

Bernd

 

Stamo Gochev
Telerik team
 answered on 14 Sep 2016
4 answers
906 views
I'm having issue with mvc grid export to excel (using 2015.1.318 trial mvc version).   grid populates fine.  export to excel works with smaller records.. but when downloading bigger size of file, it errors as "Failed to load resource: the server responded with a status of 500 (Internal Server Error)"  however, read method /Report/GetGridData controller fine.  it's dynamically creating columns from datatable.   Does anyone have any clue what I might be doing wrong here ?  

2015.1.318 trial mvc version
MVC5
VS2012

--- controller
        [HttpPost]
        public ActionResult GetGridData([DataSourceRequest] DataSourceRequest request, string spName, string program, string fromDate, string toDate)
        {
            DataTable _dataTable = new DataTable();
            ReportData reportData = new ReportData();
            user = UserManager.FindByNameAsync(User.Identity.Name).Result;
            _dataTable = reportData.GetSPData(spName, user.Id, program, fromDate, toDate);
            return Json(_dataTable.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
        }

--- cshml

                                @(Html.Kendo().Grid<dynamic>()
                                .Name("abcGrid")
                                .Columns(columns =>
                                {
                                    foreach (System.Data.DataColumn column in Model.Columns)
                                    {
                                        var c = columns.Bound(column.ColumnName).Title(column.ColumnName).Width(150);
                                    }
                                })
                                .Excel(excel => excel
                                    .AllPages(true)
                                    .FileName("abcGridExport.xlsx")
                                    .ProxyURL(Url.Action("Excel_Export_Save", "Grid"))
                                )
                                .Pageable()
                                .AutoBind(false)
                                .Sortable()
                                .ToolBar(tools => tools.Excel())
                                .Filterable()
                                .DataSource(dataSource => dataSource
                                    .Ajax()        
                                    .Model(model =>
                                        {
                                            foreach (System.Data.DataColumn column in Model.Columns)
                                            {
                                                var field = model.Field(column.ColumnName, column.DataType);
                                            }                
                                        })
                                    .Read(read => read.Action("GetGridData", "Report").Data("readparameter"))
                                )
                            )
Steve
Top achievements
Rank 1
 answered on 13 Sep 2016
3 answers
493 views

Hi! I'm trying to do the following:

I have a grid of groups, and each group can have a bunch of items. The items have two fields right now (url and name, ie two text fields) . I'd like to create a new group, and in the popup editor, being able to add items to it.

The group is something like:

public class Group

{

  public long Id {get; set;}

  public string Name {get; set;}

  public List<Item> Items {get; set;}

}

And the items are like:

public class Item

{

   public long Id {get; set;}
   public string Name {get; set;}

   public string Url{get; set;}

}

I tried to use a ListView but it didnt quite work (seems the API is way, way less developed than the grid's for example), what do you think its the best way to do this? Maybe another grid with inline editing?

Ideally what I'd want is for the nested Item editor to add items to the group being created, and once that group is submitted, then persist everything in the DB.

Danail Vasilev
Telerik team
 answered on 13 Sep 2016
2 answers
161 views

Recently I met a issue that when I batch update my grid, and it's always call the action I not assign to ?  And I have no idea why the grid keep calling Index action when I press the save changes button. here is the code below, my update controller and action is IV21080W and SenToTurnkey. No matter what I change the action, the grid just keep calling Index action.  this issue just pendding me lots of days.

.DataSource(dataSource => dataSource.Ajax().PageSize(15).Batch(true)
.Events(events => { events.Error("IV21080WErrors"); events.RequestEnd("IV21080WCRUDevents"); })
.Update("SentToTurnkey", "IV21080W")
.Read("Read", "IV21080W").Filter(x => x.Add(z => z.INVOICEDATE).IsEqualTo(DateTime.Parse("2016/09/01")))
.Model(model => { model.Id(m => m.KEY_NO); model.Field(m => m.errorType).Editable(false); model.Field(m => m.INVOICENUMBER).Editable(false); model.Field(m => m.INVOICEDATE).Editable(false); model.Field(m => m.INVOICETIME).Editable(false); model.Field(m => m.AMOUNT).Editable(false); model.Field(m => m.TAXAMOUNT).Editable(false); model.Field(m => m.TOTALAMOUNT).Editable(false); })
)
.Editable(editable => editable.Mode(GridEditMode.InCell))
.AutoBind(true)
.Sortable()
.Filterable()
.Scrollable(s => s.Height("auto"))
.Pageable(pageable => pageable.Refresh(false).PageSizes(false).ButtonCount(5))
.ToolBar(toolbar => { toolbar.Excel(); toolbar.Save().SaveText("SentToTurnkey"); })
.Excel(excel => excel.FileName("IV21080W.xlsx").Filterable(true).AllPages(true).ProxyURL(Url.Action("Save", "ILISFinPublic")))

ITGF
Top achievements
Rank 1
 answered on 13 Sep 2016
9 answers
1.2K+ views
I've noticed that we have the option of doing a custom sort here: [url]http://docs.telerik.com/kendo-ui/api/web/grid#configuration-columns.sortable.compare[/url].

I'm using the MVC wrappers, but cannot figure out the syntax to make it work in my grid, or find an example.  Could you provide me with an example of this functionality using the MVC wrapper?
Dimiter Madjarov
Telerik team
 answered on 13 Sep 2016
4 answers
591 views
Hi all,

I use a ViewModel when binding to a grid.
However when using the filtering function I get the following:

Invalid property or field - 'UserName' for type: ErrorLog

Username is only a property in the ErrorLogViewModel

The code to fill my view model is:
public ActionResult ListErrors([DataSourceRequest]DataSourceRequest request)
        {
            IQueryable<ErrorLog> errorLogs = (IQueryable<ErrorLog>)db.ErrorLogs.Include(e => e.User).OrderByDescending(e => e.ErrorLogId);
            DataSourceResult result = errorLogs.ToDataSourceResult(request, errorLog => new ErrorLogViewModel
                {
                    ErrorLogId = errorLog.ErrorLogId,
                    Message = errorLog.AdditionalMessage,
                    Timestamp = errorLog.Timestamp,
                    UserName = errorLog.User.UserName
                });
            return Json(result);
        }

Thanks,
Keith. 









Maria Ilieva
Telerik team
 answered on 12 Sep 2016
2 answers
132 views

hello Support,

    We are using Spreadsheet and found one issue. This issue also exist in Online Demo. Enter some words in cell that not any format, save as Json or Excel file. Next, import the saved Json or Excel file again, you will find the words has redundant Underline format.

    Seemly it is bug for Spreadsheet widget. Could you please give us some advice? We are using this widget in our project and it is emergency.

Thanks

Mark

 

   

Stefan
Telerik team
 answered on 09 Sep 2016
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
Upload
ComboBox
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
ListView (Mobile)
Pager
Accessibility
ColorPicker
DateRangePicker
Wizard
Security
Styling
Chat
MediaPlayer
TileLayout
DateInput
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
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?