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

Hi,

I have a requirement like in a single grid there are 3 header section with common column field.

In each header section user needs to add new row to give input and save.

Please let me know can we design the above requirement with kendo grid?

Thanks in advance.

 

Angel Petrov
Telerik team
 answered on 28 Aug 2020
1 answer
565 views

Is there a difference between using "#=" and "#:" when blocking references in my column bindings?  They both seem to work for me, and I wanted to make sure one isn't preferred over the other for certain situations.  Thank you.

columns.Bound(prac => prac.PractitionerId).ClientTemplate("<input type='checkbox' name='chkPractitioner' value='#= PractitionerId #' onclick='handleProviderSelected(this,#= LocationId #)' />").Width(45).HeaderTemplate(" ");
Tsvetomir
Telerik team
 answered on 28 Aug 2020
2 answers
1.9K+ views

Hello All, 

I was doing some searching and I can't find how to do a Hyperlink to a file on my local computer/share drive in HTML.Kendo().Menu()

 

This is my code

@(Html.Kendo().Menu()
                .Name("Menu")
                .Direction(MenuDirection.Left)
                .Orientation(MenuOrientation.Vertical)
                .Scrollable(true)
                .Items(items =>
                {
                    items.Add().Text("Phone List").Url("file:///C:\Users\D\Desktop/Phone.pdf");
                    items.Add().Text("Pager List");

})

 

I'm trying to make so when a user clicks on my "Phone List" menu item, it then opens up a PDF with the relevant information in a new browser tab. I know the link works, because I can click it and it opens up the pdf in a browser. Any help would be appreciated. 

Dimitar
Telerik team
 answered on 27 Aug 2020
3 answers
1.6K+ views

I have a partial view, that generates a chart, which I need to embed in a Grids client detail template, so a chart will be generated for each record in the grid. 

It seems like it should work, but I can't pass the necessary id across to the controller of the partial view.

The client detail template is set up as:-

 

<script id="subdetailsTemplate" type="text/kendo-tmpl">
 
 @(Html.Kendo().TabStrip().Name("Tabstrip_#=ReportKey#")
         .Items(i =>
    {
      i.Add().Text("Activity Summaries").Selected(true).Content(@<text>
 
 
       @Html.Action("ReportCharts", "ServerChart", new { reportKey = "#=ReportKey#" })
 
 
    </text>);
 
 
    i.Add().Text("Execution History").Selected(false).Content(@<text>
 
 
    @(Html.Kendo().Grid<SSRSStats.Models.View_ReportExecutions>()
    .Name("ELGrid_#=ReportKey#")
    .Columns(columns =>
    {
        columns.Bound(o => o.LogEntryID).Title("ID");
        columns.Bound(o => o.ExecutionLogID).Title("ID");
        columns.Bound(o => o.UserName).Title("User");
        columns.Bound(o => o.RequestType).Title("Request");
        columns.Bound(o => o.TimeStart).Title("Time Start").Format("{0:g}");
        columns.Bound(o => o.TimeEnd).Title("Time End").Format("{0:g}");
        columns.Bound(o => o.TimeProcessing).Title("Processing").Format("{0:N0}");
        columns.Bound(o => o.TimeDataRetrieval).Title("Data Retrieval").Format("{0:N0}");
        columns.Bound(o => o.TimeRendering).Title("Rendering").Format("{0:N0}");
 
    })
    .ClientDetailTemplateId("subsubdetailsTemplate")
    .DataSource(dataSource => dataSource
    .Ajax()
    .PageSize(10)
    .Read(read => read.Action("RD_Executions", "ReportUsage", new { ReportKey = "#= ReportKey #" }))
    .Sort(s=>s.Add("LogEntryID").Descending())
    )
    .Pageable(p => p.Refresh(true))
 
    .ToClientTemplate()
 
        )
 
    </text>);
 
             })
 
    .ToClientTemplate()
    )
 
</script>

--

This works fine without the @Html.Action, line, with the sub grid being populated correctly.

However, when this code is run, an error is thrown saying 

The parameters dictionary contains a null entry for parameter 'reportKey' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult ReportCharts(Int32)' 

The controller is:-

public ActionResult ReportCharts(int reportKey)
       {
           ViewBag.rk = reportKey;
 
           ViewBag.ChartName = "Chart_RK_" + reportKey.ToString();
 
           ViewBag.ChartName2 = "Chart_RK2_" + reportKey.ToString();
 
 
           ViewBag.ChartTitle = "Report Activity for the Last 10 Days";
 
           ViewBag.ChartTitle2 = "Report Activity for the Last 12 Months";
 
 
           //var query = _repository.GetLast10DaysUsage(ReportKey);
 
           return PartialView();
       }

--

If the parameter is made nullable, the page runs, but the charts do not display (although ajax calls are made to the server with the correct ReportKey value, as well as the default value).

What do I need to do in order to make this work?

I'm using version 2020.2.617

Thanks

Eyup
Telerik team
 answered on 27 Aug 2020
2 answers
1.1K+ views

First time working with this control and not sure what I'm missing.

Code:

 

                        @(Html.Kendo().SwitchFor(model => model.IsEnabled)
                            .Messages(c => c.Checked("Enabled").Unchecked("Disabled"))
                            )

 

The switch shows up and works, but the true and false message labels do not appear.

 

Responsive
Top achievements
Rank 1
Veteran
 answered on 26 Aug 2020
1 answer
128 views

i try  show my image instead of the image icon. i use view and template but dont view image

Views(v=>v.List(l=>l.TemplateId("template")))

<script type="text/x-kendo-tmpl" id="template">
    <div class="product">
        <img src="@Url.Content("~/content/web/foods/")#:ProductID#.jpg" alt="#:ProductName# image" />
    </div>
</script>

 

Nencho
Telerik team
 answered on 26 Aug 2020
17 answers
1.7K+ views

Hi,

I need to change the default icon for the Kendo Grid when the filter is selected. Currently it displays the below icon by default. I have attached the screenshot of the current grid which we are using.

.k-i-more-vertical
Unicode: e031

So when the user adds a filter I need it to change to the below

k-i-filter-sm

Unicode: e12b

I need to do this in either my css file or any common javascript file. Please advise. Below is the current configuration which I am using.

Version: 2019.2.619.545 (Kendo Web Extensions for ASP.NET MVC)
MVC version: 5.0
IDE: Visual Studio 2015
Browser : Chrome  76.0.3809.100, IE 11.0
.Net Framework: 4.6.2
Programming Language: C#

Petar
Telerik team
 answered on 25 Aug 2020
4 answers
562 views
Hi, I'm wondering about a particular behavior with the Combobox.

I have a generic combobox (for people) in an editor template (basic code):
@model long?
@(Html.Kendo().ComboBoxFor(m => m)
 .DataTextField("DisplayName")
 .DataValueField("PersonId")
 .Filter(FilterType.Contains)
 .DataSource(
 source =>
 source.Read(read => read.Action("Search", "PersonController")
 .Data("getData")).ServerFiltering(true))
)


A little backstory about what I'm trying to do: I want to be able to use the combobox to load only partial data from the datasource (since all data can be too much). This is not a big deal if you just want to use the combo to search, but I also want to use it to show a single selected person (for example when editing a row in a grid, I want the combobox to load only the single person by id).

I thought I had a somewhat functional solution where I would use the combobox._initial field to see if the combobox should initially pull in the person by id. The "getData" function was similar to this:
var combo = $(selector).data('kendoComboBox');
 if (combo._initial != '' && !combo.hasLoadedInitial) {
  combo.hasLoadedInitial = true;
  return { id: combo._initial };
 }
  else
 return { text: combo.input.val() };

On the backend I would either load a single person by id, or search by text depending on what is passed.

When I use this in a MVC view (using HtmlHelper.EditorFor) it works fine, but when I use it in a grid (popup edit window) I am getting a different behavior. The _initial field value is not set to that of the grid dataItem; it is set to either 0 or blank depending on whether my property is nullable or not. It appears that the grid tries to setup the window editor form before binding the dataItem to it. So initially when the combobox tries to load data from the datasource, it can't know the id to pass.

How can I determine the PersonId in this case?
Ramez
Top achievements
Rank 1
 answered on 24 Aug 2020
7 answers
529 views
1. loading the existing Tabs

@helper RenderPCGTab(List<PCGTabModel> PCGs)
{
    <a id="add-button">Add new PCG</a>
    <div style="width:100%; height:auto;">
        @(Html.Kendo().TabStrip()
        .Name("PCGTabStrip").HtmlAttributes(new { style = "width:100%;" })
        .Items(items =>
        {
            var index = 0;
            foreach (PCGTabModel PCG in PCGs)
            {
                items.Add()
                .Text("PCG <button id='btn'" + index + " data-type='remove' class='k-button k-button-icon' onclick='deleteMe(this)'><span class='k-icon k-i-close'></span></button>")
                .Encoded(false)
                .Content(@<text>@(Html.Partial("_PCGForm", PCG, new ViewDataDictionary { TemplateInfo = new TemplateInfo { HtmlFieldPrefix = "PCG" } }))</text>);
                index++;
            }
        }))
    </div>
}

2.     </table>
<tr>
<td colspan="4">
@RenderPCGTab(Model.PCGTab)
</td>
</tr>
</table>

3. Script - to add dynamicic tabs

         $('#add-button').kendoButton({
            click: function () {
                var tabstrip = $('#PCGTabStrip').kendoTabStrip();
                validateCount = tabstrip.length;
                var index = validateCount;
                tabstrip.append([{
                    text: '<a>PCG <button id="btn' + index + '" data-type="remove" class="k-button k-button-icon deleteAll" onclick="deleteMe(this)"><span class="k-icon k-i-close"></span></button></a>',
                    encoded: false,
                    contentUrl: "@Url.Content("~/Home/_PCGTab?tabId=")" + index + ""
                }]);
            }
        });

4. Partial view action method

public ActionResult _PCGTab(int tabId)
        {
            PCGTabModel model = model = new PCGTabModel() { PCGTabId = tabId, IsWhollyEntity = null };          
            return PartialView("_PCGForm", model);
        }

5. Problem am facing

1.When i add a new tab and click on the existing tab , in the existing tab the content is getting duplicated i,e the whole content is getting duplicaated
2.If am not adding any new tab, if i click on any existing tab i dont have issue











Prakash Kumar Nambi
Top achievements
Rank 1
 answered on 21 Aug 2020
5 answers
3.8K+ views
Is there a way to display a k-icon inside a Kendo textbox? For example, displaying the k-i-email in a Kendo textbox for an email address.
Tsvetomir
Telerik team
 answered on 21 Aug 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?