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

So we've read the docs; done all the appropriate searching; yet cannot keep the listview from repeating calls to the create service.

According to the docs the listview datasource expects the item that was added to be returned.  Here is our server side controller method:

 

[HttpPost]
public ActionResult CreateMultiSelectItem([DataSourceRequest] DataSourceRequest request, long questionId, SurveyQuestionMultiSelectItem item)
{
    if (item != null && ModelState.IsValid)
    {
        var vm = new SurveyQuestionMultiSelectViewModel(_surveyQuestionService.GetById(questionId));
        vm.SurveyQuestionDetails.Items.Add(item);
        vm.UpdateRootSurveyQuestion(_surveyQuestionService);
    }
    return Json(new[] {item}.ToDataSourceResult(request, ModelState));
}

 

as you can see we are returning the exact item being created.

 

The Datasource setup for the listview is as such:

<div class="demo-section k-content wide">
    <a class="k-button k-button-icontext k-add-button" href="#"><span class="k-icon k-add"></span>Add new record</a>
    @(Html.Kendo().ListView<LMI.QMIMS.Business.SurveyQuestions.SurveyQuestionMultiSelectItem>()
          .Name("listView")
          .TagName("div")
          .ClientTemplateId("template")
          .DataSource(source=>source
              .Model(model=>
                    {
                        model.Id(p=>p.Id);
                        model.Field(p => p.Id).DefaultValue(Guid.NewGuid());
                    }
              )
              .Create(create=>create.Action("CreateMultiSelectItem","SurveyQuestion", new { questionId = Model.SurveyQuestionId }))
              .Read(read=>read.Action("ReadMultiSelectItem","SurveyQuestion",new { questionId = Model.SurveyQuestionId}))
              .Update(update=>update.Action("UpdateMultiSelectItem", "SurveyQuestion", new { questionId = Model.SurveyQuestionId }))
              .Destroy(destroy=>destroy.Action("DeleteMultiSelectItem", "SurveyQuestion",new { questionId = Model.SurveyQuestionId } ))
              .Events(events=>events.Error("onDataSourceError"))
          )
          .Pageable()
          .Editable()
          )
</div>

 

 

So am I missing something totally obvious?  I do this sort of behavior in the Grid control all day long without this issue.

 

-Scott Singleton

Vasil
Telerik team
 answered on 07 Feb 2017
2 answers
541 views
I always have a heck of a time trying to find the right CSS style to override for things... Right now, I need to change the height of the Edit button in the grid... I hate all that extra spacing and want to make it slimmer so my rows in my grid look good, without all that additional padding...  How can I do this?
Joe
Top achievements
Rank 1
 answered on 07 Feb 2017
2 answers
157 views

Hello,

I want to have the "k-hierarchy-cell" smaller then the Standard (see Pictures) - how to do this?

robert

Robert Madrian
Top achievements
Rank 1
Veteran
Iron
 answered on 07 Feb 2017
3 answers
152 views

As you can see in the attached image, there's a weird issue where the "editable" part of the cell doesn't align with the part of a row or cell that's highlighted.

So clicking on a cell to edit the value requires that you click on the "upper" part of the cell, and is very confusing and unusable.

I have a pretty default configuration:

@Html.Kendo().Spreadsheet().Name("TestSpreadsheet")

 

Thoughts?

Thanks!

 

Duke
Top achievements
Rank 1
 answered on 06 Feb 2017
5 answers
276 views

We are currently updating an application to use MVC 6 with the current set of beta release from Telerik with the MVC wrappers.We are running into one sticking point that the demos do not address and I cannot find anywhere in the docs where it does either.

On out pages we have multiple grids with custom toolbars deployed using the common syntax

       .ToolBar(toolbar =>
        {
            toolbar.Template(
                @<text>
                   //Bunch of code remove for brevity
                </text>);
        })

 

However, this throws an error and upon further inspection the toolbar.Template method doesn't exist. We did find ClientTemplate but we cannot seem to get this to work. How are we supposed to implement a custom toolbar now? We saw that there may be a way in which we could specify a ViewComponent but it was not very clear.

If you could provide us an example this would go a long way to us getting this out the door.. So far all of the other controls seem to be working no problem.

 

Thanks,
AJ

 

​


 
 
Rosen
Telerik team
 answered on 06 Feb 2017
15 answers
3.6K+ views
Hello!

I have a set of views to edit a model similar to this:

Person
ID
Name
Contacts -> List of Contact

Contact
ID
Description
Address
Email
PhoneNumber

I would very much like to use a KendoUI grid for CRUDing the Person's Contact list (mainly because of layout and styling purposes). That I said, How can I achieve this? I need to make the grid bound to that property of the Person being edited or created as is. I mean, I would like to have only one controller (let's say PersonController) that knows how to persist my Person.

Is this possible? Having a grid without controller actions ? Has anyone been in the same situation also?

Thanks!

Eyup
Telerik team
 answered on 06 Feb 2017
1 answer
198 views
How can I adjust a RangeSlider's Min and Max after the control has already been created (i.e. via javascript)?
Magdalena
Telerik team
 answered on 06 Feb 2017
1 answer
306 views
So obviously ServerFiltering, if true filters the data on the server side instead of the client side, but what is the real difference?  Is it a performance thing? Ideally I'm dealing with a small data set but I dont see any real difference with it true or false...
Ivan Danchev
Telerik team
 answered on 06 Feb 2017
1 answer
1.0K+ views

 

I would like to display data in a popup window or tooltip when users hover over or click on a cell in the Telerik grid. I tried using the Telerik tooltip, however the tooltip doesn't display at all. I also tried the jquery and bootstrap tooltips, but they do not work as well. When I use the tooltips for an element outside of the grid, they work fine. Does anyone have a razor example for using the Telerik tooltip in a grid?  Also, are there other ways to approach this? Essentially, I want to display a small popup window with a table of additional information related to one specific cell in each row of the table.

Marin Bratanov
Telerik team
 answered on 03 Feb 2017
1 answer
304 views

Hi There,

 

I have a situation where I will have to do many same pages with the same Grid columns and functionality, but it will have a bit different dataSource I will have to read from the backend controller. Is there a way I can template the Grid itself and reuse it but be able to switch the dataSource?

 

For example.

 

@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.CustomerViewModel>()
    .Name("grid")
    .Columns(columns =>
    {
        columns.Bound(c => c.ContactName).ClientTemplate(
                @"<div class='customer-photo'
                    style='background-image: url(../content/web/Customers/#:data.CustomerID#.jpg);'></div>
                <div class='customer-name'>#: ContactName #</div>")
          .Width(240);
        columns.Bound(c => c.ContactTitle);
        columns.Bound(c => c.CompanyName);
        columns.Bound(c => c.Country).Width(150);
    })
    .HtmlAttributes(new { style = "height: 550px;" })
    .Scrollable()
    .Groupable()
    .Sortable()
    .Pageable(pageable => pageable
        .Refresh(true)
        .PageSizes(true)
        .ButtonCount(5))
    .DataSource(dataSource => dataSource
        .Ajax()
        .Read(read => read.Action("Customers_Read", "Grid"))
        .PageSize(20)
    )
)

 

 

I want the

 

.DataSource(dataSource => dataSource
    .Ajax()
    .Read(read => read.Action("Customers_Read", "Grid"))
    .PageSize(20)
)

 

Customers_Read to be switched to OldCustomers_Read

or NewCustomers_Read

or CustomersEtc_Read

But I don't want to copy everything of the Grid over and over. 

How can I do this?

 

Thank You

Konstantin Dikov
Telerik team
 answered on 03 Feb 2017
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
DropDownButton
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
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
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?