Telerik Forums
UI for ASP.NET MVC Forum
1 answer
79 views

i have added export PDF code and js file but when i click on export to pdf button i have getting big column width file.

check following attached file.

 

please help .

Ivan Danchev
Telerik team
 answered on 12 Aug 2020
16 answers
771 views
Hello,
i do not understand why the row is not deleted from the database.Actually is not getting on the server,to execute the delete action from the controller only on the client the row is removed .
i get an example from you guys,and i did the same

@(Html.Kendo().Grid<UCMSPayroll.ViewModels.TallyMeasurementViewModel>()
.Name("Grid")

.Columns(columns =>
{
columns.Template(x => { }).ClientTemplate(

 <a class='k-button' href='javascript: void(0)' onclick='deleteRow(this)' style='min-width:32px!important'><span class='k-icon k-delete'></span></a>"
).Width(100);

columns.Bound(p => p.Code).Title(Resources.Resources.FieldText_TM_Code);
columns.Bound(p => p.Name).Title(Resources.Resources.FieldText_TM_Name);
columns.Bound(p => p.MaxLength).Title(Resources.Resources.FieldText_TM_MaxLength).Width(130);
columns.Bound(p => p.IsActive).ClientTemplate("<input type='checkbox' disabled='true' name='IsActive' #= IsActive ? checked='checked' : '' # />").Title(Resources.Resources.FieldText_TM_IsActive);
columns.Bound(p => p.IsHour).ClientTemplate("<input type='checkbox' disabled='true' name='IsHour' #= IsHour ? checked='checked' : '' # />").Title(Resources.Resources.FieldText_TM_IsHour);
columns.Bound(p => p.Precision).Title(Resources.Resources.FieldText_TM_Precision);
columns.Bound(p => p.Priority).Title(Resources.Resources.FieldText_TM_Priority);
columns.Bound(p => p.Formula).Title(Resources.Resources.FieldText_TM_Formula);


})

.ToolBar(toolBar => toolBar.Template(@"<a class='k-button k-button-icontext k-grid-add' onclick='createRow()' href='javascript: void(0)'><span class='k-icon k-add'></span>adauga</a>
<span id='spanAdd' style='display:none'>Add</span>
<div style='float:right;width:150px;color:black;margin-top:5px'><b>Units</b></div>
"

))
.Pageable()
.Sortable()
.Scrollable()

.DataSource(dataSource => dataSource
.Ajax()
.Events(events => events.Error("error_handler"))
.Model(model => model.Id(p => p.PkTallyMeasurement))
.Create(update => update.Action("EditingInline_Create", "Home"))
.Read(read => read.Action("EditingInline_Read", "Home"))
.Update(update => update.Action("EditingInline_Update", "Home"))
.Destroy(update => update.Action("EditingInline_Destroy", "Home"))
.PageSize(6)

)
)

function deleteRow(element) {
 
grid = $("#Grid").data("kendoGrid");
grid.removeRow($(element).closest("tr"));
 }

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult EditingInline_Destroy([DataSourceRequest] DataSourceRequest request, TallyMeasurementViewModel measurement)
{
if (measurement != null)
{
_tallyMeasurementRepository.Delete(AutoMapper.Mapper.Map<TallyMeasurementViewModel, TallyMeasurement>(measurement));
}

return Json(ModelState.ToDataSourceResult());
}
Petar
Telerik team
 answered on 12 Aug 2020
1 answer
527 views

Hey guys, currently I'm struggling with the PDFViewer. 

First of all, I'm building a PDF dynamically in my WebApp.

RadFlowDocument document;

RadFlowDocumentEditor editor;

 
[...]

PdfFormatProvider providerPDF = new PdfFormatProvider();
return providerPDF.Export(document);

 

So I'm not saving the created PDF as a file on the filesystem. Till now I'm only able to download the created file with the action method: 

public ActionResult DownloadTestDocument()
{
      return File(
           new Verleihinfo().Pdf,   // returns the byte array -> providerPDF.Export(document)
           "application/pdf",
           "test.pdf");
}

Now instead of downloading the file I want to show my pdf directely in the PDFViewer on my page, so that user can see and interact with. Is it even possible (preferably in MVC)? 
As far I unterstood here it's only possible to pass an existing pdf-file on the filesystem as a parameter to the PDFViewer. But not a dynamically created file..

Thank you
Daniel

Daniel
Top achievements
Rank 3
Iron
Iron
Iron
 answered on 10 Aug 2020
