Telerik Forums
UI for ASP.NET MVC Forum
0 answers
158 views
There is problem with your MVC Upload(MVC Kendo Upload too). If you add file name with symbol Jon's.txt to Upload control the Upload file list will look like

<span class="t-filename" title="Jon" s.txt'="">Jon's.txt</span>

As you see the html is parsed incorrectly. Also we keep Upload file list hidden by default and manage our own file list. We use JS code below to delete file from Upload file list.

    function RemoveFile(fileName) {
        $('.t-filename[title="' + fileName + '"]').last().parent().remove();    
    }

And this code do not work on such file. Do you have any solution?

BTW it is not very smart to use file name as ID, why not to use GUID ID for files? 
Tomas
Top achievements
Rank 1
 asked on 26 Jul 2012
1 answer
466 views
Hi Support,

I need to create a treeview structure dynamically
 
Let me describe my scenario: I have four tables - Country, City, State and Suburb.
City has Country_ID as foreign key.
State has City_ID as foreign key.
Suburb has State_ID as foreign key.

 When I pass the Country_ID I need to show all the Cities related under that Country, similarly state related under that city and suburb related under that state in a tree structure.

How can I create the model for this scenario and does Telerikcontrol support this scenario.

Thanks
Saroj

 

Alex Gyoshev
Telerik team
 answered on 26 Jul 2012
1 answer
277 views
I know clientEvents has changed to Events for Kendo with AspNET MVC, but there doesn't seem to be an Edit event anymore, just Error and Change.

How do I define a function to fire onEdit?

From another post, this is the only way to be able to define the pop-up windows size, but it is also vital to be able to hide / show fields etc depending on whether the form is in insert or edit mode.
Atanas Korchev
Telerik team
 answered on 25 Jul 2012
1 answer
177 views
Is there an edit mode InForm in the official release?

Regards,
Andy
Top achievements
Rank 1
 answered on 24 Jul 2012
4 answers
642 views
I'm using the KendoUI for MVC Autocomplete extension with a Telerik MVC Extensions Grid and the Autocomplete is not displaying the available suggestions in a drop down list, and it's not "suggesting" anything even though I have .Suggest(true).

I have this in the Head section of the _layout.cshtml view...

@{Html.Telerik().StyleSheetRegistrar().StyleSheets(group => group.AddSharedGroup("SharedStyleSheets")).Render();}


<script src="@Url.Content("~/Scripts/2012.2.423/jquery.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/2012.2.423/kendo.web.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/2012.2.423/kendo.aspnetmvc.min.js")" type="text/javascript"></script>

... and this in the Global.asax file for the Shared stylesheets.

SharedWebAssets.StyleSheets(group => group
    .AddGroup("SharedStyleSheets", styles => styles
        .Add("2012.1.419/telerik.common.min.css")
        .Add("2012.1.419/telerik.web20.min.css")
        .Add("2012.2.423/kendo.common.min.css")
        .Add("2012.2.423/kendo.blueopal.min.css")
        .Combined(true)
        .Compress(true)
        ));

Am I missing something?

This is the HTML of the view.

@using (Html.BeginForm(MVC.Ctaf.SelectItems(), FormMethod.Post))
{
    <fieldset>
        <legend>Filter</legend>
        <p class="colx2-left">
            Class Name: @(Html.Kendo().AutoComplete()
                .Name("classname")
                .DataTextField("Class")
                .DataSource(source =>
                {
                    source.Read(read =>
                    {
                        read.Action("_AutocompleteClasses", "Ctaf");
                    }).ServerFiltering(false);
                })
                .Suggest(true)
            )
 
        </p>
        <p class="colx2-left">
            Subclass Name: @Html.TextBox("subclassname")
        </p>
 
        <p style="clear:both;">
            <input type="submit" value="Filter" />
        </p>
    </fieldset>
     
}
<p> </p>
@{Html.Telerik().Grid(Model.CtafList).Name("CtafGrid")
      .Columns(column =>
      {
          column.Bound(c => c.Id)
              .ClientTemplate("<input type='checkbox' name='checkedRecords' value='<#= Id #>' />")
              .Title("")
              .Width(36)
              .HtmlAttributes(new { style = "text-align:center" });
          column.Bound(c => c.Class);
          column.Bound(c => c.Subclass);
          column.Bound(c => c.Title);
      })
      .DataBinding(dataBinding => dataBinding.Ajax()
    .Select("_CheckBoxesAjax", "Ctaf"))
    .Scrollable()
    .Pageable(pager => pager.PageSize(40))
      .Render();
      }

This is my controller action.

public virtual ActionResult _AutocompleteClasses()
{
      stringresult = _ctafService.Get().Select(c => c.Class).Distinct().ToList();
 
    return Json(result, JsonRequestBehavior.AllowGet);
}

Any ideas?

Thanks.
King Wilder
Top achievements
Rank 2
 answered on 24 Jul 2012
1 answer
323 views
I am a newbie to Kendo UI and currently porting from the telerik mvc to Kendo UI for MVC . I have come across a problem when porting my grid from telerik mvc to kendo ui for mvc. I used the detail template approach for nested grids without a problem with telerik mvc , but when trying to port to client templates within kendo I am getting "Invalid Template" error.
 Am I missing something in my initial file includes.

