Telerik Forums
UI for ASP.NET MVC Forum
4 answers
254 views

I have a Grid and was wondering if there is a way to use the standard CRUD screens from the MVC application.  The reason for this is I have the screens and I like using them as I have them already.  I wanted to use inline editing but I never could get a way to get the drop down list to show up correctly.  If not, is there an easy way to being up an Edit and Create Screen?  I just want an easy way edit (and also create) a record.

 

Thanks for any help.

Christine
Top achievements
Rank 1
Veteran
 answered on 14 May 2020
5 answers
536 views

Hello,

I currently have an ASP.NET MVC application that is primarily composed of a hierarchical grid and custom edit templates. I want to display a simple error page to indicate a failed database operation to the user.

I tried a standard approach adding the following to the Web.Config file: 

<customErrors mode="On"></customErrors>

I also added the following attribute at the beginning of my controller classes:

[HandleError(ExceptionType = typeof(DbUpdateException), View = "Error")]

The error page, Error.cshtml is located in the Views/Shared directory of the application.

I cannot get this to work. I can't even view the error page in the browser. I get a 404 error when I right click on the file and select view in browser.

Are there any general error handling guidelines for Telerik UI for ASP.NET MVC? I looked, but couldn't find anything fairly recent. If any such guidelines / documentation exists, where would I find it?

Thanks

Ianko
Telerik team
 answered on 14 May 2020
1 answer
404 views

I have a treeView with multiple hierarchy, and only leaf/last node should have checkbox, not any parent should have checkbox.

