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

Good day I am using a Kendo Grid on one of my applications. The Grid is defined like below. Editing of data is done via a popup that started from the _EditRoute action. Data for the grid is bound serverside via _SelectRouteData but users can apply their own filter to the Data via the header column since we have .Filterable() enabled on the Grid. Currently the state of that filter is lost when context passes back to the main grid after an update on the the Popup Screen as we call grid.rebind() in Javascript to refresh data in the Grid Post update.

Is there an easy way to persist the state of the ClientSide filter?

I have tried saving and reapplying the filter in Javascript like this

var filter = grid.dataSource.filter(); grid.rebind(); grid.dataSource.filter(filter);

but this still loses the filter after grid.rebind()


Any help would be greatly appreciated.

Best Regard
Wilhelm Erxleben

@(Html.Telerik().Grid(Model)
                                .Name("RouteManagement")
                                .DataKeys(keys => keys.Add(r => r.RouteID))
                                .ColumnContextMenu()
                                .Columns(columns =>
                                {
                                    columns.Bound(r => r.RouteID).Title("Route ID").Width(40).Hidden(true).IncludeInContextMenu(false);
                                    columns.Command(commands =>
                                        commands.Custom("editRoute")
                                            .Text("Edit Route")
                                            .ButtonType(GridButtonType.Image)
                                            .DataRouteValues(route => route.Add(r => r.RouteID).RouteKey("routeId"))
                                            .Ajax(true)
                                            .Action("_EditRoute", "RouteData")

                                    ).Width(50).IncludeInContextMenu(false);

                                    columns.Bound(r => r.AccountNo).Title("Account No")
                                    columns.Bound(r => r.ConsumerNo).Title("Consumer No")
                                    columns.Bound(r => r.DivertCodes).Width(105);


                                })
                                .DataBinding(dataBinding => dataBinding.Ajax()
                                    .Select("_SelectRouteData", "RouteData"))
                                .Sortable()
                                .Selectable()
                                .Filterable()
                                .Resizable(resizing => resizing.Columns(true))

                                .Scrollable(scroll => scroll.Height("410px"))
                                .ClientEvents(events => events
                                                .OnLoad("onLoad").OnDataBinding("BindValues")
                                                .OnRowSelect("onRouteRowSelected")
                                                .OnRowDataBound("onRouteRowDataBound")
                                                .OnComplete("onRouteComplete"))
        )




Eyup
Telerik team
 answered on 24 Dec 2021
1 answer
1.0K+ views
What is the best approach to create PDF using Telerik?
Eyup
Telerik team
 answered on 23 Dec 2021
1 answer
244 views

The default NumericTextBox widget that is being generated when InCell editing a decimal field in a TreeList widget is constrained to 2 decimal precision. I want to achieve 3 decimal place precision.  I have set the format as "{0:n3}" to force the value to be displayed as 3 decimal places, but the NumericTextBox editor is rounding to 2 decimal places.  I want to override this but have not been successful.  Is there a way to specify the default editor for a TreeList field?  For the Grid widget, we can use the DefaultEditorTemplate but no such property seems to exist for TreeList fields.  It would be great if I could simply use the editor templates found in ~/Views/Shared/EditorTemplates, but this does not appear to be the case as changes to these default editor template files is not reflected for the InCell editor.

Eyup
Telerik team
 answered on 22 Dec 2021
1 answer
188 views

Hello,

We are using the Content-Security-Policy in our ASP.NET MVC application and also using the Kendo UI controls.

Here are the details of the Content-Security-Policy:

 

<customHeaders>
  <add name="Content-Security-Policy" value="default-src https:;
object-src 'none';
script-src 'self' 'unsafe-eval' 'nonce-03148CFC65E74341814490514E0CEDD8';
style-src 'self' 'unsafe-inline' https://fonts.googleapis.com;
img-src 'self' data:;
font-src 'self' https://fonts.gstatic.com;
connect-src 'self' https://api.zoomcharts-cloud.com;
form-action 'self';"></add>
</customHeaders>

The application is running as expected until we remove the "unsafe-eval" from the "script-src" and the web page is throwing the below error:

 

Note:

 

Please help us out.

Thanks & Regards

Raju Chauhan

Anton Mironov
Telerik team
 answered on 22 Dec 2021
1 answer
110 views

I am having some odd behavior in our application where it appears the series label lines are being rendered backwards (see backwards.png). I am trying to construct a test case that displays this behavior, but I haven't had any luck, I just get the correct positioning (see correct.png).

Does anyone here have any thoughts on what might be causing this? Some obscure CSS setting or such?

 

