Telerik Forums
UI for ASP.NET MVC Forum
2 answers
296 views
@(Html.Kendo().Grid<SearchViewModel>()
    .Name("searchGrid")
    .Columns(columns =>
    {
      columns.Bound(x => x.ProductId);
      columns.Bound(x => x.ProductName);
    })
    .AutoBind(false)
    .DataSource(ds => ds
      .Ajax()
      .Read(read => read.Action("Search", "Product").Data("getSearchCriteria"))
      )
    )
)
function getSearchCriteria() {
  var product = $("#ProductName").data("kendoAutoComplete").value();
  var productType = $("#ProductType").data("kendoDropDownList").select();
 
  if (product || productType) {
    return { ProductName: product, ProductType: productType };
  } else {
    // TODO: Figure out how to cancel this request.
    alert("You must provide at least one search parameter.");
    return false;
  }
}
I have a Kendo grid that I'm using to display search results on an MVC page. I'm using a function called "getSearchCriteria" to gather the search criteria from the page so it can all be sent to the controller's search method.

Everything works great when search criteria is supplied. However, I can't find a way to cancel the request from the client side if no search criteria was supplied. Returning either "false" or "null" from the "getSearchCriteria" function has no effect.

Is there any way to tell the Kendo grid not to invoke the controller's action at this point in time?
ImNotTed
Top achievements
Rank 1
Iron
 answered on 13 Dec 2013
8 answers
376 views
I am using the MVC wrapper and I'm able to get all working except the Destroy option, it never fires the AJAX post like the example.  The only difference between my setup and the example  is that I am using Azure Blob as my image storage.  Read, Upload and Thumbnails work great.  Below is my current code.

Also, I am not able to have the 2 scripts listed below included on the same page.  This creates problem number 2 for me. I canot get the grid to sort and filter without the "kendo.aspnetmvc.min.js" script. When I do included this feature work for the grid but then it breaks my editor.

Please remember that this page is a test page only.  Thanks in advance for your help.  - Shawn


@using Kendo.Mvc.UI;
@{
    Layout = "";
    ViewBag.Title = "Test_KendoUI";
    AcctInfo acctInfo = (AcctInfo)Session["AcctInfo"];
}
<link rel="stylesheet" href="@Url.AzureCdnContent("~/Content/KendoUI/2013.3.1119/kendo.common.min.css")" />
<link rel="stylesheet" href="@Url.AzureCdnContent("~/Content/KendoUI/2013.3.1119/kendo.default.min.css")" />

<script src="@Url.AzureCdnContent("~/Scripts/KendoUI/2013.3.1119/jquery.min.js")"></script>
@* Need below script for Editor ImageBrowser to work properly *@
<script src="@Url.AzureCdnContent("~/Scripts/KendoUI/2013.3.1119/kendo.web.min.js")"></script>    
@* Need below script for GRID to Work properly BUT CANNOT have both scripts. When the below script is included the imagebrowser loads "Undefined" folders as the images when opened.
<script src="@Url.AzureCdnContent("~/Scripts/KendoUI/2013.3.1119/kendo.aspnetmvc.min.js")"></script>
*@

<h2>Test_KendoUI</h2>


@(
    Html.Kendo().Editor()
        .Name("EmailMessage")
        .HtmlAttributes(new { style = "width: 740px;height:440px" })
        .Tools(tools => tools
            .Clear()
            .Bold().Italic().Underline().Strikethrough()
            .JustifyLeft().JustifyCenter().JustifyRight().JustifyFull()
            .InsertUnorderedList().InsertOrderedList()
            .Outdent().Indent()
            .CreateLink().Unlink()
            .InsertImage()
            .SubScript()
            .SuperScript()
            .TableEditing()
            .ViewHtml()
            .Formatting()
            .FontName()
            .FontSize()
            .FontColor().BackColor()
        )
        .Value("")
        .ImageBrowser(imageBrowser => imageBrowser
        .Image("http://pas.blob.core.windows.net/users/" + @acctInfo.accountOwnerUserID + "/files/Images/{0}") // image location URL              
        .Read("_getImages", "Common") // get files
        .Create("_createDir", "Common") // create folder/directory
        .Destroy("_deleteImage", "Common") // delete file or folder
        .Upload("_uploadImage", "Common")  // add new file
        .Thumbnail("_getThumbnailImages", "Common")  
        .FileTypes("*.jpg,*.png,*.gif,*.jpeg,*.bmp")               
        )
)


Shawn
Top achievements
Rank 1
 answered on 13 Dec 2013
1 answer
131 views
Hello,
is it possible to align time horizontally?
Something like here in aspnet-ajax?
http://www.telerik.com/community/forums/aspnet-ajax/scheduler/align-time-horizontally-in-week-view.aspx
thanks it would help me a lot...
Dimo
Telerik team
 answered on 13 Dec 2013