I have refered many threads and examples. Tried Checkboxes Template but that makes another issue that values did not get binded with checkbox.
I need treeview like (https://jsbin.com/edamuj/131/edit?html,output)

 

 

@(Html.Kendo().TreeView()
                                .Name("treeview")
                                .Events(e => e.Select("OnSelectTree").DataBound("OnDataBound")).ExpandAll(true)
                                .Checkboxes(checkboxes => checkboxesName("checkedFiles"))
                                .BindTo((List<DPS.Model.ReviewDocumentTreeViewItemModel>)ViewBag.DocumentTreeData, (Kendo.Mvc.UI.Fluent.NavigationBindingFactory<TreeViewItem> mappings) =>
                                {
                                    mappings.For<DPS.Model.ReviewDocumentTreeViewItemModel>(binding => binding.ItemDataBound((item, category) =>
                                    {
                                        item.Id = category.Id;
                                        item.Text = category.Name;
                                        item.Selected = category.IsSelected;
                                        item.HtmlAttributes.Add("data-allowselection", category.AllowSelection);
                                        item.Expanded = true;
                                        item.Checked = category.IsReviewed;
                                    }).Children(g => g.Items));
                                }))


Aleksandar
Telerik team
 answered on 14 May 2020
1 answer
1.2K+ views

Hello EveryOne,

I'm trying to change the dataSource of a MultiSelect widget.

This is my MultiSelect (in my CustomEditor):

@(Html.Kendo().MultiSelectFor(model => model.Person)
                         //.Name("FirmaAutoSelect")
                         .DataTextField("Name")
                         .MaxSelectedItems(1)
                         .AutoWidth(true)
                         .HtmlAttributes(new { style = "width:100%" })
                         .Events(eve =>
                         {
                             eve.Open("onOpen_Person");
                         })
                         //.ValuePrimitive(true)
                         .DataSource(source =>
                         {
                             source.Custom()
                             //.ServerFiltering(true)
                             .Type("aspnetmvc-ajax")
                             .Transport(transport =>
                             {
                                 transport.Read("Read_Personen", "Person");
                             })
                             .Schema(schema =>
                             {
                                 schema.Data("Data")
                                         .Total("Total")
                                         .Errors("Errors");
                             });
                         })
                    )

 

and i tried in the onOpen_Person function this code :

var person_mult = $("#Person").data("kendoMultiSelect");
                    var dataSource = new kendo.data.DataSource({
                        //batch: true,
                        transport: {
                            read: {
                                url: "/Person/AlleOderFirma_Personen",
                                dataType: "json"                           
                            },
                    //    }
                    //});
                            parameterMap: function (options, operation) {
                                if (operation !== "read" && options.models) {
                                    return { models: kendo.stringify(options.models) };
                                }
                            }
                        },
                        schema: {
                            model: {
                                id: "Sid_personen",
                                fields: {
                                    Sid_personen: { from: "Sid_personen" }
                                }
                            }
                        }
                    });
                    person_mult.setDataSource(dataSource);

 

Now this shows just one item and it's undefined !!

I console.Logged the dataSource and i saw that the "Sid_personen" is undefined .. but in "_data" i found all the items i need .. but it doesn't show them ..

in the attached picture you can see the consoleLogged DataSource.

and this is my ActionMethod:

public ActionResult AlleOderFirma_Personen([DataSourceRequest]DataSourceRequest request)
{
    //string g = Id_Firma;
    using (var db = new cRM_FM_v2_KARAMEntities())
    {
        IQueryable newQuery = db.PERSONEN.ToList().Select(prs => new PersonViewModel()
        {
            Sid_personen = prs.SID_PERSONEN,
            Name = prs.NAME,
            Vorname = prs.VORNAME,
            Recid_firmen = prs.RECID_FIRMEN,
            Crmusername = prs.CRMUSERNAME
        }).AsQueryable();
        return Json(newQuery.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
    }
}
Martin
Telerik team
 answered on 14 May 2020
4 answers
1.0K+ views

Hello,

I'm using a dropdown list to display a list of campaigns for a user to choose from. The dropdown list is part of a custom editor template for adding/editing donations. The campaigns are stored in a separate table, that has no cardinal relationship with the underlying donations table used by the template. In this  use case scenario, the campaign table is being used as a lookup. The donation table simply stores the campaign name, nothing else is required beyond that, so no relationship is required.

The campaigns are being stored in a separate table because campaigns are often edited, added, or deleted independent of the rest of the application. There are also too many of them to either hard code or include in the markup.

For some reason, I'm not able to retrieve the data from the campaign table, something I thought would be pretty straightforward.

I'm including a .zip file containing the following relevant files:

Models

Donation.cs 

Campaign.cs 

Controllers

DonationsController.cs

CampaignController.cs

 

Custom Editor Template

DonationTemplate.cshtml

 

I'm not sure what I've done wrong here. This seems like it should pretty straightforward. Any advice/feedback would be very much appreciated.

 

Thank you!

 

 

 

Marcab
Top achievements
Rank 1
Veteran
 answered on 13 May 2020
2 answers
619 views

 

I have a Grid with the search and filters enabled.  I have placed the sprite files where they are supposed to go and still the buttons do not come up.  What do I have to do to get the filter and search buttons to display?  Is there a guide somewhere that explains what I need to do?  I need for these buttons to display.
Christine
Top achievements
Rank 1
Veteran
 answered on 13 May 2020
6 answers
3.0K+ views
I have a form which will input a date time range and it will return a list of object, I want that list of object to be the datasource of my multi select, how do I do that? I am using asp. net mvc, what is the best approach? I am using jquery and ajax for my api calls.
Misho
Telerik team
 answered on 13 May 2020
3 answers
690 views
Hi, is there an example somewhere of how to draw a shape on the map?
Alex Hajigeorgieva
Telerik team
 answered on 12 May 2020
4 answers
205 views
Is it possible to draw shapes on the map with a mouse?  I do not see mouse events exposed for the map or shape layer.
Viktor Tachev
Telerik team
 answered on 12 May 2020
1 answer
63 views

Bom dia, eu tenho uma grid dentro de um popup, esse popup recebe uma model com 5 propriedades e uma lista "opcoes". Eu gostaria de saber como populo essa grid com essa lista da model. Tentei conforme o codigo abaixo, mas sem sucesso.

 

        @(Html.Kendo().Grid<Entidades.OpcaoPerguntas>(Model.Opcoes)
            .Name("gridOpcao")
            .Columns(columns =>
            {
                columns.Bound(o => o.CodigoOpcao).Visible(false);
                columns.Bound(o => o.Ordem).Visible(false);
                columns.Bound(o => o.DescricaoOpcao).Title("Descrição da Opção");
                columns.Bound(o => o.DescricaoDivisor).Title("Divisor");
                columns.Bound(o => o.DescricaoTipoOpcao).Title("Tipo de Opção");
                columns.Bound(o => o.Meta);
                columns.Bound(o => o.Pontos);
            })
            .Sortable()
            .DataSource(dataSource => dataSource
                .Ajax()
                .Batch(true)
                .ServerOperation(false)
                .Model(m => m.Id(i => i.CodigoOpcao))
)

            )

Nikolay
Telerik team
 answered on 12 May 2020
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
Upload
ComboBox
MultiSelect
Window
ListView
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
Rating
ScrollView
ButtonGroup
CheckBoxGroup
Licensing
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
AICodingAssistant
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
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?