Telerik Forums
UI for ASP.NET MVC Forum
3 answers
325 views

Hi,

I've just upgraded to the version 2018.2.620. I noticed that window.title no longer displays special characters correctly. For example:

In previous version, setting the title to finnish: "Viesti Phoenixistä" rendered correctly "Viesti Phoenixistä". Now the translation of &#228 character does not work anymore.

Are there any solutions to this?

Thanks and regards,
Viktor

Benedikt
Top achievements
Rank 1
 answered on 03 Sep 2018
3 answers
1.0K+ views

I have a popup editor configured on a grid.  In the editor template, I have a dropdownfor with a Read action.  I need to pass the model value to the read action but it is not recognized.  Can you help?

Here is the editor template:

@model Procurement.Models.Pipe
<style>
    .k-edit-form-container {
        width: auto;
    }
</style>
<div class="panel" style="padding:5px;">
  
  
    @Html.HiddenFor(m => m.MaterialId)
    @Html.HiddenFor(m => m.PcsPartNum)
    @Html.HiddenFor(m => m.OuterDiameter, new { id="OD", name="OD"})
    <table>
        <tr><td colspan="2" align="center"><h4 class="text-info"> Pipe Details</h4></td></tr>
        <tr><td colspan="2" align="center"> <hr /></td></tr>
        <tr>
            <td width="30%">PCS Part Num</td>
            <td>@Html.TextBoxFor(m => m.PcsPartNum, new { ReadOnly = "true" })</td>
        </tr>
        <tr>
            <td>Description</td>
            <td>@Html.TextAreaFor(m => m.Description, new { ReadOnly = "true", TextMode = "MultiLine", Rows = "3", Cols = "500" })</td>
        </tr>
        <tr>
            <td>Sort Order</td>
            <td>@Html.TextBoxFor(m => m.Materials_Group.SortOrder, new { ReadOnly = "true" })</td>
        </tr>
        <tr>
            <td>Unit</td>
            <td>@Html.TextBoxFor(m => m.Materials_Group.Unit, new { ReadOnly = "true" })</td>
        </tr>
        <tr><td colspan="2"><hr /></td></tr>
        <tr>
            <td colspan="2" align="center">
                <table>
                    <tr>
                        <td class="text-info" width="30%">Client Part Num</td>
                        <td colspan="2">@Html.EditorFor(m => m.ClientPartNum)</td>
                    </tr>
                    <tr>
                        <td class="text-info">Additional Info</td>
                        <td colspan="2">@Html.TextAreaFor(m => m.AdditionalInfo, new { TextMode = "MultiLine", Rows = "3", Cols = "500" })</td>
                    </tr>
                    <tr><td colspan="2" align="center"><h5 class="text-info">Properties</h5></td></tr>
                    <tr>
                        <td class="text-info">Outer Diameter</td>
                        <td>@Html.DisplayFor(m=>m.OuterDiameter, new { style="width:100px;id:tbOD"})</td>
                        <td>@(Html.Kendo().DropDownListFor(m => m.OuterDiameter)
                            .Name("OuterDiameter")
                            .DataValueField("Text")
                            .DataTextField("Value")
                            .DataSource(ds =>
                            {
                                ds.Read(read =>
                                {
                                    read.Action("GetPipeOD", "Materials", new { od = m.OuterDiameter }); <<<<<< Here is where the model value needs to be sent >>>>>>>
                                });
                            })
                            .HtmlAttributes(new { style="width:100px"})
                            //.Events(e =>
                            //{
                            //    e.Change("onChange").Select("onSelect");
                            //})
                            )
                       </td>
                    </tr>
                    <tr>
                        <td class="text-info">Wall Thickness</td>
                        <td colspan="2"></td>
                    </tr>
                    <tr>
                        <td class="text-info">Specification</td>
                        <td></td>
                    </tr>
                    <tr>
                        <td class="text-info">Grade</td>
                        <td colspan="2"></td>
                    </tr>
                    <tr>
                        <td class="text-info">Seam Type</td>
                        <td colspan="2"></td>
                    </tr>
                    <tr>
                        <td class="text-info">Coating 1</td>
                        <td colspan="2"></td>
                    </tr>
                    <tr>
                        <td class="text-info">Coating 2</td>
                        <td colspan="2"></td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</div>

