Telerik Forums
UI for ASP.NET MVC Forum
1 answer
1.1K+ views

i have a module with additional "dynamic" propertys, stored in a dictionary (loaded from DB, style of Entity-Attribute-Value

the module like this:

public class Contact
{
    public int ContactID { get; set; }
    public string FullName { get; set; }
    //...more fixed properties
 
    #region "handel dynamic property"
 
    public Dictionary<int, string> ValuesForDynamicProps = PropsNameToSpcailParameter.Values.ToDictionary(x => x.IdParameter, x => "");
 
    private void intDicFromContact(DAL.Contact contact)
    {
        foreach (var item in contact.ContactsParameters)
        {
            ValuesForDynamicProps[item.Parameter] = item.GetString;
        }
    }
     
    static StudentVM()
    {
        PropsNameToSpcailParameter = DAL.Contact.SpecialParamertersTypes().ToDictionary(x => x.ID, x =>
            new ModelSpecialParameter(x));
    }
 
    public static Dictionary<int, ModelSpecialParameter> PropsNameToSpcailParameter;
    #endregion
}

the View:

 

@(Html.Kendo().Grid(Contact)
    .Name("grid")
    .Columns(columns =>
    {
        columns.Bound(e => e.FullName).Width(120).Title("Name");
        //...more
          
        foreach (var item in ShutafimOrganizationsWebApp.UI.Models.StudentVM.PropsNameToSpcailParameter)
        {
            columns.Bound(e => e.ValuesForDynamicProps[item.Key]).Title(item.Value.DisplayName);
        }

I receive an exeption ""Bound columns require a field or property access expression."

 

MY QUESTION: i serarch an elegant and easy way to show in grid an model with posibilty to add and remove "virtual" propertys.

 

Ps: i asked in stackoverflow: http://stackoverflow.com/questions/30650326.

Daniel
Telerik team
 answered on 10 Jun 2015
1 answer
92 views

Hi all:

 We have a functional requirement to be able to edit the data in a column inside a kendo grid, by selecting a different header.

 For example, let's say we have a kendo grid that has six columns. 

 Name City Class etc

We need the ability for a user (with the given permission) to select a different option for each header column. 

Let's say they decide that they don't want "Class" as the third header/column.  We'd like the user to be able to click into the header, a dropdown appear and then the user can select a different data source.  Once selected the grid would update with the new data in the third column.

 Anyone able to point me in the right direction?  We also need to be able to reorder the kendo columns but I see that already with the Grid/Column reordering drag drop feature which is perfect.

 Thanks!

 

Boyan Dimitrov
Telerik team
 answered on 10 Jun 2015
1 answer
159 views

Hi 

How can I hide the Excel Export button in runtime? Depending on the logged in user I have to hide and show the Export Excel button.

Would you have some sample code?

 

Dimiter Madjarov
Telerik team
 answered on 10 Jun 2015
5 answers
408 views
I did the same as tutorial http://demos.telerik.com/aspnet-mvc/grid/excel-export . But as you can see in the tutorial, when you export the excel, it contains only page 1. 
I want to export all the the pages. How should i do ? 

Regards.
Dimiter Madjarov
Telerik team
 answered on 10 Jun 2015
9 answers
2.9K+ views
Hi! I'm using the KendoUI Grid with MVC 4.  I'm trying to figure out how to automagically save the cell data when I step out of the cell.  I can get it to save using a "Save" button and batch editing, but my requirements are such that they don't want to have to press the "Save" button.

Thanks for your help in advance.
Dimiter Madjarov
Telerik team
 answered on 10 Jun 2015
1 answer
350 views

In one of our projects, we are using Kendo UI Q2 and we cannot upgrade because of IE8 support and we need Export to Excel & Export to PDF features. So we decided to take these features to server side.

By googling, I found following sample projects from github:

https://github.com/telerik/ui-for-aspnet-mvc-examples/tree/master/grid/excel-export-server-side

https://github.com/telerik/ui-for-aspnet-mvc-examples/tree/master/grid/pdf-export-server-side

These seem to be helping but in the PDF part I see that iTextSharp is used and it's commercial license is NOT FREE. What I want to confirm is that by having a valid license of Telerik DevCraft, can we use iTextSharp commercially or do we need separate license for it?

 

Any other help or solution will be highly appreciated.

Dimiter Madjarov
Telerik team
 answered on 10 Jun 2015
6 answers
988 views
Hi All,

Initially we are using Telerik ASP.NET combo box. For this having load on demand option ( link). Now we are moving to Kendo UI combo box.
This combo box doesn't contain all options (which are present in telerik asp.net combobox) like Load on demand , ShowMoreResultsBox.. etc.  

Could you please provide solution for updating item on Load on demand 
@(Html.Kendo().ComboBox()
         .Name("fabric")
         .Filter("contains")
         .Placeholder("Select fabric...")
         .DataTextField("Text")
         .DataValueField("Value")
         .DataSource(source =>
             source.Read(read =>
                     {
                         read.Url("http://localhost:59590/api/Search/LoadonDemand");
                     }).ServerFiltering(true))
         .HighlightFirst(true)
         .IgnoreCase(true)
Nuno
Top achievements
Rank 2
 answered on 09 Jun 2015
2 answers
183 views
Hi There,

I'm working on an Umbraco CMS Project , in which in one of the page I need to use telerik Upload control (to upload large files)- I have worked on this component in separate MVC project and I am happy with its working status, now i need to integrate this functionality in Umbarco CMS, I referenced Kendo.MVC.dll in CMS project, and have copied CSS and JS relating to component in respective folder and all paths are updated where necessary, now CMS project has stopped working i.e published content is inaccessible within CMS pages, it used to work earlier, If I remove reference CMS project starts working again- So I'm unable to embed kendo UI related changes into the Umbraco CMS. could you please advise me how this can be addressed.

Thanks
Satish
Geoff
Top achievements
Rank 1
 answered on 09 Jun 2015
2 answers
490 views

Is it possible to mask a phone number with or without an extension?  I'm looking for:

(612) 555-1212

or

(612) 555-1212 ext. 5

or

(612) 555-1212 ask for Larry

 Basically, the beginning of the string must be formatted as a phone number, but the user can enter whatever they want after that. 

 Can I do it?

 Thanks!

Laurie
Top achievements
Rank 2
 answered on 09 Jun 2015
1 answer
610 views
 I have a dynamic model below is the cshtml code, is line editing possible with dynamic model ? 
 
@(Html.Kendo().Grid<dynamic>()
              .Name("requestCapacity")
              .Columns(columns =>
              {
                  foreach (var c in Model)
                  {
                      if (c.Equals("Week Starting"))
                          columns.Template(@<text> </text>).ClientTemplate(@"<span class='k-widget k-datepicker' style='width: 150px;'><span class='k-picker-wrap k-state-default'><input id='datepicker'  style='width: 100%;' data-role='datepicker' type='text' class='k-input' role='combobox' aria-expanded='false' aria-owns='datepicker_dateview' aria-disabled='false' aria-readonly='false' aria-activedescendant='270cfa37-b189-46a8-b0ea-857df06f84ab_cell_selected'><span unselectable='on' class='k-select' role='button' aria-controls='datepicker_dateview'><span unselectable='on' class='k-icon k-i-calendar'>select</span></span></span></span>").Width(150).Title(c.Key);
                      else
                          columns.Template(@<text>c</text>).Title(c.Key);
 
                  }
                  columns.Command(command => { command.Edit(); command.Destroy(); }).Width(200);
              }
      )
              .Editable(editable => editable.Mode(GridEditMode.PopUp))
                  .HtmlAttributes(new { style = "height:auto;width:85%;align:center;margin:0 auto" })
                  .Pageable()
                  .ToolBar(toolbar => toolbar.Create().Text("Add"))
              .Sortable()
              .Scrollable().EnableCustomBinding(true)
               .DataSource(dataSource => dataSource
                      .Ajax().Model(model =>model.Id("ID")
                      )
                  .PageSize(10)
                    .Events(events => events.Error("error_handler"))
                                   .Create(update => update.Action("EditingInline_Update", "RequestCapacity",new {testing="#=dataItem#"}).Type(HttpVerbs.Post))
                          .Read(read => read.Action("PopulateRequest", "RequestCapacity").Type(HttpVerbs.Post))
                                  .Update(update => update.Action("EditingInsline_Update", "RequestCapacity","#=dataItem#").Type(HttpVerbs.Post))
                          .Destroy(update => update.Action("EditingInline_Destroy", "Capacity"))
              )
)

 

controller code.

public ActionResult RequestCapacityPopUp()<br>        {<br>            var dynamicBinding = new List<string>(){"Week Starting"};<br>            using (var dataModel = new CapacityPlannerEntities())<br>            {<br>                foreach (var team in dataModel.Teams)<br>                {<br>                    dynamicBinding.Add(team.TeamName);<br>                }<br>            }<br>            return View(dynamicBinding);<br>        }

Alexander Popov
Telerik team
 answered on 09 Jun 2015
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
Upload
ComboBox
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
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
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
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?