Telerik Forums
UI for ASP.NET MVC Forum
3 answers
1.5K+ views

How can I get the original values of the row when calling an update function?

My main issue is that we have a few tables where the primary key is a value we allow to be changed. However, the default auto-generated update functions will fail on update if that value is changed in the grid editor because it won't be able to lookup the row you're updating since it only knows what you want to change the value to and tries to look the row up by the new value.

How can we handle this situation?

Konstantin Dikov
Telerik team
 answered on 16 Nov 2018
5 answers
425 views
I am just wondering how to access the buttons that allow you to choose either to edit the current recurrence or edit the entire recurrence series. I would like to call a function when one of them is clicked. I have attached a picture of the buttons for your convenience.
Veselin Tsvetanov
Telerik team
 answered on 16 Nov 2018
10 answers
1.6K+ views

Hi there - apologies if this is elsewhere, but I've searched and can't find an answer. I have good C# experience, but I'm relatively new to Telerik/Kendo etc,

I am aware of the AllPages(true) option for the Excel printout. What I would like to do on my Grid is to have two excel buttons, one that will export the current page, and one which will export all data.

Is this possible? From what I can see, you can only define one Excel Button on the toolbar.

Thanks in advance.
Eyup
Telerik team
 answered on 15 Nov 2018
3 answers
941 views

I'm trying the grouping in Grid I want to display the sum of the column as ClientGroupHeaderColumnTemplate  or ClientHeaderTemplate but doesn't  seem to be working, it only shows as a ClientFooterTemplate. :