Dimitar
Telerik team
 answered on 03 Sep 2018
2 answers
378 views

Hi,

in my MVC-App I use <authentication mode="Windows" /> and <identity impersonate="true"/> inside web.config which means the current WindowsIdentity is delivered through IIS to SQL-Server. Normally I use the async/await pattern in my code and thus use ToDataSourceResultAsync(...) to get my filtered/sorted/paged results async. When doing so I run into an error. The call from App -> IIS -> SQL-Server is now under the normal "IIS APPPOOL\DefaultAppPool" account which is not a valid SQL-Server user and so the connection is refused. When using the normal ToDataSourceResult(...) call everything works perfect.

The reason for this is the usage of "Task.Factory.StartNew(...)" inside QueryableExtensions.cs. Whenever you use "Task.Factory.StartNew(...)" the impersonation is reset to the default value and is NOT using the identity used inside the MVC-App. Here is a little example (just place the code inside a normal Controller Action):

1.Debug.WriteLine("App is running as: {0}", WindowsIdentity.GetCurrent().Name);
2.await Task.Factory.StartNew(
3.    () =>
4.    Debug.WriteLine("New Task is running as: {0}", WindowsIdentity.GetCurrent().Name),
5.    CancellationToken.None,
6.    TaskCreationOptions.None,
7.    TaskScheduler.Default);

 

As a result you get:
Line 1: "App is running as: myDomain\myUser"
Line 4: "New Task is running as: IIS APPPOOL\DefaultAppPool"

At least you should warn in your documentation that this could happen or think about a better solution for implementing "ToDataSourceResultAsync(...)". In my opinion my scenario is not so seldom in the enterprise world so giving a warning should be a good idea.

Regards
Heiko

 

 

Heiko
Top achievements
Rank 1
Iron
Veteran
 answered on 31 Aug 2018
6 answers
667 views

Is there currently a way to use DropDownList that would allow a USER to delete an item?  We are creating a facility of saved searches and we'd love to be able to allow the user to be able to click an 'X' in a dropdown to trigger a delete of the item from the list (and ultimately the database) as seen in the attached screen shot.

 

 

Dimitar
Telerik team
 answered on 31 Aug 2018
1 answer
173 views

We are using Telerik Rad-editor (Version: 2017.2.503.40) in our application. The Rad-editor control which we use looks like the sample you provided in "Save in database" link.
We are facing 1 issue while uploading image through Image Manager control. If we upload an image then we face 1 console error. Below is the description for the error.
ScriptResource.axd?d=WumqVucm-BTOpradDSIl6FwWq2Nf8yJ7sqq9-igzn7fhpcm7LMUuXAF__xzJt_PP7G8atwaBX_21lH9wtho_Q-JsnyL97IPmZiErbgIsKQvtmeYlHiL_GqtD3HsMVT9KS6u1-fBfjgRuY07t3m9OjNcjVdzCqYRpX7UHxymyD6WPAuy90&t=ffffffffad4b7194:5 Uncaught Error: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500
Can you please provide us the solution/your suggestions please?

Thanks in advance.

Rumen
Telerik team
 answered on 31 Aug 2018
3 answers
2.2K+ views

Hello.

I have a dropdownlist for Contact Name in a kendo grid as shown in the attachment.

When I click on the Manage Contacts button, I get a pop up which has a grid where I insert contacts.

After inserting/updating contacts and closing the popup, the Contact Name dropdownlist should display the new contacts which have just been inserted when I click on Edit for that particular row.

But this not happening. 

The code for the Contact Name editor template is as follows:

@(Html.Kendo().DropDownList()
.Name("ContactName")
.ValuePrimitive(true)
.DataValueField("ContactName")
.DataTextField("ContactName")
.OptionLabel(" ")
.DataSource(source =>
{
    source.Read(read =>
    {
        read.Action("GetVendorContacts", "VendorCont")
        .Data("filterContactName");
    })
    .ServerFiltering(true);
})
    //.AutoBind(false)
    .CascadeFrom("Vendor")
)

