Telerik Forums
UI for ASP.NET MVC Forum
1 answer
105 views
Hello there

I need  to run asp.net mvc scheduler demo in razor engine. How to accomplish this ? Please help.

Atanas Korchev
Telerik team
 answered on 30 Jan 2014
3 answers
93 views
hello there

is there a way to get the codes of demos in the following link  ?

http://demos.telerik.com/kendo-ui/web/overview/index.html






Iliana Dyankova
Telerik team
 answered on 29 Jan 2014
1 answer
110 views
I am using an editor template for a popup editor and I have Image uploader inside that I want to place the new image name in a field. But instead, after updating I see the previous image name getting posted.

In the template this is the field.
=========================================================================================
<input type="file" name="file" id="dataPhoto" />
<script>
    $("#dataPhoto").kendoUpload({

        async: {
            saveUrl: '@Url.Action("ImageSave","Data")',
            autoUpload: true
        },
        multiple: false,
        success: function (data) {
            alert(data.response.fileName);
            $('#DatumImageName').val(data.response.fileName);
        }
    });
</script>
<div class="editor-field">
    @Html.TextBoxFor(model => model.DatumImageName)
</div>
========================================================================================
@model Lifetech.Service.ApiModels.DatumApiModel
@(Html.Kendo().Grid<Lifetech.Service.ApiModels.DatumApiModel>()
    .Name("grid")
    .Columns(columns =>
    {
        columns.Bound(d => d.Title).Title("Title");
        columns.Bound(d => d.DatumImageName).ClientTemplate(
            "<img src='" + Url.Content("~/Images/Data/") +
            "#:data.DatumImageName#' alt='#: data.Title #' />"
            );

        columns.Bound(d => d.Description).Title("Description");
        columns.Bound(d => d.IsActive).Title("Is Active");
        columns.Bound(d => d.DisplayOrder).Title("Display Order");

        columns.Command(command => { command.Edit(); command.Destroy(); }).Title("Commands").Width(172);
    })        
    .ToolBar(toolbar => toolbar.Create())
        .Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("DataTemplate"))
    .Pageable()
    .Sortable()
    .Scrollable()
    .Filterable()
    .HtmlAttributes(new { style = "height:430px;" })
    .DataSource(dataSource => dataSource
               .Ajax()
                .PageSize(20)
                .Events(events => events.Error("error_handler"))
                .Model(model => model.Id(d => d.DataID))
                .Create(update => update.Action("Create", "Data", new { Id = ViewBag.ProductId }))
                .Read(read => read.Action("Read", "Data"))
                .Update(update => update.Action("Update", "Data"))
                .Destroy(update => update.Action("Destroy", "Data"))
    )
)
====================================================================================

If I edit the value in the textbox for the image name manually then it works, but I need it to be set through javascript as I have an image uploader.


Thanks,
Amit
Petur Subev
Telerik team
 answered on 29 Jan 2014
1 answer
118 views

Hello,

 

 

I have created a page with a grid and a filter section. The filter section has multiple AutoCompleteBoxes with InputType on Token, every time a token is added the grid gets filtered. This page works how it should work, but the grid and the AutoCompleteBoxes work with a LinqDataSource.

I have changed the datasource from the grid and the AutoCompleteBoxes to a EntityDataSource and every time I filter the grid and go to a other grid page I get this error: The LINQ expression node type 'Invoke' is not supported in LINQ to Entities.

This is how my code works:

When a token is added in a AutoCompleteBox this event get fired:

 

protected void RadAutoCompleteBoxSalesOrderNumber_Event(object sender, EventArgs e)
    {
      AutoCompleteBoxEntryCollection entries = ((RadAutoCompleteBox)sender).Entries;
      if (entries.Count != 0)
      {
        this.salesOrderNumber = entries[0].Text;
        ViewState["salesOrderNumber"] = entries[0].Text;
      }
      else
      {
        this.salesOrderNumber = null;
        ViewState["salesOrderNumber"] = null;
      }
    }


And this is the OnQueryCreated event the grid uses:

protected void EntityDataSourceGrid_QueryCreated(object sender, QueryCreatedEventArgs e)
    {
      IQueryable<vw_DeliveryLines> query = e.Query.OfType<vw_DeliveryLines>();
 
      e.Query = query.Where(GetData());
    }
 
private Expression<Func<vw_DeliveryLines, bool>> GetData()
    {
      var predicate = PredicateExtensions.True<vw_DeliveryLines>();
 
      if (!String.IsNullOrEmpty(salesOrderNumber))
        predicate = predicate.And(c => c.SODocNum.Equals(salesOrderNumber));
      if (salesOrderLineNumber > -1)
        predicate = predicate.And(c => c.SOLineNum.Equals(salesOrderLineNumber));
      if (!String.IsNullOrEmpty(deliveryNumber))
        predicate = predicate.And(c => c.DELDocNum.Equals(deliveryNumber));
      if (deliveryLineNumber > -1)
        predicate = predicate.And(c => c.DELLineNum.Equals(deliveryLineNumber));
 
      if (cardCode > -1)
        predicate = predicate.And(c => c.CardCode.Equals(cardCode));
 
      return predicate;
    }

