Telerik Forums
UI for ASP.NET MVC Forum
2 answers
824 views
Model.RowVersion (TimeStamp) field is NULL when inline editing a row that includes a TimeStamp byte[] field, when inspecting the Model.RowVersion value in the UPDATE Controller action. 

I require this field because I am doing concurrency checking on the database when I update a row?

To get around this I will probably change the database data type from a TimeStamp to a UniqueIdentifier (GUID) or INT see: http://stackoverflow.com/questions/1687555/version-number-or-timestamp-for-optimistic-concurrency
columns.Bound(f => f.FluidID).Title("ID").Width(50).Hidden();
columns.Bound(f => f.Name).Title("Name");
columns.Bound(f => f.Code).Title("Code");
columns.Bound(f => f.Grade).Title("Grade");
columns.Bound(f => f.Manufacturer).Title("Manufacturer");
columns.Bound(f => f.RowVersion).Title("RowVersion").Hidden().IncludeInMenu(false);
columns.Command(command => { command.Edit(); command.Destroy(); }).Width(182);
Similar questions here:
http://stackoverflow.com/questions/16043026/kendo-ui-for-asp-net-doesnt-render-byte

http://www.kendoui.com/forums/ui/grid/bind-rowversion-field-to-popup-editor-byte.aspx#boFAeK6aG2OF1P8AAFTdxQ

http://www.kendoui.com/forums/mvc/general-discussions/683462-byte-array-rowversion-doesn-t-render-properly.aspx


Adam
Top achievements
Rank 1
 answered on 23 Jul 2015
4 answers
311 views
Hello, 
i need a help to use custom command in hierarchy grid. to add, edit and delete parent and child in the same grid.
Could you help me please. 

Thanks

DHHS
Top achievements
Rank 1
 answered on 23 Jul 2015
5 answers
131 views

Hi,

In all my projects using kendo, I have a problem with the culture. I set the culture in french but sometimes, the culture come back in english. So what I did exactly, in my main layout, i set the cultre like this : <script> kendo.culture("fr-FR"); </script> and in my references I included Kendo.Mvc.resources.

Did i forget something ?

 

Thanks by advance

Philippe
Top achievements
Rank 1
 answered on 23 Jul 2015
2 answers
2.2K+ views

I am looking to filter the datasource for Grid with a CompositeFilterDescriptor instead of just a FilterDescriptor so I can set the or condition. I can't quite figure out a way to do this using the example on your site as well as playing around with the different constructors for the add method. The add methods only take a FilterDescriptor.  Below is an example from your site, is this possible using the Filter() Method on the grid to asdd

 

@(Html.Kendo().Grid<Product>()
    .Name("grid")
    .DataSource(dataSource => dataSource
        .Ajax()
        .Read(read => read.Action("Products_Read", "Home"))
        .Filter(filters =>
        {
            // Show products whose ProductName property contains "C"
            filters.Add(product => product.ProductName).Contains("C");
            // and UnitsInStock is greater than 10
            filters.Add(product => product.UnitsInStock).IsGreaterThan(10);
        })
    )
)     

Ray
Top achievements
Rank 1
 answered on 23 Jul 2015
7 answers
2.2K+ views
Hi,

How can I  format my date to MM/dd/yyyy in client template? It seems that Format method doesn't work for client templates. Also, I need to sort column that contains date.

Thanks in advance,
Dzmitry Shmidt
Imran
Top achievements
Rank 1
 answered on 23 Jul 2015
1 answer
591 views

Hi , i have he following code in myview of businessunit grid.

 while displaying it the businessunit grid and edit businessunit pages it reflects wrong date format be default- 01/01/0001 instead of the actual date  though there is an actual and corect date in database.

i am using sql server 2014 .

 

businessunit view

@{
    Layout = null;
}

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


<div>
    @(Html.Kendo().Button()
        .Name("textButton")
        .HtmlAttributes(new { type = "Add BusinessUnit", @class = "btn-primary mar-b-10" })
        .Content("Add BusinessUnit"))