Is there a way to refresh the dropdown list when I click on the Edit button on the row or when I click on the dropdown list to select contacts?

I have tried to refresh the dropdownlist using the BeforeEdit and Save events, but it did not work.

This is very urgent and any help will be greatly appreciated.

 

Thanks and Regards

 

Veselin Tsvetanov
Telerik team
 answered on 30 Aug 2018
2 answers
797 views

Hi,

I have a detail template in a grid. In the last column I want to have a dropdown menu based on a condition. In another (regular) grid I did this:

columns.Template(@<text></text>).ClientTemplate(@"<div class='dropdown'>
                                                            <a data-toggle='dropdown' class='primarycolor' href=''><i class='fa fa-ellipsis-v fa-2x'></i></a>
                                                            <ul class='dropdown-menu dm-icon pull-right'>"
+ "# if (ShowEditLink) { # <li><a class='k-button-icontext editReg' href='#=EditLink#' data-rid='#=Id#'>" + translator.Translate("EDIT_REGISTRATION") + "</a></li> # } #"
+ "</ul></div>").HtmlAttributes(new { @class = "dropdown-gridcell" }).Width(20);

 

Now I know that in the child/detail context I have to escape template expression with "\\#=fieldName\\#. Found here: https://demos.telerik.com/aspnet-mvc/grid/detailtemplate

What I'm trying is this:

columns.Template(@<text></text>).ClientTemplate(@"<div class='dropdown'>" +
  "<a data-toggle='dropdown' class='primarycolor' href=''><i class='fa fa-ellipsis-v fa-2x'></i></a>" +
  "<ul class='dropdown-menu dm-icon pull-right'>" +
"# if (booleanProperty) { # <li><a class='k-button-icontext' href='' data-spid='#=Id#'>" + translator.Translate("CANCEL") + "</a></li> # } #" +
"</ul></div>").HtmlAttributes(new  {  @class = "dropdown-gridcell"  }).Width(20);

where "booleanProperty" is a property of the viewModel in the child grid. This doesn't work because it doesn't recognize "booleanProperty" since it thinks it is in the viewModel of the parent grid. I have looked at the following posts:

https://www.telerik.com/forums/nested-detail-grid-clienttemplate-conditional-binding-expression-error

https://docs.telerik.com/aspnet-mvc/helpers/grid/faq#how-to-display-checkboxes-in-ajax-bound-grids

 

and tried this as well:

columns.Template(@<text></text>).ClientTemplate("\\#=showLink(booleanPropoerty, Id)\\#").Title("").HtmlAttributes(new  {  @class = "dropdown-gridcell"  }).Width(20);

function showLink(booleanProperty, id) {

var returnValue = "<div class='dropdown'><a data-toggle='dropdown' class='primarycolor' href=''><i class='fa fa-ellipsis-v fa-2x'></i></a><ul class='dropdown-menu dm-icon pull-right'>";

if (booleanProperty) {
return "<li><a class='k-button-icontext' href='' data-spid='" + id + "'>" + $('#stringValue').val() + "</a></li>";
}

returnValue += "</li></div>";

return returnValue;
}

This way I get returned a value but the required javascript for the dropdown list doesn't work.

 

Is there a solution for this?

 

Thank you,

Jokull

Jokull
Top achievements
Rank 1
 answered on 30 Aug 2018
1 answer
263 views

Grid data source is as follow:

public class Customer

{

    public string customer_id { get; set; } = "";

    public string customer_name { get; set; } = "";

    public List<Order> Orders { get; set; } = "";

    public List<Delivery> Delivery{ get; set; } = "";

}

public class Order

{

    public string order_id { get; set; } = "";

}

 

public class Delivery
{
    public string delivery_id { get; set; } = "";
}

 

My design:

Master grid will present Customer record(List<Customer>), and when I click edit button, it will pop up a edit template

and edit template will include Customer's data and two sub grids(Order, Delivery). 

 