1 answer
274 views
I have found numerous Google threads on this, but absolutely nothing works.  I just want to open a window to a maximum 80% the browser height.  That's it.  I don't want to specify a size in pixels.  That doesn't do any good for multiple devices.

So the height should be auto sized, but up to a max size of 80% the browser window at the time of when the kendo window opened.  Is this not possible?
Dimo
Telerik team
 answered on 13 Dec 2013
2 answers
2.1K+ views
I have created a window as below.  How do I open this window from a button click?  I have set visible to false so it doesn't show at start up.  How do I then show this window from a button?

@(Html.Kendo().Window()
.Name("kendoWindow") //The name of the window is mandatory. It specifies the "id" attribute of the widget.
.Title("Login") //set the title of the window
.Content(@<text>
This is my window.
</text>)
.Draggable() //Enable dragging of the window
.Resizable() //Enable resizing of the window
.Width(600) //Set width of the window
.Modal(true)
.Visible(true)
)

Greg
Greg Gum
Top achievements
Rank 1
 answered on 12 Dec 2013
1 answer
248 views
Hi, 

In one of my projects I have to display a Popup window with a grid (it is binded to a remote data source), allow the user to select
multiple rows from any of the grid's pages and copy them to another grid datasource when the user hit a button.

I have almost succeed in the way:
  •  I'm able to display both grid
  • I have added a checkbox to each row to allow users to select rows
  • store the Ids of my selected rows in a json string 
  • restore selection when user move from one page to another
  • Get the list of selected Ids
The problem I have now is that I'm able to copy to the target datasource only the data items of the current page.
Herebelow is the javascript function I use to copy data item:

function moveTo(from, to) {
     
    for (var i in checkedIds) {
         
        var isFound = to.dataSource.get(checkedIds[i]);
        if (checkedIds[i] != "") {
            if (isFound == undefined) {
                // Set 'From' Datasource to the correct page
                var ItemIdx = i % from.dataSource.pageSize();
                var PageNb = ((i - (ItemIdx)) / from.dataSource.pageSize()) + 1;
 
                //alert("Item: " + ItemIdx + " Page: " + PageNb);
                from.dataSource.page(PageNb);
                var view = from.dataSource.view();
 
                var item = view[ItemIdx];
                to.dataSource.add(item);
            }
        }
    }
}

When copying item from a not displayed page, the item from the current page, with the same index is copied instead
Note that the ItemIdx and PageNb are correct, this was double checked.

what am I doing wrong ?


Dimo
Telerik team
 answered on 12 Dec 2013
1 answer
139 views
I have a window on my page:

@(Html.Kendo().Window()
    .Name("window")
    .Title("Add New Comment").LoadContentFrom("AddComment", "Comparisons", new { startDate = @ViewBag.startDate, endDate = @ViewBag.endDate })

    .Draggable()
    .Resizable()
    .Width(450).Height(500)
    .Position(settings => settings.Top(100).Left(100)).Visible(false).Modal(true).Iframe(true)
    .Actions(actions => actions.Close())
)

I open the window with a hyperlink, here is the binding:

        $("#addCommentLink").click(function () {
            $("#window").data("kendoWindow").refresh().open();
        });

I have a div that's not related at all to the window.

<div id='dummy'></div>

At some point I load the div with a partial render.

function ReloadCommentSection() {      
        $("#dummy").load('@Url.Action("CommentEventSection", new { startDate = @ViewBag.startDate, endDate = @ViewBag.endDate })');        
    }

Once that div is loaded, the window won't open any more.  I get an error that  $("#window").data("kendoWindow") is undefined.


What am I doing wrong?
Petur Subev
Telerik team
 answered on 12 Dec 2013
1 answer
244 views
I have a grid ( built with javascript not razor ).
I have aggregates running on several columns and they display fine in the footer of each group once a grouping is added.
if I minimise the group then that information is hidden so I would like to move all the aggregates in the header of each group so they are always visible even when the group is minimised.
The standard groupHeaderTemplate only applies when that particular column is added to a group. What I want is for the aggregates to show regardless of which column is added to the group.

Is this possible ?
Petur Subev
Telerik team
 answered on 12 Dec 2013
2 answers
356 views
Hi,

I was having a hard time in trying to figure out how to position the validation message of an editable cell. My problem is that once it appears it is blocking the cell itself.

Thanks in advance.
Daniel
Telerik team
 answered on 12 Dec 2013
1 answer
145 views
In trying to develop a website using the MVCwrappers I am having 2 issues related to the grid.
- When 2 mobile grids are on a page the bottom grid covers half of the top grid.
- I have a grid in a mobile tabstrip, but the grid will not display if the Mobile property is set to "PHONE". However, it does show up when set to "AUTO".
Arthur
Top achievements
Rank 1
 answered on 11 Dec 2013
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
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?