</div>
<div id="businessunit"  >
    @(Html.Kendo().Grid<BHEBS.Areas.Admin.Models.ModalfBusinessUnit>()
    .Name("BusinessUnitGrid")
            .Events(events => events.Change("Grid_OnRowSelect"))
    .Columns(columns =>
    {
        columns.Bound(b => b.BusinessUnit).Width(40); ;
        columns.Bound(b => b.Fund).Width(30);
        columns.Bound(b => b.FundPurpose).Width(40);
        columns.Bound(b => b.ServiceType).Width(40);
        columns.Bound(b => b.GrantNumber).Width(40);
        columns.Bound(b => b.StartDate).Format("{0:MM/dd/yyyy}").Width(30);
        columns.Bound(b => b.EndDate).Format("{0:MM/dd/yyyy}").Width(30);
        columns.Bound(b => b.id).Visible(false);
        columns.Bound("").ClientTemplate("<button class='btnGrid btn btn-primary btn-sm' data-id='#:id#' onclick='gridBtnClick(this)'><span class='edit_icon glyphicon glyphicon-pencil' aria-hidden='true'></span>Edit</button> <button class='btnGrid btn btn-primary btn-sm' data-id='#:id#' value='View' onclick='gridBtnClick(this)'><span class='edit_icon glyphicon glyphicon-eye-open' aria-hidden='true'></span>View</button>").Width(40);

    })
    .HtmlAttributes(new { style = "height: 410px;" })
        .ToolBar(tools => tools.Excel())
        .Scrollable()
        .Sortable()
                .Excel(excel => excel
                .FileName("BusinessUnit.xlsx")
                .Filterable(true)
                     .ProxyURL(Url.Action("Excel_Export_Save", "Grid"))

                    )
        .ColumnMenu()
         .Filterable()
        .Pageable(pageable => pageable
            .Refresh(true)
            .PageSizes(true)
            .ButtonCount(5))
            .Resizable(resize => resize.Columns(true))
                       .Selectable(selectable => selectable
                            .Mode(GridSelectionMode.Multiple))
        .DataSource(dataSource => dataSource
            .Ajax()
                    .Read(read => read.Action("GetBusinessUnitData", "BusinessUnit"))
                    
        )
    )
</div>
<br />
@(Html.Kendo().Button()
        .Name("textButtonAA")
        .HtmlAttributes(new { type = "Add BusinessUnit", @class = "btn-primary mar-b-10" })
        .Content("Add BusinessUnit AA"))
<div id="businessunitaa"  >
    @(Html.Kendo().Grid<BHEBS.Areas.Admin.Models.ModalfBusinessUnitAA>()
            .Name("BusinessUnitGridAA")
    .Columns(columns =>
    {

        columns.Bound(b => b.SpendPriority).Width(40); ;
        columns.Bound(b => b.Description).Width(80);
        columns.Bound(b => b.StartDate).Format("{0:MM/dd/yyyy}").Width(30);
        columns.Bound(b => b.EndDate).Format("{0:MM/dd/yyyy}").Width(30);
        columns.Bound(b => b.InitTotalAuth).Width(35);
        columns.Bound(b => b.InitAvailable).Width(35);
        columns.Bound(b => b.Id).Visible(false).Width(10);
        // columns.Bound("").ClientTemplate("<button class='btnGrid btn btn-primary btn-sm' data-id='#:Id#' onclick='gridAAClick(this)'><span class='edit_icon glyphicon glyphicon-pencil' aria-hidden='true'></span>Edit</button><button class='btnGrid btn btn-primary btn-sm' data-id='#:Id#' onclick='gridAAClick(this)'><span class='edit_icon glyphicon glyphicon-eye-open' aria-hidden='true'></span>View</button>").Width(50);
        columns.Bound("").ClientTemplate("<button class='btnGrid btn btn-primary btn-sm' data-id='#:Id#' onclick='gridAAClick(this)'><span class='edit_icon glyphicon glyphicon-pencil' aria-hidden='true'></span>Edit</button> <button class='btnGrid btn btn-primary btn-sm' data-id='#:Id#' value='View' onclick='gridAAClick(this)'><span class='edit_icon glyphicon glyphicon-eye-open' aria-hidden='true'></span>View</button>").Width(40);

    })
    .HtmlAttributes(new { style = "height: 410px;", })
        .ToolBar(tools => tools.Excel() )
        .Scrollable()
        .Sortable()
        .Excel(excel => excel
        .FileName("BusinessUnitAA.xlsx")
        .Filterable(true)
             .ProxyURL(Url.Action("Excel_Export_Save", "Grid"))
             
            )
        .ColumnMenu()
        .Filterable()
        .Pageable(pageable => pageable
            .Refresh(true)
            .PageSizes(true)
            .ButtonCount(5))
            .Resizable(resize => resize.Columns(true))
                           .Selectable(selectable => selectable
                    .Mode(GridSelectionMode.Multiple))
                .Navigatable()
                .Navigatable()
        .DataSource(dataSource => dataSource
            .Ajax()
                    .Read(read => read.Action("GetBusinessUnitAA", "BusinessUnit").Data("additionalInfo"))
                               )

                              
    )
    