I hope someone can help to fix my problem.

 

 

 

Petur Subev
Telerik team
 answered on 29 Jan 2014
1 answer
144 views

Hello,
i'm having trouble with kendo ui events handler.
When an error has been throwed from controller to the request response, the error is showed on an alert, like this:

@(Html.Kendo().Grid(Model)
      .Name("grid")
      .Events(e => e.Error("error")
//another declarations
 
function error (args){
   if (!args) return;
 
   if (args.errors) alert(args.errors)
}

The problem is when the delete request is make again, the grid makes the requisition again, and keep maintaining the request makes before, doing multiple requests.




Alexander Popov
Telerik team
 answered on 29 Jan 2014
6 answers
684 views
I'm trying to use Upload inside Grid with GridEditMode.PopUp

I have already created custom Edit Template for property:

    public class Contact
    {
        [UIHint("PhotoFileNameEditor")]
        public string PhotoFileName { get; set; }
    }
}

@(Html.Kendo().Upload()
    .Name("PhotoFileName")
    .Multiple(false)
    .Async(async => async.Save("SavePhoto", "Contact").Remove("RemovePhoto", "Contact").AutoUpload(true))
)

And Save method
  public ActionResult SavePhoto(IEnumerable<HttpPostedFileBase> PhotoFileName)
        {
            if (PhotoFileName != null)
            {
                foreach (var file in PhotoFileName)
                {
                    var fileName = Path.GetFileName(file.FileName);
                    var physicalPath = Path.Combine(Server.MapPath("~/Images/"), fileName);
                     file.SaveAs(physicalPath);
                }
            }
            return Content("");
}

It saves the file without problem, but Contact.PhotoFileName is not changed so the PopUp form is not submited at all.

How do I change the value of PhotoFileName so i can save it to database?

Thank you
amit
Top achievements
Rank 1
 answered on 28 Jan 2014
4 answers
185 views
I recently updated to the latest version and previously did some custom css to pull in white icons instead of black but that is no longer working. Is there anyway to change the filter/sort icons from black to white?
Justin
Top achievements
Rank 1
 answered on 28 Jan 2014
1 answer
186 views
http://www.kendoui.com/code-library/mvc/mvc/scheduler/custom-editor.aspx

Hi everyone,
I want to create custom editor which is given above link. However, I want to add extra fields from my tablo this custom editor. Although I add extra fields such as example codes at below;

//extra field
  public int ZTip { get; set; }

//Schedler
 @(Html.Kendo().Scheduler<ZiyaretHareketleri>()
    .Name("scheduler")
    .Date(new DateTime(2014, 1, 20))
    .StartTime(new DateTime(2014, 1, 20, 7, 00, 00))
        //.Height(600)
    .AllDaySlot(false)  
       .Editable(e =>
           {             
               e.TemplateName("CustomEditorTemplate");
           })
    .Views(views =>
    {
        views.DayView(d => d.Footer(false));
        views.WeekView(WeekView =>
        {
            WeekView.Selected(true);
            WeekView.Footer(false);
        });
        views.MonthView();
        views.AgendaView();
    })
    .Timezone("Etc/UTC")
    .Group(group => group.Resources("Attendees").Orientation(SchedulerGroupOrientation.Vertical))
             .Resources(resource => resource.Add(m => m.OwnerID)
                                            .Title("Kullanıcılar")
                                            .Name("Attendees")
                                            .DataTextField("Name")
                                            .DataValueField("UserId")
                                            .DataColorField("Colour")
                                            .DataSource(ds => ds.Read("GetKullanici", "Home"))
                                          
                                            )
    .DataSource(d => d
        .Model(m =>
        {
            m.Id(f => f.TaskID);
            m.Field(f => f.Title).DefaultValue("Yeni Ziyaret");
            m.Field(f => f.OwnerID).DefaultValue(1);
            m.Field(f => f.Start);
            m.Field(f => f.End);
            m.Field(f => f.Description);
            m.Field(f => f.IsAllDay);
            m.Field(f=>f.ZTip); // Extra Field
            
        })
        .ServerOperation(true)
       .Read(read => read.Action("Read", "Home").Data("filterData"))
        .Create("Create", "Home")
        .Destroy("Destroy", "Home")
        .Update("Update", "Home")

    )
      )

//Custom Editor
<div data-container-for="ZTip" class="k-edit-field">
    @(Html.TextBoxFor(model => model.ZTip, new { @class = "k-textbox", data_bind = "value:ZTip" }))
</div>

always I have been getting zero value from input. 



Daniel
Telerik team
 answered on 28 Jan 2014
0 answers
148 views
Hello there

I am trying to make work an online demo. I have a problem with unrecognized namespace

using kendo.mvc.examples.models

and 

productservice

as attached this thread.  Please help me what procedure should I follow...
TURKALP
Top achievements
Rank 1
 asked on 28 Jan 2014
1 answer
48 views
Hi,

Kendo MVC Grid is not binding the data initially. But when i do sorting on column, it loads data after sorting.


Can you tell me what may teh cause for this?
Atanas Korchev
Telerik team
 answered on 27 Jan 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?