Yanislav
Telerik team
 answered on 21 Dec 2021
1 answer
123 views

I am trying to format some cells in a Kendo grid.

Here is the code:

c.Bound(p => p.YTD).ClientTemplate("<td bgcolor=\"red\">#:YTD#</td>");

A new empty column is created in the grid next to the column that I want to change the background color.

If I use c.Bound(p => p.YTD).ClientTemplate("<strong>#: YTD #</strong>"); the alignment is correct.

 

Why does the td tag add a new column?  How can I address this?

 

Thank you.

 

Petar
Telerik team
 answered on 16 Dec 2021
1 answer
240 views

Hi,

I have been trying to display an image inside a Kendo Tooltip in MVC.

The image src is from web.

When I deploy my app in Azure and try to view the tooltip. It do not display the image, instead I get a <broken image> icon displayed.

Requirement:

I am displaying list of Image files in a table in a page.

The table has three columns:

Document Name  |    Date of Upload    |     Uploader name

The "Document Name" column will display the name of the documents and these names are visible in the form of hyperlink that has the URL of the document location. (The documents are from SharePoint Online).

My requirement is to on hover I must display a tooltip that will display the image file. (which resembles like a preview)

I am using the below code for kendo tooltip

$("td.documentNo").kendoTooltip({
                      filter: "a.hasTooltip",
                        position: "right",
                        width: 500,
                        height: 500,
                        content: function (e) {
                            var URL = e.target.context.href;
                            return $("<img class='image-preview' height='500' width='500'>").attr("src", URL);
                        }
                    });

 

Here "td.documentNo" :- .documentNo is a class name given to identify the column.

Here "a.hasTooltip" :- .hasTooltip is a class name given to identify the Anchor tag

This on testing in my local works absolutely fine. But when I upload this in Azure Cloud the code doesn't work. It display the tooltip but the image is not displayed.

Am I doing anything wrong. Please guide me.

Regards,

Niroj.

 

Eyup
Telerik team
 answered on 16 Dec 2021
1 answer
460 views

Hi all,

I started working with Blazor few weeks ago and recently got introduced to Telerik UI for Blazor so I started making a CRUD to learn.

After coding the update function I tested the app and got this error when I tried to update a register:

The instance of entity type 'Familia' cannot be tracked because another instance with the same key value for {'CodiFamilia'} is already being tracked.

To solve that I added "AsNoTracking" to the Entity Framework Core query located in "ReadList", it worked the first time but the app crashed after the second update. Afterwards I implemented an alternative solution which consists on finding the object by its ID and updating every parameter one by one which worked since it's not using the same object.

I'm wondering if there is any way to implement a functional update which resembles the first solution because the second one is pretty bad if there are many parameters to update azarshagle.

Thanks in advance.

Jack
Top achievements
Rank 1
 updated question on 16 Dec 2021
0 answers
158 views

Hi

Reasking the same question below that some else asked in 2016 from here https://www.telerik.com/forums/expressionbuilder-expression(filters)-in-kendo-mvc-grid-not-working-for-navigation-collection 

Is this still the same answer 5 years on?

Cheers

Kyle

Original Question from 2016

"We are using Kendo MVC Grid in our application. We are using LINQ to EF to query the tables.

Following is a query in our application:

query.Where(ExpressionBuilder.Expression<ParentTable>(command.Request.Filters))

This works fine as long as the filters are any columns from the "ParentTable". However, the ParentTable has a navigation collection ICollection<ChildTable> and the ChildTable has a property ChildProperty and the method ExpressionBuilder.Expression fails when we use this ChildProperty for filtering.

Any solution for this problem?

Thanks"

Original Answer

"Hi,

I'm copying my reply to your support ticket here for customer reference.

I'm afraid the Where extension does not support filtering by collection.
This is not a design goal of the data engine.

Regards,
T. Tsonev
Telerik"

Kyle
Top achievements
Rank 1
 asked on 15 Dec 2021
1 answer
566 views

Using the Kendo UI Editor successfully in my application, I recently try to implement a dark mode through an external library.

To my surprise, the editor itself seems to be not able to work correctly in dark mode in general.

I.e. I see dark font color on dark background.

Even the very own demos with the very own Telerik skins fail to work correctly. E.g.:

demos.telerik.com/kendo-ui/editor/index?autoRun=true&theme=material-main-dark

I found no way and no CSS to specify a light default text color.

My question:

How can I configure the Kendo UI Editor to correctly work with a dark background?

Yanislav
Telerik team
 answered on 14 Dec 2021
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
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Template
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
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?