Telerik Forums
UI for ASP.NET MVC Forum
5 answers
2.3K+ views

Hello everybody. I have a question. As I can run a tooltip in the following code grid? the idea is to show me where I positioned the field.
Thank you!

@(Html.Kendo().Grid<ControlGAS.DataAccess.Entities.Customer>()
    .Name("GridCustomers")
        .Columns(columns =>
        {
            columns.Bound(customer => customer.Id).Title("ID").Filterable(f => f.UI("filterById")).HtmlAttributes(new { @style = "white-space: nowrap;"});
            columns.Bound(customer => customer.Denomination).Title("Nombre").Filterable(f => f.UI("filterByName")).HtmlAttributes(new { @style = "white-space: nowrap;"});
            columns.Bound(customer => customer.Code).Title("Codigo").Filterable(f => f.UI("filterByCode")).HtmlAttributes(new { @style = "white-space: nowrap;"});
            columns.Bound(customer => customer.Address).Title("Direccion").Filterable(f => f.UI("filterByAddress")).HtmlAttributes(new { @style = "white-space: nowrap;"});
            columns.Bound(customer => customer.City).Title("Ciudad").Filterable(f => f.UI("filterByCity")).HtmlAttributes(new { @style = "white-space: nowrap;"});
            columns.Bound(customer => customer.FiscalIdentification).Title("Identificacion Fiscal").Filterable(f => f.UI("filterByFiscalId")).HtmlAttributes(new { @style = "white-space: nowrap;"});
            columns.Template(customer => { }).ClientTemplate(
                "<a href=" + quote + @Url.Action("Editing", "Customer", new { customerId = "#=Id#" }) + quote + "><i class='font-size-20 icon md-edit margin-right-10' aria-hidden='true'></i></a>" + "" +
                "<a href=" + quote + @Url.Action("Editing", "Customer", new { customerId = "#=Id#" }) + quote + "><i class='font-size-20 icon md-delete margin-right-10' aria-hidden='true'></i></a>")
                .Title("Actions").Width(100);
 
        })
        .Scrollable()
        .Sortable()
        .Groupable()
        .Pageable()
        .DataSource(
            dataSource => dataSource
            .Ajax()
            .Read(read => read.Action("GetCustomers", "Customer"))
        )
         
        .Reorderable(r => r.Columns(true))
        .ClientDetailTemplateId("master")
        .Filterable(filter => filter.Mode(GridFilterMode.Row)
              .Extra(false)
              .Operators(operators => operators
                  .ForString(str => str.Clear()
                      .StartsWith("Empieza con")
                      .IsEqualTo("Igual a")
                      .IsNotEqualTo("No es igual a")
 
                 )
                 .ForNumber(num => num.Clear()
                      .IsEqualTo("Es igual a")
                      .IsNotEqualTo("Distindo de")
                      .IsNull("Vacio")
                      .IsLessThan("Menor a")
                      .IsGreaterThan("Mayor a"))
            )
        )
        .Events(events => events.DataBound("dataBound"))
)

Ianko
Telerik team
 answered on 04 Sep 2017
2 answers
408 views

Hi, currently I am doing the following to get some tooltip information on a grid row:

$("#gridPop").kendoTooltip({
                filter: 'td:nth-child(10)',
                content: function (e) {
                    var template = kendo.template($("#myToolTipTemplate").html());
                    var dataItem = $("#grid").data("kendoGrid").dataItem(e.target.closest("tr"));
                    var tooltipHtml;
                    $.ajax({
                        url: DetailsURL + "/" + dataItem.Id,
                        async: false
                    }).done(function (data) {   // data is a JSON object from the server with details for the row
                        if (data.Success) {
                            data.Result = data.Result.replace(/null/g, "\"N/A\"");
                            tooltipHtml = template($.parseJSON(data.Result));
                        } else {
                            tooltipHtml = "Ooops!<br>Something went wrong (" + data.Result + ")";
                        }
                    });
                    return tooltipHtml;
                }
            });

 

I would like to get rid of the synchronous ajax call and make it asynchronous. I saw some asynchronous examples where the server delivers the full html, but nothing that works with JSON data from the server, that is then "compiled" via a kendo.template() to html on the client. Any suggestions how to do this?

Caecilia
Top achievements
Rank 1
 answered on 01 Sep 2017
2 answers
410 views

Kendo updated with our last Sitefinity update, and previous to now it always stored the selected item in the list to the MVVM model.  However in the current version it seems to just store literally as the string "[Object, object]"

I've tried setting data-value-primitive to true\false, no change either way.

 