3 answers
3.2K+ views

We have fields of type 'string' in our application which are defined like this:

@Html.EditorFor(model => model.Field, new { htmlAttributes = new { @class = "form-control ", @readonly = "readonly" } })

 

 

When we recently switched to the Telerik EditorTemplates we realized that the htmlAttributes weren't applied anymore.

Other fields, for example of type 'integer', still work as before.

 

When we deleted the EditorTemplate 'String.cshtml' the htmlAttributes were applied again, so this template seems to have been used, but just ignored the htmlAttributes.

 

Is this behaviour expected, or do we miss anything?

Anton Mironov
Telerik team
 answered on 07 Aug 2020
10 answers
1.4K+ views
Hello, 

I have a very strange issue.  On one particular server every date value in a kendo grid is off by 1 day.  So if a date in the database is 12/24/1990 it will render as 12/23/1990.  

I have put up 2 test pages on 2 different servers to demonstrate this behavior.  To deploy I published to a location on my machine and copied up to each location to ensure everything is identical.


TEST 1 - Problem server
MVC WEB GRID: shows the correct date values
http://beta.fpsrx.net/Test/Index

KENDO GRID: shows INCORRECT date values
http://beta.fpsrx.net/Test/KendoGrid



TEST 2 - A different server/different host - works as expected
MVC Web GRID 
http://www.dilatingdesigns.com/Test/Index

KENDO GRID
http://www.dilatingdesigns.com/Test/KendoGrid



Any help is appreciated - I can of course either recalculate the date or create a new property on my model to compensate for this, but I really don't want to start down that road.


Thanks,
Derek
Nikolay
Telerik team
 answered on 07 Aug 2020
1 answer
645 views

I'm working on an ASP.NET MVC application which is using Kendo ui in it. We have used a Kendo UI Editor in it for rich texts. It is being used as follows:

@(Html.Kendo().Editor()
   .Name("textControl-Source")
   .Tools(tools => tools.Clear()
   .Bold().Italic().Underline().Strikethrough()
   .FontSize().FontColor().BackColor()                                                          
   .JustifyLeft().JustifyCenter().JustifyRight().JustifyFull()
   .InsertUnorderedList().InsertOrderedList().Indent().Outdent()
   .SubScript().SuperScript())
   .HtmlAttributes(new { style = "height:240px;width:98.5%", data_mintextlength = "1" })
          .Events(events => events
          .Change("mediaBoardEditNS.textControlChange")
          .Select("mediaBoardEditNS.textControlSelect")
        )
    )

 

There is a requirement if we can somehow customize it to show custom colors by using HEX codes like we can do in Microsoft Word font color picker.

Such feature is present in color picker as present here is custom colors: https://demos.telerik.com/aspnet-mvc/colorpicker

I have searched a lot on Telerik forum and SO as well, but couldn't find anything solid. Let me know if i'm missing something. Thanks

Petar
Telerik team
 answered on 07 Aug 2020
5 answers
449 views

Hello Telerik team

For some reason,I want use raw sql get data by entity framework。

like this :  IQueryable<model> data =DbContext.model.SqlQuery("select * from models").AsQueryable();  //dbcontext  DbSet  

binding request filters : data = data.Where(ExpressionBuilder.Expression<model>(request.Filters,false));

 

Can someone help me why there is no effective?
 Thank you.

 

 

 

Ianko
Telerik team
 answered on 07 Aug 2020
1 answer
681 views

After seeing recent reports of security vulnerabilities in ASP.NET AJAX, wanted to confirm if there are similar known vulnerabilities in ASP.NET MVC

https://www.kroll.com/en/insights/publications/cyber/monitor/telerik-vulnerability-surge-web-compromise-cryptomining-attacks

https://nvd.nist.gov/vuln/detail/CVE-2019-18935

https://nvd.nist.gov/vuln/detail/CVE-2017-11317

Plamen
Telerik team
 answered on 06 Aug 2020
2 answers
967 views
I tried searching for this but did not find any answer hence posting here. How do i increase the tool bar size on an kendo grid ? 
Petar
Telerik team
 answered on 06 Aug 2020
2 answers
2.1K+ views

Hi All,

          I am using kendo grid for reporting purpose. But in my report i am using one date column for filtering purpose. My problem is when i use isequal to date filter empty grid is showing.why ?. Actually data is available in model. I attached to file. Please look into that

Kojoe
Top achievements
Rank 1
 answered on 05 Aug 2020
Narrow your results
Selected tags
Tags
+133 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?