<link rel="stylesheet" href="@Url.Content("~/Content/kendo.common.min.css")">
<link rel="stylesheet" href="@Url.Content("~/Content/kendo.silver.min.css")">
<script src="@Url.Content("~/Scripts/jquery.min.js")"></script>
<script src="@Url.Content("~/Scripts/kendo.all.js")"></script>
<script src="@Url.Content("~/Scripts/kendo.aspnetmvc.min.js")"></script>

Here is a snippet of code that uses a client template
@( Html.Kendo().Grid<DetailCategoryListingGridView>()
.Name("DetailCategoryGrid").
Columns(columns =>{
 columns.Bound(a => a.Value).Title(
"CategoryValue").Width(200);
columns.Bound(a => a.Comments).Title("Description");
columns.Bound(a => a.ModifiedDate).Title("LastUpdated").Format("{0:MM/dd/yyyy}").Width(150);
columns.Bound(a => a.ModifiedBy).Title("UpdatedBy").Width(150);
columns.Bound(a => a.DetailCategoryID).Title("UpdatedBy").Width(150);
columns.Command(commands =>
{
commands.Destroy();
commands.Edit();})
.HtmlAttributes(
new {style = "text-align:center"});
})

 

 .ClientDetailTemplateId("udfTemplate")
.Pageable().DataSource(dataBinding => dataBinding.Ajax()
.Read(read=>read.Action("FilteredDetailCategoryBinding", "DetailCategoryAdmin"))
.Create(create=>create.Action("InsertDetailCategory", "DetailCategoryAdmin"))
 .Update(update=>update.Action("UpdateDetailCategory", "DetailCategoryAdmin"))
.Destroy(destroy=>destroy.Action("DeleteDetailCategory", "DetailCategoryAdmin"))
 .Model(model => model.Id(a => a.DetailCategoryID)) .PageSize(15)

 )
 .Sortable()
 .Pageable(page=>page.PageSizes(true))
 //.Events(events => events.DataBound("dataBound")
  )

 

 

<script id="udfTemplate" type="text/kendo-tmpl">

 @(Html.Kendo().Grid<UDFInventoryTemplate>()
.Name("UDFInventoryDetails_#=DetailCategoryID#")
 .Columns(columns =>
{
columns.Bound(o => o.LabelValue);
columns.Bound(o => o.Status);
columns.Bound(o => o.ControlType);
 columns.Bound(o => o.ControlDataValues);
 columns.Bound(o => o.DefaultValue); })
.DataSource(dataSource => dataSource.Ajax() .Read(read=>read
.Action(
"FilteredUDFDetails", "DetailCategoryAdmin"))

).ToClientTemplate()
)
</script>


Thanks,
Jean-Paul

 

 

 

Iliana Dyankova
Telerik team
 answered on 24 Jul 2012
1 answer
443 views
UPDATE: NEVERMIND, THIS FEATURE IS AVAILABLE IN FINAL RELEASE



Hello,

I'm evaluating if we can port all features (that we need) of our Telerik MVC Extensions Grid to the Kendo UI MVC Grid. I wasn't able to find an equivalent to the ForeignKeyfeature, which we use like this:

@(Html.Telerik().Grid<RowModel>()
.DataBinding(dataBinding => dataBinding.Ajax().Select("_GetData", "Data"))
.Columns(x =>
    {
        x.Bound(y => y.Id).Width(40);
        x.Bound(y => y.Description).Width("40%");
        x.ForeignKey(y => y.SomeForeignId, Model.ForeignIdResolveCollection, "ID", "Name").Width("80%");
    })
)

We don't use the Built in edit features but it's very useful for the column filtering feature, for example. Is there a replacement for this feature, if not, will there be one in future?

Best regards
Thomas
andrew
Top achievements
Rank 1
 answered on 24 Jul 2012
2 answers
269 views
Hey

There is some error when I try use ForeignKeywith with Guid column.
(int) all works fine
columns.ForeignKey(c => c.MenuID, (System.Collections.IEnumerable)ViewData["Menus"], "MenuID", "MenuNazwa");


(Guid) its a error
columns.ForeignKey(c => c.UserId, (System.Collections.IEnumerable)ViewData["Users"], "UserId", "UserName");

Błąd: ReferenceError: UserId is not defined
Plik źródłowy: http://localhost:53048/Scripts/kendo.web.js
Wiersz: 347

Any ideas how fix this (change Guid to int is not a option)

Tx for help

PS. Whith old MVC extensions all works fine ...
Andrzej
Top achievements
Rank 2
 answered on 24 Jul 2012
1 answer
623 views
How do you specify where the data is in the response? In js I would specify that the total property is the "count" property and the data is in "data". I don't see how to do this in the MVC extensions.

schema: {
                    total: "count",
                    data: "data",
                    model: {
                        id: "Id",
                        fields: {
                            Id: { editable: false, type: "number" },
                            StartDate: { type: "date" },
                            EndDate: { type: "date" }
                        
                        }
                    }
                }
Vesselin Obreshkov
Top achievements
Rank 2
 answered on 24 Jul 2012
9 answers
269 views
Is there anyway of splitting this file as we are only using a few controls and would like to reduce the size of our js files as much as possible.
Many thanks
Vesselin Obreshkov
Top achievements
Rank 2
 answered on 24 Jul 2012
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
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?