Telerik Forums
UI for ASP.NET MVC Forum
4 answers
147 views
I cannot find the treelist feature in my trial version I downloaded.

V2014.2.1008

THanks.
Yogesh
Top achievements
Rank 1
 answered on 21 Nov 2014
4 answers
220 views
As we all know using an IIFE (immediately-invoked function expression) is all the rage these days and a best practice for isolation of javascript code from the dreaded global scope. 

We are creating a dashboard in which it is possible the same widget is placed on the dashboard twice by the user. So, the js has to be isolated to prevent collisions. 

One issue we had was that when we provide a Data("FunctionName") function name to a grids datasource since the helper renders the script inline if the function was declared in the IIFE a js undefined error occurs. This issue would also occur with any event handlers that you set up with the grid. 

One possible work around could be to have the IIFE (really now using the revealing module patter) given a name. But, still, this would mean putting the js into the razor view and somehow coming up with a unique name for that instance of the views function and prefixing the event handlers with it. But, I really don't like this because the js in the view isn't minified and cached.

Other than moving to client side configuration, basically nullifying the benefit of the MVC helpers, is there any possible way this could work? Perhaps the helper could somehow allow you to render the HTML separately from the js? Even that wouldn't be perfect since then all the js would have to be in the razor view.

Any other ideas or considerations. 
Bob
Top achievements
Rank 1
 answered on 20 Nov 2014
1 answer
237 views
I have several text boxes that are numeric values and would like for them to always have 2 decimal places (values can vary from less than 1 to several thousand) when displayed.  I have tried different masks but can not find one that will work for this.  I am also open to using the Numeric text box but would not want the increment and decrement arrows to display as those are not useful for this application.
Georgi Krustev
Telerik team
 answered on 20 Nov 2014
2 answers
457 views
Suppose I have an enum that I'd like to use in a Grid, using the _underlying value_ as the cell value:

public enum Currency : int {
   USD = 0,
   GBP = 1
}

The editor is thus something similar to:

@(Html.Kendo().DropDownListFor(m => m)
      .BindTo(Enum.GetValues(typeof(Currency)).Cast<Currency>().Select(v => {
          return new DropDownListItem()
          {
              Text = v.DisplayName(),
              Value = ((int)v).ToString(),
              Selected = v == Model,
          };
      }).ToList()))

If I don't include an entry in the data source model for the field, the field defaults as expected to 0.

However, if I include the following entry in the data source model, Kendo attempts to default the value to "usd":

model.Field(d => d.Currency).DefaultValue((int) Currency.USD);

This isn't a problem for this case, as I can just leave off the model configuration. However, it becomes a problem if I change the type of the column to Nullable<Currency> because there is no way to default the value to 0. Not configuring the model attempts to use null (which causes Kendo grid to throw an exception), and attempting to configure the model uses "usd", which is invalid.

I have attempted manually setting the schema using JS:

$(document).ready(function () {
     $("#MyGrid").data("kendoGrid").dataSource.options.schema.model.fields.Currency.defaultValue = 0;
}

However when I add a new column, the grid still attempts to use "usd" as the default value.

Please advise how to set the default value to 0 for a column type of Nullable<Currency>.



Daniel
Telerik team
 answered on 20 Nov 2014
1 answer
140 views
First of all the Server Binding example is wrong because GanttBuilder doesn't accept a ctor with 2 parameters:
@(Html.Kendo()
.Gantt<TaskViewModel, DependencyViewModel>(
(IEnumerable<TaskViewModel>)ViewData["tasks"], (IEnumerable<DependencyViewModel>)ViewData["dependencies"]
)

I'm trying to pass 2 collections (set by the controller in the ViewData/ViewBag properties) as DataSources or DependencyDataSources for the Gantt control.

Any idea how to do that?

Thanks,
Andrei
Dimitar Terziev
Telerik team
 answered on 20 Nov 2014
4 answers
1.0K+ views
Hi,

What is the best way to make a grid responsive on different screens. I added 'hidden-xs' class to html attribute on the grid column and headers. It seems to hide the column header and values but not the actual column. See the image attached.


Is there any way to achieve responsiveness? 

Thanks for your help.

Uday
Uday
Top achievements
Rank 1
 answered on 19 Nov 2014
1 answer
86 views
Hi,

We've got a simple server bound grid which show aggregates in the footer and sets the Footer Template format to be currency - ...

.FooterTemplate(f => f.Sum.Format("{0:c}")).

Good if there are rows, but this throws an error if there are zero rows returned in the model.

How can we apply the correct formatting only if there are rows returned?

(Found this thread but the last response says the answer was through a support call - http://www.telerik.com/forums/conditionals-embedded-in-client-templates )

Many Thanks,

Dan.
Daniel
Top achievements
Rank 1
 answered on 19 Nov 2014
6 answers
341 views
I am trying to add sorting inside grouped columns, So the Grid is grouped by X and Y columns and then I need to sort for the rows in it.
I need to sort by CustomSortIntegerValue if CustomSort = true, and Alphabetically by Name if CustomSort = false. The last line does not work. Can you please give an pointers/examples on how to achieve this.

@(Html.Telerik().Grid(Model)
    .Name("Grid")
    .NoRecordsTemplate("Loading ..... Please Wait")
    .Columns(c =>
    {
        c.Bound(x => x.Name).Title("Name");
        c.Bound(x => x.CustomSortIntegerValue).Title("Custom Sort"); 
        c.Bound(x => x.Id).ClientTemplate(Html.ActionLink("Edit", "Edit", new { id = "<#=Id#>" }).ToString()).Filterable(false).Sortable(false).Title("").Width(50);
    })       
          .DataKeys(keys =>
          {
              keys.Add(x => x.Id);
          })

    .DataBinding(dataBinding => dataBinding.Ajax()
        .OperationMode(GridOperationMode.Client)
                      .Select("RetrieveAllData_AjaxBinding", "CDController"))
    .Groupable(grouping => grouping.Groups(groups =>
             {
                 groups.Add(x => x.X);
                 groups.Add(x => x.Y);
             }).Visible(false))
          //.Sortable(sort => sort.OrderBy(sortOrder => sortOrder.Add(x => x.CustomSort ? "CustomSortIntegerValue" : "Name").Ascending()).Enabled(false))
    )
Rosen
Telerik team
 answered on 19 Nov 2014
4 answers
408 views
Hi,

Not exactly sure if I'm in the right place, but here goes. I've included the default Sitefinity file upload widget into my form and have set it to be required. However, when I submit the form it doesn't validate whether a file has been selected or not. The unobtrusive validation is visible if you cancel when selecting a file but does not stop the form from being submitted. 

Is this an error in the widget, of am I missing a different setting?

Kind regards,

Aidan Langelaan
Fenêtre Internet Applicaties
Aidan
Top achievements
Rank 1
 answered on 19 Nov 2014
2 answers
265 views
I am new to asp.net and Telerik and having hard time finding a simple tutorial example online for displaying database table data in a grid.

I need a complete tutorial from scratch like below to display calendar.
http://docs.telerik.com/kendo-ui/aspnet-mvc/asp-net-mvc-5

I want to do this is MVC 5 and visual studio 2013. I am using Telerik trial for now.

Please help.

Thanks.
Dimiter Madjarov
Telerik team
 answered on 19 Nov 2014
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
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
ColorPicker
DateRangePicker
Wizard
Security
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
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?