My question is I know if I want to get string, it would be "#=customer_id#" but I don't know if I want to get List -- Order and Delivery -- to bind sub grids data source, how can I do.

Does anyone help me?

Viktor Tachev
Telerik team
 answered on 30 Aug 2018
3 answers
400 views
Hello.
I have a dropdownlist for Contact Name in a kendo grid as shown in the attachment.
When I click on the Manage Contacts button, I get a pop up which has a grid where I insert contacts.
After inserting/updating contacts and closing the popup, the Contact Name dropdownlist should display the new contacts which have just been inserted when I click on Edit for that particular row.
But this not happening. 
The code for the Contact Name editor template is as follows:
@(Html.Kendo().DropDownList()
.Name("ContactName")
.ValuePrimitive(true)
.DataValueField("ContactName")
.DataTextField("ContactName")
.OptionLabel(" ")
.DataSource(source =>
{
    source.Read(read =>
    {
        read.Action("GetVendorContacts", "VendorCont")
        .Data("filterContactName");
    })
    .ServerFiltering(true);
})
    //.AutoBind(false)
    .CascadeFrom("Vendor")
)
Is there a way to refresh the dropdown list when I click on the Edit button on the row or when I click on the dropdown list to select contacts?
I have tried to refresh the dropdownlist using the BeforeEdit and Save events, but it did not work.
This is very urgent and any help will be greatly appreciated.

Thanks and Regards
Georgi
Telerik team
 answered on 30 Aug 2018
3 answers
903 views

Hi, I realized the 2 bar chart in a single mvc5/bootstrap page as shown in the image "actual.jpg" (see the code) I would like to obtain the result in "wanted.jpg" in short an overlapping bar chart and changing categories colors, there is a way to do this?

Thank You in advance.

code:
<div class="container-fluid">
    <div class="row">
        <div class="col-xs-18 col-md-12">
            @(Html.Kendo().Chart()
                                    .Name("chart-multi")
                                    .Title("First")
                                    .Legend(legend => legend
                                        .Position(ChartLegendPosition.Top)
                                    )
                                    .Series(series =>
                                    {
                                        series
                                            .Column(new int[] { 20, 40, 45, 30, 50 })
                                            .Color("#cc6e38")
                                            .Spacing(-1)
                                            .Name("on battery");
                                        series
                                            .Column(new int[] { 20, 30, 35, 35, 40 })
                                            .Color("#ef955f")
                                            .Name("on gas");
                                    })
                                    .CategoryAxis(axis => axis
                                        .Categories("Mon", "Tue", "Wed", "Thu", "Fri")
                                        .AxisCrossingValue(0, 10)
                                    )
                                    .ValueAxis(axis => axis
                                        .Numeric()
                                            .Title("miles")
                                            .Min(0).Max(100)
                                    )
                                    .ValueAxis(axis => axis
                                        .Numeric("km")
                                            .Title("km")
                                            .Min(0).Max(161).MajorUnit(32)
                                    )
            )
        </div>
    </div>
</div>

<div class="container-fluid">
    <div class="row">
        <div class="col-xs-18 col-md-12">
            @(Html.Kendo().Chart()
                                        .Name("bar-chart")
                                        .Title("Second")
                                        .Series(series =>
                                        {
                                            series.RangeColumn(new double[][] {
                                                               new double[] {0, 121.99},
                                                               new double[] {38.47, 121.99},
                                                               new double[] {16.17, 38.47},
                                                               new double[] {0, 16.17}
                                            }).Labels(labels => labels
                                                .Visible(true)
                                                .From(from => from.Template("#=value.from#"))
                                                .To(to => to.Template("#=value.to#")));
                                        })
                                        .CategoryAxis(axis => axis
                                            .Categories("Total", "Done", "Committed", "Uncommitted")
                                        )
                                        .Tooltip(tooltip => tooltip
                                            .Visible(true)
                                            .Template("#= value.to - value.from #")
                                        )
            )
        </div>
    </div>
</div>

Alex Hajigeorgieva
Telerik team
 answered on 29 Aug 2018
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
LLM Kit
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?