<select class="schedules form-control"
                                 data-bind="source: schedule, value: location.schedule, events: { change: onScheduleChange }, visible: hasScheduleItems"
                                 data-text-field="StartDateFormatted"
                                 data-value-primitive="false"
                                 data-role="dropdownlist"
                                 data-option-label="Select a schedule entry"
                                 style="width: 100%; max-width: 300px">
                            </select>
sitefinitysteve
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 31 Aug 2017
7 answers
2.4K+ views

I have a Kendo Grid with drop-down lists for in-line update.When i am in edit mode, the drop-down list text fields are displayed. But after i save, the value of the selected items are displayed in the grid instead of the text fields. I am using EditorTemplateName for displaying the drop-down lists in the grid.Can you please help me find what is wrong and help me correct this issue.

I have uploaded a copy of the code and 2 images. Thanks for the help

Chinonso
Top achievements
Rank 1
 answered on 30 Aug 2017
1 answer
229 views

I have a scheduler built with MVC and I would like for the events to be filtered by multiple fields. I am having difficulty in setting the filter logic along with the operators in the javascript.

Is there a way to filter by multiple values on a button click event?

Here are my selections:

<div id="tutors-listing">
    Tutors
    <div id="tutors">
        Adalhi<input type="checkbox" id="alex" aria-label="Alex" value="3">
        Annik<input type="checkbox" id="bob" aria-label="Bob" value="4">
        Bobby<input type="checkbox" id="charlie" aria-label="Charlie" value="5">
    </div>
</div>
 
<div id="subjects-listing">
    Subjects
    <div id="subjects">
        AES<input type="checkbox" id="1" value="AES">
        NURS<input type="checkbox" id="2" value="NURS">
        ENG<input type="checkbox" id="3" value="ENG">
        MED<input type="checkbox" id="4" value="MED">
    </div>
    <button type="button" id="filter">Filter</button>
</div>

 

And here is my javascript. I am having issues getting the classesChecked value to show:

<script type="text/javascript">
    $(function () {
        $("#filter").click(function () {
 
            var tutorsChecked = $.map($("#tutors :checked"), function (checkbox) {
                return parseInt($(checkbox).val());
                 
            });
 
            alert(tutorsChecked);
             
            var filter = {
                logic: "or",
                filters: [
                    {
                        logic: "and",
                        filters: [
                            { field: "SUBJECT", operator: "eq", value: classesChecked }
                        ]
                    },
                    {
                        logic: "and",
                        filters: [
                            { field: "TutorID", operator: "gt", value: tutorsChecked }
                        ]
                    }
                ]
 
            };
 
            var scheduler = $("#scheduler").data("kendoScheduler");
 
            scheduler.dataSource.filter(filter);
        });
    })
</script>

 

Is there a better method to filter these values and how can I see the multiple value selections? Thanks in advance.

Plamen
Telerik team
 answered on 29 Aug 2017
3 answers
372 views

Looking at this thread, it appears its possible to use the image browser without it being inside an editor. http://www.telerik.com/forums/why-not-make-image-browser-in-editor-as-separate-controle

Can you provide me with the syntax to initialize an image browser on its own without an editor in MVC? I've tried the following, but get an error.

1.@(Html.Kendo().ImageBrowser(
2.      .Image("~/UploadedPhotos/{0}")
3.      .Read("ImageBrowser_Read", "Home", new { storyID = "#=StoryID#" })
4.      .Create("ImageBrowser_Create", "Home")
5.      .Destroy("ImageBrowser_Destroy", "Home")
6.      .Upload("ImageBrowser_Upload", "Home", new { storyID = "#=StoryID#" })
7.      .Thumbnail("ImageBrowser_Thumbnail", "Home")
8.))
Dimitar
Telerik team
 answered on 29 Aug 2017
3 answers
339 views

Hi,

