Telerik Forums
UI for ASP.NET MVC Forum
1 answer
101 views
hi i am new telerik panel bar
can any one give me source code to bind my panel bar from database using entity framework
Daniel
Telerik team
 answered on 05 Mar 2014
1 answer
1.0K+ views
Consider the following code i want to set the grid datePicker column empty if date validation fails WorkOrderDate< task date , any help would be higly appreciable.


***********Grid***************

columns.Bound(c => c.WorkOrderDetailsDate).Title("Estimated Start Date").EditorTemplateName("WorkOrderDetailsDate")

***********Editor**************

@model DateTime?
@(Html.Kendo().DatePicker()
.Name("WorkOrderDetailsDate")
.Value(Model == null ? DateTime.Now.Date : ((DateTime)@Model).Date)
.Events(d=>d.Change("TaskDateValidate"))
)

*************JavaScript***********
function TaskDateValidate(e)
{

     if ($("#workOrder_EstStartDate").val() != null && $("#workOrder_EstStartDate").val() != "") {
    var workDate = kendo.parseDate($("#workOrder_EstStartDate").val());
    var taskDate = kendo.parseDate(kendo.toString(this.value(), 'd'));

       if (taskDate < workDate)
       {

       showMessage("Task date should be after work order Date");
        this.value(""); <-----this is not working want to set to empty to force user to select date again
           this.value("28/02/2014");<---this is not working as well...
       }
}


please advise on this problem
reagrds
Shaz
Alexander Popov
Telerik team
 answered on 04 Mar 2014
1 answer
513 views
You've all been doing this for a bit, so please be patient...

Please follow along to see the logic…don't assume the initial error is my issue...

In MVC - I have a part view and wanted a datepicker on it.

So in my _PartialFormName.cshtml I had (from the  sample) the following:

<input id="datepicker" />
        <script>
            $(function() {
                $("#datepicker").kendoDatePicker();
            });
</script>
 
This reports the error $ not defined.

That's because the render scripts call hasn't loaded the JQuery library at the bottom of the _Layout.cshtml page:

    @Scripts.Render("~/bundles/scripts")

AND the script is not in a @section Script section that will be rendered by the call: 

    @RenderSection("scripts", required: false)

So, I put the script for datetimepicker it in the @section Script block...

BUT that's in the main MainPage.cshtml razor page, NOT the _PartialFormName.cshtml partial page…
 
So I need to know and collect all the control scripts of ALL partial views and put their scripts in the containing page?

******************************************
Now the best practice question...

Should I reference a child script named for that partial view containing all of the kendo scritps for that page?

How do we best contain kendo scripts? Is there a best practice?

Thanks

 

 

Thanks

R

Dimo
Telerik team
 answered on 04 Mar 2014
1 answer
139 views
Hi,

I have question that in my project there are different test cases and i want to generate new chart for each of this test case.I tired placing for loop before the kendo chart in the view for each of different test case but only one chart is generated.The datasource o this chart is using ajax binding.How do i get different charts for same datasource using different parameters passed to the action method?

T. Tsonev
Telerik team
 answered on 03 Mar 2014
1 answer
101 views
I am having grid with virtual scroll and Batch editing functions.
If, I make some value changes on first row it shows red mark. After scrolling the grid (on virtual scroll call), that red mark gets removed. Value remain changed, but, red mark gone from a cell.
Nikolay Rusev
Telerik team
 answered on 03 Mar 2014
1 answer
34 views
Could anyone provide a link for the demo solution file so I can have a look at the views etc.

Thanks

John
Dimiter Madjarov
Telerik team
 answered on 03 Mar 2014
2 answers
167 views
Hello,

I currently have a clear grid button and the following code clears the rows from the grid:

$("#studentGrid").data('kendoGrid').dataSource.data([]);

But my problem is, I have a ClientFooterTemplate with totals.  How do I clear the ClientFooterTemplate in a javascript call?  I could do it on the DataBound event, but just don't know how to clear that footer.

Thanks...
Michael
Top achievements
Rank 1
 answered on 02 Mar 2014
7 answers
825 views
I am working on a UI where I am editing grid in an Ajax Popup Edit. The following data annotations do not work as expected in the popup edit:

 [DataType(DataType.Password)]
        [Display(Name = "Confirm password")]
        [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
        public string ConfirmPassword { get; set; }

        [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "Password")]
        public string Password { get; set; }

        [StringLength(500, ErrorMessage = "Image path cannot be more than 500 characters.")]
        [Display(Name = "Image path")]
        [DataType(DataType.ImageUrl)]
        [RegularExpression(@"^http(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&amp;%\$#_]*)?$", ErrorMessage = "Image path format is incorrect.")]
        public string ImagePath { get; set; }

Currently for Add/Edit both, I am getting a minimum password length should be 6. Also both for Add and Edit I get "Image path format is incorrect" even when there is nothing typed in that field

In addition to the above
On Edit - I do not want the password to be required. On New I want password to be required.

Thanks
Daniel
Telerik team
 answered on 28 Feb 2014
1 answer
210 views
i have implemented Custom Binding.I get error like "object reference not set to an instance of an object" when Group a column which is complex Type(Order.Name).

public static IEnumerable<AggregateFunctionsGroup> BuildInnerGroup<T, TObject>(IEnumerable<TObject> group, Func<TObject, T> groupSelector, Func<IEnumerable<TObject>, IEnumerable> innerSelector)
{
return group.GroupBy(groupSelector)
.Select(i => new AggregateFunctionsGroup
{
Key = i.Key,
Items = innerSelector(i)
});
}

public static Func<IEnumerable<TObject>, IEnumerable<AggregateFunctionsGroup>> BuildGroup<T, TObject>(Func<TObject, T> groupSelector, Func<IEnumerable<TObject>, IEnumerable<AggregateFunctionsGroup>> selectorBuilder)
{
var tempSelector = selectorBuilder;
return g => g.GroupBy(groupSelector)
.Select(c => new AggregateFunctionsGroup
{
Key = c.Key,
HasSubgroups = true,
Items = tempSelector.Invoke(c).ToList()
});
}

public static IEnumerable<AggregateFunctionsGroup> ApplyGrouping<T>(this IQueryable<T> data, IList<GroupDescriptor> groupDescriptors)
{
Func<IEnumerable<T>, IEnumerable<AggregateFunctionsGroup>> selector = null;
foreach(var descriptor in groupDescriptors.Reverse())
{
var tempDescriptor = descriptor;
if(selector == null)
selector = g => BuildInnerGroup(g.Select(p => p), p => p.GetType().GetProperty(tempDescriptor.Member).GetValue(p, null), i => i.ToList());
else
selector = BuildGroup(p => p.GetType().GetProperty(tempDescriptor.Member).GetValue(p, null), selector);
}

return selector != null
? selector.Invoke(data).ToList()
: null;
}

For simple field it is working well.When I Group a field with complex type(Order.Name) i get the above error in ApplyGrouping function.In debug mode i see in ApplyGrouping function,the tempDescriptor.Member property value is Order.Name.I need to Split the property on dot(.) and make the grouping(like in the sorting which i already implemented for complex type). Please give a suggestion for grouping.i post the same issue in StackOverflow

http://stackoverflow.com/questions/22023649/telerik-grid-custom-bindinggrouping-on-complex-property

Sabbir
Daniel
Telerik team
 answered on 28 Feb 2014
4 answers
583 views
Hi guys, I have this grid:

@(Html.Kendo().Grid<Entity>(Model)
        .Name("valueGrid")
        .ToolBar(commands => commands.Create().Text("Add new value"))
        .Columns(columns =>
        {
            columns.Bound(c => c.DOMAINID).Visible(false);
            columns.Bound(c => c.CODE);
            columns.Bound(c => c.VALUE);
            columns.Command(command => { command.Edit().UpdateText("Save"); command.Destroy().Text("Delete"); });
        })
        //.Events(e => e.SaveChanges("OnSaveChanges"))
        .Sortable()
        .Scrollable()
        .DataSource(dataSource => dataSource       
        .Ajax()
        //.Events(e => e.Error("OnDatasourceError"))
        .ServerOperation(false)      
        .Model(m => m.Id(v => v.CODE))
        .Update(update => update.Action("UpdateValue", "DomainValue"))
        .Create(create => create.Action("CreateValue", "DomainValue"))
        .Destroy(delete => delete.Action("DeleteValue", "DomainValue"))
     )
    )

and I noticed that the delete action is called as soon as the user click on remove command, even if the confirmation popup is displayed.
I need to invoke the action only on the confirm from the user. I search a bit online but everyone is doing this with a custom popup.
I remember, however, that in another project I've done that automatically, but I wasn't using MVC back there.

Thanks
Fabio
Gaetano
Top achievements
Rank 1
 answered on 28 Feb 2014
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
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Licensing
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
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?