@(Html.Kendo().Grid<Models.DepartmentSummaryView> ()
        .Name("grid")
        .HtmlAttributes(new { style = " height:700px !important;" })
        .Columns(columns =>
        {
            columns.Bound(p => p.DepartmentNo).Width(150).ClientGroupHeaderTemplate("Department: #= value # (Products: #= count#)");
            columns.Bound(p => p.DepartmentName).Width(150).ClientGroupHeaderTemplate("Department: #= value # (Products: #= count#)");
            columns.Bound(p => p.ProductNo).Width(150).ClientGroupHeaderTemplate("Product: #= value # (Count: #= count #)");
            columns.Bound(p => p.ProductName).Width(150);
            columns.Bound(p => p.SKU).Width(150);
            columns.Bound(p => p.Qty).Width(150).ClientGroupHeaderColumnTemplate("Sum: #= sum #").ClientFooterTemplate("Sum: #= sum #");
        })
        .Filterable(filterable => filterable.Extra(false)
        //.Mode(GridFilterMode.Row)
        .Operators(operators => operators
        .ForString(str => str.Clear()
        .StartsWith("Starts with")
        .EndsWith("Ends with")
        .IsEqualTo("Is equal to")
        .IsNotEqualTo("Is not equal to")
        .Contains("Contains")
        .DoesNotContain("Doesn't contain")
        )))
        //.Pageable()
        .Navigatable()
        .AutoBind(false)
        .Sortable()
        .Groupable()
        .Events(events => events.DataBound("onDataBound"))
        .Reorderable(reorderable => reorderable.Columns(true))
        .DataSource(dataSource => dataSource
        .Custom()
        .Schema(schema =>
        {
            schema.Data("Data");
            schema.Total("Total");
        })
        .Events(events => events.Sync("sync_handler"))
        .Group(groups => groups.Add(p => p.DepartmentNo))
        .Aggregates(aggregates =>
        {
            aggregates.Add(p => p.DepartmentNo).Count();
            aggregates.Add(p => p.DepartmentName).Count();
            aggregates.Add(p => p.ProductNo).Count();
            aggregates.Add(p => p.SKU).Count();
            aggregates.Add(p => p.Qty).Sum();
        })
        .Transport(transport =>
        {
 
            transport.Read(read =>
                read.Url("/api/enquiries/departmentsummary)
                .DataType("json")
 
                .Type(HttpVerbs.Get)
                );
                            transport.Create(create =>
                create.Url(Base.APIHostAddress + "/api/enquiries/post")
                .DataType("json")
                .Type(HttpVerbs.Post)
                .ContentType("application/json; charset=utf-8")
 
                );
                        
                transport.ParameterMap("parameterMap");
        })
        )
)

 

Konstantin Dikov
Telerik team
 answered on 15 Nov 2018
1 answer
253 views

I have got a problem where my grid columns expect a detailed name ("CityFrom" and "CityTo" - those are strings), but a method returns "Name" property. How can I map the result to the columns without duplicating the code?

Here is grid:

@(Html.Kendo().Grid<RouteDto>()
.Name("route-grid")
.Columns(cfg =>
{
    cfg.Bound(m => m.CityFrom)
    .Title("City From")
    .Width(150)
    .Filterable(f =>
        f.Multi(true).DataSource(ds =>
            ds.Read(r =>
                r.Action("GetCities", "City")
            )
        )
    );
    cfg.Bound(m => m.CityTo)
    .Title("City To")
    .Width(150)
    .Filterable(f =>
        f.Multi(true).DataSource(ds =>
            ds.Read(r =>
                r.Action("GetCities", "City")
            )
        )
    );
}))

 

Here is method:

public ActionResult GetCities()
{
    var cities = _cityService.GetCities().Select(c => new { c.Name }).ToList();
    return Json(cities, JsonRequestBehavior.AllowGet);
}

Error I am getting is in console:

Uncaught ReferenceError: CityFrom is not defined
Uncaught ReferenceError: CityTo is not defined

 

On grid I could use .DataTextField("Name"), but I don't have this option here. Both filters have got the same set of values - cities from database. Any ideas what can I do elegantly here?

Georgi
Telerik team
 answered on 15 Nov 2018
3 answers
886 views

Hi,

I was wondering if there is a way to accomplish the toolbar functionality in a TreeList as shown for this example in a Grid: Grid / Toolbar template

We need a filtering textbox in the toolbar, that filters the items when the input has changed.

 In the pages with Grid's I use buttons with icons from Font Awesome in the Toolbar, in the TreeList I only seem to be able to add buttons via Custom:

 

.Toolbar(toolbar =>
    {
        toolbar.Custom().Name("addfieldbutton").Text("Veld toevoegen");
        toolbar.Custom().Name("addfolderbutton").Text("Folder toevoegen");
    })

 

It would be nice to keep the design the same when using a TreeList.

 Here's my Toolbar for a grid.

 

.ToolBar(toolbar =>
{
    toolbar.Template(
        @<text>
            @(Html.Kendo().Button()
                .Name("ButtonAddProperty")
                .HtmlAttributes(new { type = "k-button" })
                .Content("Property toevoegen")
                .SpriteCssClass("fa fa-plus")
                .Events(e => e.Click("onCreateProperty"))
            )
        </text>);
})

 

Best regards,

Ronald

 

Tsvetina
Telerik team
 answered on 14 Nov 2018
6 answers
264 views
Is there a way to apply a row template to the TreeList? I haven't seen anything in the examples for this. I am trying to convert a Grid to a TreeList, and I would like to reuse my RowTemplate functionality, if possible.

Thanks!
Jason
Konstantin Dikov
Telerik team
 answered on 14 Nov 2018
4 answers
1.0K+ views

Is there any way to disable date by both?  Such as to disable it by all Tuesdays and Thursdays in addition to by a list of specific dates recorded in the database?

I see it how to disable date picker by days of weeks or by a list of specific dates at the demo.   I found the example of the way to disable weekends and dates specified(holidays). But the not finding a solution for the case that I need it to be implemented.

Thank you.

Masa
Top achievements
Rank 1
 answered on 13 Nov 2018
8 answers
751 views

Hello,

My widgets just stopped working!  I am getting the error "Script5009 Kendo not defined".  It seems the browser does not know what to do with the widgets.  I am not getting any errors otherwise.

I am running version 2018 3.0727.

Should I rerun the ProgressControlPanelSetup_2018_3_0727.exe to reinstall?

Thanks for your help!

Carolyn

Marin Bratanov
Telerik team
 answered on 13 Nov 2018
3 answers
474 views

Hello,

I am trying to implement a dropdownlist in a grid popupedit, that select Users from Azure Active Directory. I access the Azure Active Directoty with the Graph Api, so that I always get only a part of the users in the controller to return to the dropdownlist.

The controller sends the data of the users as SelectListItems (Text: Lastname, Firstname; Value: E-Mail).

The selection of a user in a new record works fine and the email address is saved in the database.

But if I want to edit this record, the dropdownlist is empty, because the dropdownlist needs the value for "Text" the Lastname and Firstname.

Is it possible to insert a value for Text and Value in the DropDownList, when editing a record?

Joana
Telerik team
 answered on 13 Nov 2018
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
ComboBox
Upload
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
Dialog
MultiColumnComboBox
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
Security
ColorPicker
DateRangePicker
Wizard
Styling
Chat
DateInput
MediaPlayer
TileLayout
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
SmartPasteButton
PromptBox
SegmentedControl
LLM Kit
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?