</div>
<script>
    var id = 0;
    Grid_OnRowSelect = function (e) {
        var data = this.dataItem(this.select());
        id = data.id;
        $('#BusinessUnitGridAA').data('kendoGrid').dataSource.read();
        $('#BusinessUnitGridAA').data('kendoGrid').refresh();
        //   alert("1 st grid :" + data.id);//IMP

    }
    function additionalInfo() {
        //alert(id);
        return { AdditionalParam: id };
    }
    function doOnRowSelect(e) {
        var selectedItem = this.dataItem(this.select());
        alert(selectedItem.ShipName);
    }
    function formatDate(date) {
        debugger;
        switch (flag) {
            case 1:
                return kendo.toString(date, "g");
            case 2:
                return kendo.toString(date, "d");
            case 3:
                return kendo.toString(date, "Y");
            default:
                return kendo.toString(date, "F");
        }
    }
    $('#textButton').on('click', function () {
        $.ajax({
            url: '@Url.Action("AddBusinessUnit", "BusinessUnit")',
            type: 'GET',
            success: function (data) {
                $('#AddBusinessUnitDiv').html(data);
            },
            error: function () {
                console.log("add business unit error rendering page");
            }
        });
    });
    $('#textButtonAA').on('click', function () {
        if (id == 0) {
            alert("Select one row on the BusinessUnit grid");
        }
        else {
            $.ajax({
                url: '@Url.Action("AddBusinessUnitAA", "BusinessUnit")' + '?BU_Id=' + id,
                type: 'GET',
                success: function (data) {
                    $('#AddBusinessUnitDiv').html(data);
                },
                error: function () {
                    console.log("add business unit aa error rendering page");
                }
            });
        }
    });


</script>
<style>
    .row div:nth-child(even) {
        background-color: #F9F9F9;
    }

    .row div:nth-child(odd) {
        background-color: #aaaaaa;
    }
</style>

 

 

 

 â€‹

 please suggest.

 

Georgi Krustev
Telerik team
 answered on 22 Jul 2015
1 answer
656 views
The MVC Grid component has an option to specify a template for its Toolbar so you can add additional buttons and other things. However, I can't seem to find similar functionality for the MVC Scheduler. Can custom buttons be added to the Scheduler toolbar?
Alexander Popov
Telerik team
 answered on 22 Jul 2015
6 answers
206 views

Hi,

I got some problems when I using virtualization of local data on MultiSelect widget.

Here I leave a sample video and source code.

Hope to get some helps.

 

Georgi Krustev
Telerik team
 answered on 22 Jul 2015
2 answers
163 views

Hi,

 I've added a collapse/expand all option to my treeview, which works fine, but doesn't have any slide effects.  On the demo one (http://demos.telerik.com/kendo-ui/treeview/api) it has slide effects for this.

Are there settings I need to apply somewhere to make this work?  I have 3 treeviews on top of each other and my button works for all at once - here are the relevant bits of javascript code :-

// 1. collapse all treeview nodes
var treeview = $("#TreeViewSurveyByRisk").data("kendoTreeView").collapse(".k-item");
var treeview = $("#TreeViewSurveyByRecAction").data("kendoTreeView").collapse(".k-item");
var treeview = $("#TreeViewSurveyByLocation").data("kendoTreeView").collapse(".k-item");

// 2. expand all treeview nodes
var treeview = $("#TreeViewSurveyByRisk").data("kendoTreeView").expand(".k-item");
var treeview = $("#TreeViewSurveyByRecAction").data("kendoTreeView").expand(".k-item");
var treeview = $("#TreeViewSurveyByLocation").data("kendoTreeView").expand(".k-item");

Any help would be appreciated.

Thanks, Mark

Mark
Top achievements
Rank 1
 answered on 22 Jul 2015
1 answer
86 views

Hello,

I have reviewed the documentation here: http://docs.telerik.com/kendo-ui/browsers-support

And have ensured I have the correct DOCTYPE and IE-Edge tags implemented.

When opening your Demo here: http://demos.telerik.com/kendo-ui/map/index

IE11 reacts to a pinch on the map control by trying to shrink the page.

Chrome on the other hand will zoom the map out.

Thanks,

Aaron

Atanas Georgiev
Telerik team
 answered on 22 Jul 2015
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
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?