Telerik Forums
UI for ASP.NET MVC Forum
15 answers
5.1K+ views
Hello, I am not sure if I have this right, but I have a grid with multiple records in it. I have added a checkbox to the grid so that the user can select the records they want to update.  What I want to happen is for selected records to be updated with a value selected in a combobox from the form. I have the checkboxes displaying fine on the grid with this line of code.

 columns.Template(@<checked>@Html.CheckBox("selected", new { id = @item.ID })</checked>).Title("Select");

the problem is when the update button is clicked I do not know how to iterate through the rows in the kendo grid from the controller and grab those records that will be updated .

I tried something like this but cant get it to work "Cannot convert type char....

foreach (GridRow<Bin_BudgetView> row in fc["kendoGrid"])

Can someone please give me a simple solution to iterate through a kendo grid from the controller and update those records that are checked?

Also If I wanted to check or uncheck all of the records in the grid how would I go about that?

thanks for your help

Paul
Rosen
Telerik team
 answered on 23 Oct 2014
1 answer
113 views
I have put together a simple app which include a few or the "out-of-the-box" index views. I would like to swap the table in these views for the Telerik grid.

I have the following action in the controller:

// GET: Assets
public ActionResult Index()
{
     
    var assets = db.Assets.Include(a => a.Equipment).Include(a => a.Owner).Include(a => a.ServiceCompany).Include(a => a.Site);
     
    return View(assets.ToList());
}

I have swapped out the table code and copied the following from the demo

@(Html.Kendo().Grid(Model)
    .Name("Grid")
    .Columns(columns =>
    {
        columns.Bound(p => p.Site).Title("Site").Width(130);
        columns.Bound(p => p.Location).Title("Location").Width(130);
        columns.Bound(p => p.Description).Title("Decriptopn").Width(130);
        columns.Bound(p => p.InstallDate).Title("Install Date").Width(130);
        columns.Bound(p => p.SerialNo).Title("Serial Number").Width(130);
    })
    .Pageable()
    .Sortable()
    .Scrollable(scr => scr.Height(430))
    .Filterable()
    .DataSource(dataSource => dataSource
        .Ajax()
        .PageSize(20)
        .ServerOperation(false)
     )
)


When I try to view the 

System.InvalidOperationException was unhandled by user code
  HResult=-2146233079
  Message=A circular reference was detected while serializing an object of type 'System.Data.Entity.DynamicProxies.Asset_ED2530D1AC046011EB9F014D634FE570012E36DD19818476965A4BF61659B91A'.
  Source=System.Web.Extensions
 
I changed the HTML helper line to