I have a list of objects in my model

   public class SoftwareItemPropertiesViewModel
    {
....
        public List<Annotation> Annotations { get; set; } = new List<Annotation>();
....

 

that I render to multiple multiselect like so:

for (var i = 0; i < Model.Annotations.Count; i++)
      {
 
          <div class="form-group">               
              @Html.Label(Model.Annotations[i].Name)
              <div class="col-sm-10">
                  @(Html.Kendo().MultiSelectFor(m => m.Annotations[i].SelectedOptions)
                        .DataTextField("Name")
                        .DataValueField("Value")
                        .BindTo(Model.Annotations[i].Options)
                        .Placeholder(Model.Annotations[i].Placeholder)
                        )                   
              </div>
          </div>
 
      }

 

On post of the form, I can see that the selected data is there as as expected in Annotations[0].SelectedOptions:

Annotations%5B0%5D.SelectedOptions: 4
Annotations%5B0%5D.SelectedOptions: 5
Cost: 515
Description: adfasdf
Guid: 40f339ed-b1e8-4a46-a987-8d5d79ec0be0
Name: abcasdfsadf
OwnerNotes:
SelectedOwners: 1
SelectedOwners: 2
Version:

 

However, the selected Values are not populated back in the Model object that I receive.

Annotations List is populated with 1 Annotation as expected, but Annotations[0].SelectedOptions is not populated.

There is another Multiselect directly bound to the model and here I see Selected values in the model as expected.

What am I missing?

Regards Erwin

 

erwin
Top achievements
Rank 1
Veteran
Iron
 answered on 29 Aug 2017
1 answer
275 views

Hi,
I'm using a kendo grid inside a bootstrap popup, and i need to select some rows. In kendo grid i use the properties "columns.Select().Width(50);" and ".PersistSelection()", when selected one row in the first page all works fine, but when i change the page, all rows in all pages are selected automatically.

¿How can i select only some rows in differents pages?

Georgi
Telerik team
 answered on 29 Aug 2017
7 answers
2.0K+ views
Basically, I am looking for the MVC version of this demo:

http://demos.telerik.com/kendo-ui/grid/filter-menu-customization

.Columns(columns =>
        {
            columns.Bound(e => e.ID)
                .Hidden();
            columns.Bound(e => e.SearchFunctionCode)
                .Hidden();
            columns.Bound(e => e.SearchFunctionDesc)                
                .Title("Search Function")
                .Filterable( *** WHAT GOES HERE? *** )
                .HtmlAttributes(new { style = "text-align: center" })
                .HeaderHtmlAttributes(new { style = "text-align: center" });


Do I still reference the javascript?

<script type="text/javascript">
    function SearchFunctionFilter(element) {
        element.kendoDropDownList({
            dataSource: searchfunctions(),
            optionLabel: "--Select Value--"
        });
    }
</script>
Stefan
Telerik team
 answered on 29 Aug 2017
4 answers
390 views

Hi,

I have a grid with 2 fields that are connected so a cascade filter needs to be done on them. I manage to do this using Server binding because the UI was refreshed when a filter was done. But now I have to use Ajax binding but the cascade code does not work anymore because the UI is no longer called again

@(Html.Kendo().Grid<TelerikTestModel>()
            .Name("grid2")
            .Columns(columns =>
            {
                columns.Bound(product => product.MainField).UI("mainFilter"));
                columns.Bound(product => product.DependentField).UI("subFilter"));
            })
            //                                   .Server()
            .DataSource(dataSource => dataSource.Ajax().PageSize(10).Read(read => read.Action("Data_Read", "Home")))
            .HtmlAttributes(new { style = "height: 550px;", @class = "myClass" })
            .Pageable(x => x.ButtonCount(5))
            .Sortable()
            .Filterable()
            .Scrollable()
            //.ColumnMenu()
            .Resizable(resize => resize.Columns(true))
            .Reorderable(reorder => reorder.Columns(true))
            .Events(e => e.FilterMenuInit("filterMenuInit"))
)


function mainFilter(element) {
        element.kendoDropDownList({
            dataSource: {
                transport: {
                    read: "@Url.Action("FilterMenuCustomization_MainFilter")"
                }
            },
            optionLabel: "--Select Value--",
            name: "mainFilter",
        });
    }
 
    function subFilter(element) {
 
        var dataSource = $("#grid").data("kendoGrid").dataSource;
 
        var filter = dataSource.filter();
 
        var value = -1
        if (filter && filter.filters) {
            var result = $.grep(filter.filters, function (e) {
                return e.field == "MainField";
            });
 
            if (result.length == 1) {
                value = result[0].value;
            }
        }
 
        element.kendoDropDownList({
            dataSource: {
                transport: {
                    read: {
                        url: "@Url.Action("FilterMenuCustomization_SubFilter")",
                        dataType: "json",
                        data: {
                            mainFilter: value,
                        }
                    }
                }
            },
            optionLabel: "--Select Value--",
            name: "subFilter",
        });
    }

Two questions:
1. in subFilter is there a way to get to the grid datasource without using the grid id? I need to make this code be used by any grid that has a dependent list
2. for the Ajax-binding I was thinking to use the onFiltering event but how can I get to the filter control (to do the subFilter code)? On a page with 2 grids and the same dependent cascade filters I could not find a connection between the grid and the filter controls.

Alexandra
Top achievements
Rank 1
 answered on 28 Aug 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?