Attached is the same grid header displays on Chrome and Edge browser.
Is there a way to force the header not to display C... in Chrome?
var RHCenterOverFlow = "text-align:center; font-size:10px; font-weight:bold; padding:0.5px; overflow:visible; white-space:normal";
columns
.Bound(c => c.Class)
.Title("Class")
.HeaderHtmlAttributes(new { style = RHCenterOverFlow })
.Width(40)
.MinResizableWidth(40);
Thanks.
I am populating a grid with dynamic data. I would like to center all but the left column horizontally. The left column should be left-aligned. I've looked at some examples and have not been able to get it to work. My code follows the pattern below. Where/how can I center align all columns that are not the one with the name "LeftMostColumn?" I've mocked up a couple of places where I think this might happen. Please advise. Thanks!
@(Html.Kendo().Grid<
dynamic
>()
.Name("Grid")
.Columns(columns =>
{
foreach (System.Data.DataColumn column in Model.MyDataData.Columns)
{
var c = columns.Bound(column.ColumnName);
if (column.ColumnName != "LeftMostColumn")
{
// center the contents of the column
}
}
})
.DataSource(dataSource => dataSource
.Ajax()
.Model(model =>
{
foreach (System.Data.DataColumn column in Model.MyDataData.Columns)
{
var field = model.Field(column.ColumnName, column.DataType);
if (column.ColumnName != "LeftMostColumn")
{
// center the contents of the field?
}
}
}).Read(read => read.Url(Url.Page("./MyData", new { handler = "GetData_Read" })).Data("forgeryToken"))
)
)
Hello,
I have a kendo grid that uses two foreign keys. The drop-down created has the first parameter, which is for example 1 and 2. For one and two they each have the same four choices in the second parameter drop-down. When the drop down is open you can see the four choices twice for each parameter though they are the same. Is there a way to when is selected in the first drop down to only show the options for that parameter and not the options for the other as well?
Hello Telerik Team
Is there any way to upload an excel file by using angular 2 ?
actually I looking for way that when i uploaded my excel file , the excel data display in to Kendo Grid
thanks in advance
I'm trying to write a graph where the user can configure what data she wants to see.
I implemented a first version based on the remote data binding demo that uses a model describing all data point of the given "column":
Html.KendoEscapeTemplate(Html.Kendo().Chart<
Peppermint.ApplicationCore.ViewModel.FiscalYearSerieDataPointVM
>() ...
With the VM being:
public class FiscalYearSerieDataPointVM
{
public int MonthNumber { get; set; }
public decimal CurrentFiscalYearDataPoint { get; set; }
public decimal? PreviousFiscalYearDataPoint { get; set; }
}
That, obviously, will not work when the char is configured by the user and could have any number of different lines. It's also not very practical to generate data in a "vertical" format because I have to run all queries first and then pivot the result into a collection of FiscalYearSerieDataPointVM
How am I supposed to work around that problem? Am I supposed to use a dynamic object instead of a ViewModel?
I'm having trouble accessing switches in a grid column. I want to loop through them and toggle them on after clicking a toolbar button.
The click event is working. But getting 'undefined' on 'switchInstance ':
Column with switches code:
.Columns(columns =>
{
columns.Bound(p => p.Exempt).Width(100).Filterable(ftb => ftb.Multi(true)).Sortable(false).ClientTemplate(
"<input class='exemptSwitch' id='exemptSwitch' \\#if (Exempt) { \\# checked='checked' \\# } \\# type='checkbox' />");
})
Toolbar button code:
.ToolBar(toolBar =>
{
toolBar.Custom()
.Name("EnableAllFiltered")
.Text("Enable All Filtered")
.IconClass("k-icon k-i-play")
;
})
Click event code:
$(function () {
$(".k-grid-ExemptAllFiltered", "#SubscriberGrid").on("click", function (e) { <--- click of custom grid header toolbar button
$("#SubscriberGrid .exemptSwitch").each(function () {
var switchInstance = $(this).data("kendoSwitch");
switchInstance.enable(true);
});
});
Any assistance would be greatly appreciated!
Jon
Hi,
Could you confirm the necessary requirements to get the Form validation working please?
We create a new project using the Telerik asp.net core 3.1 web MVC project, standard layout choices.
Create a model class with [Required] annotated fields.
Create a new "Create" view with the Form for the model, copying code from the Form examples and from the documentation but the onblur validation never fires?
Do we need jquery-validate files?
What are we missing that triggers the validation?
Thanks,
Daniel.
I want to send an anti forgery token AND additional data in my update ajax call of my grid.
Here is my update
.Update(u => u.Url(
"/Index/?handler=Update"
).Data(
"additionalInfo"
)
I have a Razor Pages project where I have 2 widgets on my UI; a custom widget (non telerik) and the telerik grid. Currently they are supplied their data by the model passed in on my OnGet() method. I cannot get the Grid Persistence (all the grid options) to work with local binding. Is it possible?
Whenever I attempt the setOptions() I get an error because the url path it tries to go to doesnt exist. I am not using Ajax binding for read so there is no read methods. Is it possible to stop this behavior? I would like to use the data in my model only and not have to post another request to get all of the same data.
Grid:
@(Html.Kendo().Grid<MyClass>(Model.Data)
.Name(
"Grid"
)
.Columns(columns =>
{
//column list
})
.Sortable()
.Groupable()
.ToolBar(toolBar =>
{
toolBar.Save();
toolBar.Search();
})
.Editable(editable => editable.Mode(GridEditMode.InCell))
.Scrollable()
.Filterable(ftb => ftb.Mode(GridFilterMode.Row))
.Reorderable(r => r.Columns(
true
))
.Resizable(r => r.Columns(
true
))
.ColumnMenu()
.Pageable(pageable => pageable
.Refresh(
true
))
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(
false
)
.Model(model =>
{
//mode fields
})
.Update(u => u.Url(
"/Index/?handler=Update"
).Data(
"forgeryToken"
))
)
)
And here is how I try to get and set my grid options:
$(
"#gridStateSave"
).click(
function
(e) {
var
grid = $(
"#Grid"
).data(
"kendoGrid"
);
e.preventDefault();
localStorage[
"kendo-grid-options"
] = kendo.stringify(grid.getOptions());
});
$(
"#gridLoadState"
).click(
function
(e) {
e.preventDefault();
var
options = localStorage[
"kendo-grid-options"
];
if
(options) {
grid.setOptions(JSON.parse(options));
}
});
With the code like this, all of the options are applied to my grid, however the data disappears which i assume to be because the setOptions() calls a read method and since there is no read method configured on my grid, errors and returns no data.I would like to prevent having to call a duplicate request to get the same data that is already in my grids datasource.
Any help is appreciated.