Telerik Forums
UI for ASP.NET MVC Forum
1 answer
230 views
Hi, 

I am attempting to create a grid that uses a WCF service as the datasource it is bound to. This has started well... I am able to pass back the data and have incorporated paging & sorting.

I am now looking at incorporating the Grouping and Filtering features, however this is proving problematic.

What I would like to do is pass the 'DataSourceRequest' directly to WCF as it contains all the arguments regarding the sorting, filtering & grouping in it

e.g. 
public ActionResult Index([DataSourceRequest(Prefix = "Grid")] DataSourceRequest request)
        {
            if (request.PageSize == 0)
            {
                request.PageSize = 10;
            }
 
            MvcApplication3.psr.ProductServiceClient psrc = new MvcApplication3.psr.ProductServiceClient();
 
             ResultData results = psrc.KendoGridQuery(DataSourceRequest);
 
            ViewData["total"] = results.Count;
          
             return View(results.Data);
         
        }

I then tried to add the Kendo.MVC library to my WCF project as a reference library so that I would be able to use the DataSourceRequest type.... However when I add the Kendo.MVC.dll as a reference and then compile the project it is unable to import the Kendo namespace.

I assume this is because the wrapper will only work within a MVC project?

Is it possible to add the data types from the MVC wrapper to my WCF project?

Thanks

Chris
Atanas Korchev
Telerik team
 answered on 26 Jul 2012
0 answers
162 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
478 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
280 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
181 views
Is there an edit mode InForm in the official release?

Regards,
Andy
Top achievements
Rank 1
 answered on 24 Jul 2012
4 answers
661 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
336 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
457 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
281 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
644 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
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
LLM Kit
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?