@(Html.Kendo().Grid<AMScan.Models.Asset>()

which then rendered the grid on the page without the exception however there was no data.

Can you please tell me what I am doing wrong.
Dimiter Madjarov
Telerik team
 answered on 23 Oct 2014
3 answers
407 views
Given the following data model:

     Product
          Id (int)
          Name (string)
          VapourPressure (double)
          Components (IEnumerable<Component>)

      Component
          Id (int)
          Name (string)

I want to create a grid using these that displays the data. In this case Name, VapourPressure, Components. The components should be displayed in a HTML list. Of course I want to be able to filter on the presence of 'components' in the Components.

My current code is attached.

I have got displaying the components working, although I needed a workaround because any '+' characters are stripped from the template parameter. If there is another way to do this I would like to hear it.

What I don't have working is the filtering on components. First of all the drop down doesn't work correctly because the options loaded from AJAX are not shown. If the dropdown is instantiated outside the grid everything works fine.  How do I get the dropdown working?
Alexander Popov
Telerik team
 answered on 23 Oct 2014
2 answers
238 views
For anybody who finds this problem, the fix is to add the following line to the bundleconfig.cs file:

bundles.IgnoreList.Ignore("*.unobtrusive-ajax.min.js", OptimizationMode.WhenDisabled);


This will prevent the unobtrusive ajax script from loading twice (i.e. the minified and non-minified) in debug mode, which is what causes the double postback.

Alternatively, just remove the non minified script from the project (this obviously has implications for debugging, if you're inclined to debug the scripts included in the project template).

Telerik - this ought to be included in your how-to guide.
Sebastian
Telerik team
 answered on 23 Oct 2014
1 answer
101 views
Hi all. I am testing the menu kendo framework and I am having a issue. In IE 11, late Firefox version and Safari, does not happen, only happens in Google Chrome.

With normal zoom (100%) the menu options seems to be good. But when I set the zoom to 125%, only in some menu items, the lefthand border disappear, even the option top border. It appears again when I set the zoom to 130% or less (120% e.g.).

It also happens when I restore down the window. I send an image with the behaviour.

Anyone had the same problem?
Dimo
Telerik team
 answered on 23 Oct 2014
3 answers
135 views
I am using UI for ASP.NET MVC Q2 2014.
In the attached project, I am using editor template "EventEditor". In this, I have 2 dropdown and 1 multiselect.
The dropdown is working correctly, however multiselect is NOT working. I do NOT get values in the kendogrid Update/Create (Insert methof of Events Controller). I just get count and the values in the list are null. I tried using int (for Id) and also string but nothing worked correctly.
I also have used .Data("Serialize") but no help..
Please solve my request at the earliest.

Thanks

Vladimir Iliev
Telerik team
 answered on 23 Oct 2014
6 answers
343 views
Hi,

I have one multiselect in cshtml page. When I click on button in cshtml page, I am showing Kendo Window. In kendo window, there is one more multi select and OK, Cancel buttons.

If user clicks on OK, I am calling controller and passing values of multiselect and doing the required operation.

I want to display the same values in multiselect in cshtml page. How can I do this ? Here is my code.

$("#okay").kendoButton({
            click: function () {               
                var rowID = $("#selectedValues").val();
                data = { 'rows': rowID };               
                $.ajax({
                    type: "POST",
                    url: "Rows" + window.location.search,
                    data: data,
                    traditional: true,
                    dataType: "json",
                    success: function (result) {                       
                        $("#Dialog").data("kendoWindow").close();
                        return true;
                    },
                    error: function () {
                        alert("An Error Occured. Please Cancel and Try Again!");
                        return false;
                    }
                });
            }
        });
Vladimir Iliev
Telerik team
 answered on 23 Oct 2014
1 answer
141 views
How do I set the initial position of the Window to be centred?

I have hooked up a click event on a button which calls the following JavaScript:

function clickViewJobLogImage()
{
    var win = $("#viewJobLogWindow").data("kendoWindow");
 
    win.title("Testing 123");
    win.refresh();
    win.center();
    win.open();
}

But if the user then drags the window to a new position and then clicks the button to open the window (in effect refresh it) then it jumps back to the centre!

Ideally I want the window to open initially centered but if the user has moved it to open in it's last position on subsequent calls to open it.
Alex Gyoshev
Telerik team
 answered on 22 Oct 2014
3 answers
121 views
Hi,

I am getting intellisense for the kendo ui grid when using razor code but when accessing the grid through jquery, I am not
getting any intellisense.

Thanks,
Annie
Alexander Popov
Telerik team
 answered on 22 Oct 2014
1 answer
230 views
Hi, I have the following window:

@(Html.Kendo().Window()
    .Name("viewJobLogWindow")
    .Title("Quote: QXXXX")
    .LoadContentFrom("ViewJobLogWindowsContent", "Quotes")
    .Draggable()
    .Resizable()
    .Width(640)
    .Height(480)
    .Actions(actions => actions.Pin().Minimize().Maximize().Close())
    .Visible(false)
)

But I only want to show the window and call the "ViewJobLogWindowsContent" action upon some other event such as a button click (or in this case an image click).

I call the following JavaScript function when the user clicks an image (acting as a link):

function clickViewJobLogImage()
{
    var win = $("#viewJobLogWindow").data("kendoWindow");
     
    win.center();
    win.open();
}

The window is not visible when the page first loads but the "ViewJobLogWindowsContent" action is called and when the user clicks the image it correctly shows the window but it does not call the action again?

I need the window to just be defined but not loaded and then only call the action to load the content when the JavaScript function is called.


Alex Gyoshev
Telerik team
 answered on 21 Oct 2014
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
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
ColorPicker
DateRangePicker
Wizard
Security
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
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?