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

I've got a grid with a custom command that redirects the user to a details page.

@(Html.Kendo().Grid<VehicleGroupGridRow>()
    .Name("VehicleGroupGrid")
    .Columns(column =>
    {
        column.Bound(p => p.Title);
        column.Command(command => {
            command.Edit();
            command.Destroy();
            command.Custom("View").Click("onViewClick");
        });
    })
    .ToolBar(commands => commands.Create())
    .Editable(editable => editable.Mode(Kendo.Mvc.UI.GridEditMode.InLine))
    .Sortable()
    .DataSource(dataSource => dataSource
            .Ajax()
            .Events(events => events.Error("error_handler"))
            .Model(model => model.Id(p => p.Id))
            .Create(create => create.Action("CreateVehicleGroup", "VehicleGroup"))
            .Read(read => read.Action("GetVehicleGroups", "VehicleGroup"))
            .Update(update => update.Action("UpdateVehicleGroup", "VehicleGroup"))
            .Destroy(destroy => destroy.Action("DestroyVehicleGroup", "VehicleGroup"))
    )
     
)

<script type="text/javascript">
 
    function onViewClick(e) {
        e.preventDefault();
 
        var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
        var actionUrl = "@Url.Action("Details", "VehicleGroup", new { Id = "PLACEHOLDER" })";
 
        window.location = actionUrl.replace('PLACEHOLDER',dataItem.Id);
    }
 
</script>

In IE9 when you press the browser back button the "View" button is not visibile, its working for Firefox and Chrome however

Thanks
Atanas Korchev
Telerik team
 answered on 27 Jul 2012
1 answer
602 views
How can i stop the window from opening on page load.
All the examples open the window straight away.
I would like to only open it when the user clicks a button on the page.

here is my code:

<div class="CintTxtBlockWide">
        <span id="openEmail" class="CintSlide"><img src="../../Images/email.jpg" />Keep yours email in the cloud</span>
        <span id="openBox" class="CintSlide"><img src="../../Images/file.jpg" />Your Files in the cloud</span>
        <span id="openDesk" class="CintSlide"><img src="../../Images/desktop.jpg" />Your Desktop in the cloud</span>
        @(Html.Kendo().Window()
            .Name("window")
            .Content(@<text>
                <p>
                    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris venenatis, sem sed semper fermentum, leo magna egestas felis, eu dictum nunc nisi eget massa. Nulla diam felis, condimentum sed commodo a, rutrum at metus. Vestibulum consequat volutpat dapibus. Pellentesque vitae sollicitudin nulla. Suspendisse sapien lectus, convallis at vestibulum non, semper sed odio. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris mauris diam, dictum vitae vestibulum non, iaculis id nisi.
                </p>
                <span id="closeWindow">Close</span>
            </text>)
            .Width(420)
            .Height(440)
        )
    </div>
 
<script>
    $(document).ready(function () {
        var desk = $("#window");
 
        $("#openEmail").click(function (e) {
            desk.data("kendoWindow").open();           
        });
        $("#openBox").click(function (e) {
            desk.data("kendoWindow").open();
        });
        $("#openDesk").click(function (e) {
            desk.data("kendoWindow").open();
        });
         
        $("#closeWindow").click(function (e) {
            desk.data("kendoWindow").close();
        });
 
    });
</script>
Andrew
Top achievements
Rank 1
 answered on 27 Jul 2012
1 answer
149 views
Hi,

I have noticed the following bug.
If you use an input wrapper such as NumericTextBoxFor(), DropdownlistFor() ... , the unobstrusive validation attributes are not rendered when passing in a nested property.

For example, this will work as expected and output the validation attributes ( such as data-required...)
NumericTextBoxFor(model => model.FirstName)

However, the following will not render the validation attributes:
NumericTextBoxFor(model => model.Person.FirstName)

Regards,

Yann
Georgi Krustev
Telerik team
 answered on 27 Jul 2012
1 answer
221 views
I am attempting to edit data in pop-up mode.  The issue is with a numeric field that is being validated to have a value, but the model allows for a nullable decimal.  I am also using the EditorTemplate as provided by Telerik for currency values.

The validator says "The field 'X' must be a number".  How can I allow the grid to allow nullable currency values during edit mode.

As a side note, I have noticed with Web UI Grid that you can set nullable on fields as follows:
schema: {
 model: {
   id: "Id",
   fields: {
      ACurrencyField: { editable: true, nullable: true },
            }
        }
     }


Rosen
Telerik team
 answered on 27 Jul 2012
1 answer
164 views
Can you tell me why my logon page is rendering the textbox incorrectly... url is below:

http://bs.managewithease.com

This is specifically occurring on Mobile devices for Android... it appears to work as expected on iPhone...
Kamen Bundev
Telerik team
 answered on 27 Jul 2012
4 answers
217 views
Guys,

I seem to have boxed myself into a corner and hope someone can help.  

I am working on a new MVC 3 front end to an existing large app, which previously used a Windows Forms front end.  I have made some progress using Syncfusion controls, but find them a bit flaky, so and trying out the MVC wrapper for Kendo.

The app uses a hash-based URL scheme like GMail, so that it loads panels inside the main frame for a smoother and faster experience.  The panels include grids, tabs etc.  using partial views.  The rendering is server side.

My problem is that the Kendo grid  with MVC wrappers (server-bound to iEnumerable lists)  seems to want do a whole page GET to sort a column, which breaks my scheme, since it just loads the page without the main frame.  I thought maybe I could use the Ajax mode, but this wants to serial all of my object properties - which is large and rambling and not something I want to reinvent to fit into a view - in fact it throws a circular reference error, which is quite believable.

Any ideas?  Is my planned doomed?

Mark
Mark
Top achievements
Rank 1
 answered on 26 Jul 2012
1 answer
214 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
149 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
456 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
271 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
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
Security
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
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?