I've sorted out how to use the custom editor template but what I'd like to do is to replace the entire dialog with one that matches the look of the rest of our application. Using the template I can replace individual controls but the header/window/button look and feel is different that what we'd like. I know I can style them but the layout is a little different and I'd like more control.
Can I intercept and block the editor loading and load my own dialog? Or is there another means that I can replace the edit process with my own view?
Thanks,
Brian
Is there a way to change the width of the control. I've try htmlattribute with a class that include the width nothing is changing.
Any clue ?
Best regards
Hi,
I have the following code to create a form, but when I submit it, I get a 400.
@(Html.Kendo().Form<ConfigurationModel>()
.Name(
"formExample"
)
.HtmlAttributes(
new
{ url = @Url.Action(
"ProductQuantity"
,
"Reports"
), method =
"POST"
})
.Items(items =>
{
items.Add()
.Field(f => f.SchoolProductQuantityReportSchoolId)
.Label(l => l.Text(
"School:"
))
.Hint(
"Select a school"
)
.Editor(b =>
b.ComboBox()
.DataTextField(
"Description"
)
.DataValueField(
"Id"
)
.DataSource(dataSource => dataSource
.ServerFiltering(
true
)
.Read(read => read.Action(actionName,
"School"
)
.Data(
"addAntiForgeryToken"
)))
);
})
My goal here is to not use Ajax, I want a full post back the old-fashioned way.
Thanks for your help.
ASP MVC Core grid with the search box enabled. Per the docs I turned server operation to 'false' and from what I have read this should then allow searching for more that just string types. In the below example 'PaymentType' is an enum and the search box does not work when searching for that. It also does not work for the formatted date.
I could change the datatypes to string but then it might break ordering columns that are DateTime types.
@(Html.Kendo().Grid<B3.Services.LoanServices.LoanServiceModels.PaymentServiceModel>()
.Name("PaymentRegisterReport")
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("Payments_Read", "StandardReports", new { area = "Reports" }))
.PageSize(1000)
.ServerOperation(false)
)
.Columns(columns =>
{
columns.Bound(p => p.Date).Format("{0:MM/dd/yyyy}").Title("Date");
columns.Bound(p => p.LoanName).Title("Loan Name");
columns.Bound(p => p.PaymentType).Title("Payment Type");
columns.Bound(p => p.CheckNumber).Title("Check Number");
columns.Bound(p => p.Amount).Title("Amount").Format("{0:C}")
.HtmlAttributes(new { style = "text-align: right" }).HeaderHtmlAttributes(new { style = "text-align: right" });
})
.Pageable()
.Sortable()
.Filterable()
.HtmlAttributes(new { style = "font-size:12px" })
.ColumnMenu()
.ToolBar(t =>
{
t.Search();
t.Excel();
})
.Reorderable(l => l.Columns(true))
.Events( e =>
{
e.ColumnShow("saveKendoGridState");
e.ColumnHide("saveKendoGridState");
e.ColumnReorder("kendoGridColumnReorder");
})
)
Hi,
I'm trying to create an ASP.NET Core version 5.0 application using MVC, Telerik UI for ASP.NET Core version 2020.3.1118, and with individual user accounts (ASP.NET Identity) authentication. I need to add scaffolded items to customize the ASP.NET Identity Pages. It seems that this release of the Telerik UI for ASP.NET Core package is incompatible with scaffolded items for ASP.NET Identity Pages. The errors I get depend on which order I do things in.
Scenario 1: First I create the app (with individual user accounts authentication). Next I add the Telerik.UI.for.AspNet.Core version 2020.3.118 package using the manage NuGet packages for solution menu item. Then I attempt to add a new scaffolded item for Identity. VS2019 gives me an error message dialog box that says:
There was an error running the selected code generator: 'Package restore failed. Rolling back package changes for 'WebApplication1'.'
Scenario 2: First I create the app (with individual user accounts authentication). Next I select the context menu item to add new scaffolded item, select Identity, click Add, wait for package changes to happen, and then cancel out of adding a new scaffolded item. Then I attempt to add the Telerik.UI.for.AspNet.Core version 2020.3.118 package using the manage NuGet packages for solution menu item. That fails and I get the following in my error list:
SeverityCodeDescriptionProjectFileLineSuppression State
ErrorNU1107Version conflict detected for Microsoft.CodeAnalysis.CSharp.Workspaces. Install/reference Microsoft.CodeAnalysis.CSharp.Workspaces 3.8.0 directly to project WebApplication1 to resolve this issue.
WebApplication1 -> Microsoft.VisualStudio.Web.CodeGeneration.Design 5.0.1 -> Microsoft.VisualStudio.Web.CodeGenerators.Mvc 5.0.1 -> Microsoft.VisualStudio.Web.CodeGeneration 5.0.1 -> Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore 5.0.1 -> Microsoft.VisualStudio.Web.CodeGeneration.Core 5.0.1 -> Microsoft.VisualStudio.Web.CodeGeneration.Templating 5.0.1 -> Microsoft.VisualStudio.Web.CodeGeneration.Utils 5.0.1 -> Microsoft.CodeAnalysis.CSharp.Workspaces (>= 3.8.0)
WebApplication1 -> Telerik.UI.for.AspNet.Core 2020.3.1118 -> Microsoft.CodeAnalysis 3.3.1 -> Microsoft.CodeAnalysis.CSharp.Workspaces (= 3.3.1).WebApplication1C:\Users\bmorris\source\repos\WebApplication1\WebApplication1\WebApplication1.csproj1
SeverityCodeDescriptionProjectFileLineSuppression State
ErrorPackage restore failed. Rolling back package changes for 'WebApplication1'.
It seems that scaffolded items want to use Microsoft.CodeAnalysis.CSharp.Workspaces version 3.8 and Telerik.UI.for.AspNet.Core wants to use version 3.3.1 and the version are incompatible. Do you have a solution for this now or on the horizon?
Thanks.
Hi,
I have a treeview and a grid side by side on a page with bootstrap 4 layout. When the user selects a node in the treeview, the grid datasource refreshes. This works ok.
Now I'd like to size the grid and the treeview dynamically to the size of the browser window minus the header of the page, so that the treeview and the grid display a scrollbar (if needed) independently. The tree is load on demand and can contain a lot of elements.
Im struggling with setting the treeview and the grid height in the window resize handler.
Currently the grid is not paging, it maybe a requirement to have the grid paging then I would have to set the pagesize dynamically to display as much rows as possible within the available space..
Thanks for your help
Erwin
Hi Experts,
I'm loading data from a DB and want to begin placing it at row 7...is this possible?
I am trying to figure out how i can add an action event to my custom toolbar button in the .net core grid. I noticed that both the PDF and excel options have an available .ProxyUrl property but custom toolbar does not.
I have something like this......
.Toolbar(toolbar=>toolbar.Custom().Text("CSV Export")
I did see that something like this could be done, but that does not give me the same look and feel. It essentially looks like a hyperlink and nothing more...
toolbar.ClientTemplate("<a href='" +Url.Action("ProductCreate", "Product") +"/test' " + ">Add product</a>");
I have a grid that has the following code as the update action in its datasource.
This is being called before the grid is rendered so I get an error that the datasource is null. Meaning I dont think the grid has initialized on the front end so the '#Grid' isnt there for the returnDirtyFields method to get. Why is this update action data method being run when the grid is not updating?
The .Data() method I want with the update action below it.
function
returnDirtyFields(gridId) {
var
id =
'#'
+ gridId;
var
dataSource;
var
data;
var
changedModels;
dataSource = $(id).data(
"kendoGrid"
).dataSource;
data = dataSource.data();
if
(dataSource.hasChanges()) {
for
(
var
i = 0; i < data.length; i++) {
if
(data[i].dirty) {
changedModels = data[i].dirtyFields
}
}
}
var
temp = $.extend(
true
, {}, { dirtyFields: JSON.stringify(changedModels) });
return
temp;
}
.Update(update => update.Action(
"Entry_Update"
,
"Entry"
).Data(
"returnDirtyFields('Grid')"
))
We have a page that use the Grid, Filter, and DataSource components (note that this is the newer Filter component that supports more advanced features such as grouping different conditions, and not the built-in grid filtering). We're using a shared "standalone" DataSource component so it only has to be setup once and both the Grid and Filter can reference the same thing.
Everything up to this point is working fine. The data is displayed in the grid, the filter can be used to filter the results, etc. However, we're also using getOptions()/setOptions() for both the Grid and Filter components to save the user's options when leaving the page and restore them again when they return. After setOptions() is called for the Grid, the Filter component no longer filters the results in the Grid. There aren't any errors or anything, but adding a filter that should change the results has no impact.
I'm guessing the problem is that setOptions() is changing the data source of the grid, so the Filter component is still applying the filter to the original data source, but that's no longer the same instance that the Grid component is using to display data. I tested this theory by getting a reference to the grid's original data source before calling setOptions(), then setting the grid's data source back to the original data source after calling setOptions(). Although this did fix the problem and I could apply new filters even after calling setOptions(), it also caused some other issues (ex. any previously-saved options related to the data source were now overwritten by replacing the original data source).
Is there a "right" way to do what I'm trying to accomplish here, or maybe some workaround? Is this a bug that I'm running into and it shouldn't really be this difficult? We basically just want to define a data source once, have a Filter and Grid component both reference that data source, and have everything continue to work after calling setOptions().