Telerik Forums
UI for ASP.NET MVC Forum
5 answers
146 views

Hello,

I try to color "isAllDay" event.
The simpliest way for me to do somethiong like this:

// Couleur isAllDay
r.Add(m => m.IsAllDay)
.Title("Supprimé")
.DataTextField("Text")
.DataValueField("Value")
.DataColorField("Color")
.BindTo(new[] {
                new { Text = "Journée", Value = 1 , Color = "red" },
});

 

But it's not working. I also tried Convert.ToBoolean(1), but it the same issues.

Do you have any advice ?

Thank you

Plamen
Telerik team
 answered on 05 Mar 2018
2 answers
213 views

Hi,

 

I've used your custom bindings page (https://demos.telerik.com/aspnet-mvc/grid/customajaxbinding) to help create a view i wanted but i noticed you haven't supplied code to help with the aggregates, can you please supply or is there a reason this hasn't been added?

 

Many thanks,
Lee.

Lee
Top achievements
Rank 1
Veteran
 answered on 02 Mar 2018
1 answer
438 views

HI

There have a problem about PanelBar.ExpandMode(PanelBarExpandMode.Single) : 

When user expand one item then other expanded item will collapse automatically (THIS IS OK),
but when user click the EXPANDED ITEM, that item will not collapse.

How can I collapse the EXPANDED ITEM while PanelBar.ExpandMode(PanelBarExpandMode.Single) ?

Best regards

Chris

 

 

 

Neli
Telerik team
 answered on 02 Mar 2018
5 answers
530 views

I'm attempting to test out how the Telerik (Kendo) grid will work in a current application I have but am running into some roadblocks.

I have a WebApi controller which inherits from ApiController and implements the following "Get" method:

[System.Web.Http.HttpGet, System.Web.Http.Route(LookupUrl.MyLookup)] public DataSourceResult Get([System.Web.Http.ModelBinding.ModelBinder(typeof(WebApiDataSourceRequestModelBinder))]DataSourceRequest request)        

{

            return service.GetModels().ToDataSourceResult(request);

}

and in the .cshtml file I have:

@(Html.Kendo().Grid<MyModel>()           .Name("telerikGrid")           .Columns(col =>           {               col.Bound(c => c.Key);               col.Bound(c => c.DisplayName);               col.Bound(c => c.Inactive);           })           .Scrollable()           .Groupable()           .Sortable()           .Filterable()           .Pageable(pageable => pageable               .Refresh(true)               .PageSizes(true)               .ButtonCount(5))           .DataSource(d =>               d.WebApi()                   .Model(model =>                   {                       model.Id(p => p.Key);                   })                   .Events(events => events.Error("error_handler"))                   .Read(read => read.Url(Url.ApiUrl(LookupUrl.MyLookup)))           )     )

 

The grid shows up correctly on the page, but the controller method is never accessed.  I'm not entirely sure what I am doing wrong here.

Joel
Top achievements
Rank 1
 answered on 02 Mar 2018
1 answer
151 views

I have a set of grids, one acting as a main grid, which is editable, and works fine. 

There is then a detail grid. When the detail grid is set to not editable, by commenting out all editable/command/toolbar sections, it works fine. However, upon including even just one of those, it causes an invalid template error. Code is included below for the two grids. the second one is the one causing the issue. 

 

 

@(Html.Kendo().Grid<eCurriculumAdminJunior.Models.Feedback.Section>()
    .Name("SectionGrid")
    .Columns(col =>
    {
        col.Bound(x => x.position).Title("Section").ClientTemplate("Section #=position#").HtmlAttributes(new { style = "width: 40%" });
        col.Bound(x => x.viewableby).Title("Visibility").EditorTemplateName("VisibleTo").ClientTemplate("#=ArrayToString(data.viewableby)#").HtmlAttributes(new { style = "width: 30%" });
        col.Command(command =>
        {
            command.Edit().IconClass("glyphicon glyphicon-edit").Text(" ").HtmlAttributes(new { style = "text-decoration: none" });
            command.Destroy().IconClass("glyphicon glyphicon-ban-circle").Text(" ").HtmlAttributes(new { style = "text-decoration: none" });
        }).Width("5em").Title(" ");
    })
    .RowAction(row => row.DetailRow.Expanded = true)
    .ToolBar(x => x.Create())
    .Events(x => x.Edit("defaultSectionIndexer"))
    .Editable(x => x.Mode(GridEditMode.InLine))
    
    .DataSource(ds => ds.Ajax()
        .Model(m =>
        {
            m.Id(i => i.id);
            m.Field(f => f.id).DefaultValue(-1).Editable(false);
            m.Field(f => f.position).DefaultValue(-1).Editable(false);

        })
        .Batch(false)
        .ServerOperation(false)
        .Read(r => r.Action("ReadSection", "FeedbackForm", new { formID = Model }))
        .Update(u => u.Action("UpdateSection", "FeedbackForm"))
        .Create(c => c.Action("CreateSection", "FeedbackForm", new { formID = Model }))
        .Destroy(d => d.Action("DeleteSection", "FeedbackForm"))
        .Sort(s => s.Add(x => x.position))
    ).ClientDetailTemplateId("sectionHeaderTemplate")
)
<script id="sectionHeaderTemplate" type="text/kendo">

    <text>Headers</text>
    @(Html.Kendo().Grid<eCurriculumAdminJunior.Models.Feedback.SectionHeader>()
        .Name("SectionHeaderGrid#=id#")
        .Columns(col =>
        {
            col.Bound(c => c.position).Hidden(true);
            col.Bound(c => c.text).EditorTemplateName("RichText").HtmlAttributes(new { style = "width: 60%" });
            col.Bound(c => c.viewableby).Title("Visibility").EditorTemplateName("VisibleTo").ClientTemplate("#=ArrayToString(data.viewableby)#").HtmlAttributes(new { style = "width: 30%" });
            col.Command(command =>
            {
                command.Edit().IconClass("glyphicon glyphicon-edit").Text(" ").HtmlAttributes(new { style = "text-decoration: none" });
                command.Destroy().IconClass("glyphicon glyphicon-ban-circle").Text(" ").HtmlAttributes(new { style = "text-decoration: none" });
            }).Width("5em").Title(" ");
        })
        .ToolBar(t =>
        {
            t.Create();
        })
        .DataSource(ds => ds.Ajax()
        .Model(m =>
        {
            m.Id(id => id.id);
            m.Field(f => f.id).DefaultValue(-1);

        })
        .ServerOperation(false)
        .Read(r => r.Action("ReadSectionHeader", "FeedbackForm", new { sectionID = "#=id#" }))
        .Update(u => u.Action("UpdateSectionHeader", "FeedbackForm"))
        .Create(c => c.Action("CreateSectionHeader", "FeedbackForm",new { sectionID = "#=id#" }))
        .Destroy(d => d.Action("DeleteSectionHeader", "FeedbackForm"))
        ).ToClientTemplate()
    )
    <text>Content</text>
   
</script>

Anita
Top achievements
Rank 1
Iron
 answered on 02 Mar 2018
1 answer
124 views

Hello,

I am trying to implement the Grid / Checkbox selection feature in a grid which is inside a ClientDetailTemplate.

But I am in face of a disturbing issue since the selection is always done in the grid which belongs to the first detail template.

To be clear suppose that we have 2 master grids and 2 childs in their own detail template. Expand both the details of the 2 master grids. Then try to select all the rows of the 2nd nested grid by checking the header. The result is not the expected one because all the rows of the 1st nested grid are selected.

 

Hereafter my shortened view code:

@(Html.Kendo().Grid<SellerViewModel>()                           

    .Name("SellersGrid")

    .Columns(columns =>

    {

                 columns.Bound(p => p.SellerId).Hidden();

                 columns.Bound(e => e.Name);

)

                          .Events(e =>                           {                               e.DataBound("onHostSellersDataBound");                           })                           .Filterable()                           .Pageable(pager => pager.ButtonCount(3))                           .Editable(editable => editable.Mode(GridEditMode.InCell))                           .Sortable(sortable => sortable                               .AllowUnsort(true)                               .SortMode(GridSortMode.MultipleColumn))                           .ClientDetailTemplateId("marketplaces_template")                           .DataSource(dataSource => dataSource                               .Ajax()                               .Read(read => read.Action("GetHostSellers", "CompetitorGroup", new { competitorGroupId = Model.CompetitorGroupId }))                               .Sort(sort => sort.Add("IsSelected").Descending())                               .PageSize(25)                               .Model(model =>                               {                                   model.Id(p => p.UniqueId);                                   model.Field(p => p.SellerId).Editable(false);                                   model.Field(p => p.IsSelected).Editable(true);                                   model.Field(p => p.Name).Editable(false);                                   model.Field(p => p.IsActive).Editable(false);                               })                               .ServerOperation(false))                     )

Preslav
Telerik team
 answered on 02 Mar 2018
1 answer
265 views

Hello, 

I am trying to create a week view for the kendo scheduler, in which the week day columns adjust in width depending on the amount of events for particular major tick. Currently the issue is that if i have more than 1 event per tick the events widths shrink and i can no longer see any relevant information. when my system may produce 10 events per tick all the events are then reduced to thin coloured line.

I've tried setting fixed width and altering widths on data bound, extending the current week view and creating a custom week view from your Implement More Events Button in Week View of Scheduler.

Then i decided to pivot and try stack the events in a similar fashion to boostrap columns but

https://www.telerik.com/forums/horizontal-event-spacing-when-column-has-multiple-events

this thread stated that its not possible to alter events positioning or ordering, is this true?

Is there any direction you can point me in or any advise you can give me?

because im pretty stumped at this point

King regards 

Andy

Plamen
Telerik team
 answered on 02 Mar 2018
2 answers
253 views

Hello,

i have updated to the latest version 2018.1.117 and using theme bootstrap v4

Now there are 2 pagers, see attachment. Is there a way to fix this?

 

Greetings, Oliver

 

Oliver
Top achievements
Rank 1
 answered on 02 Mar 2018
1 answer
139 views

Hi friends, I have got 4 records in the first filter (multi check boxes) attempt, now I want to filter in those 4 records for the second time.How to get this?Please help.

My code-

  @(Html.Kendo().Grid(Model).Name("grid").Columns(column =>
                                                  {                                                     
                                                      column.Bound(x => x.ProductID).Filterable(ftb => ftb.Multi(true).Search(true));
                                                      column.Bound(x => x.RackID).Filterable(ftb => ftb.Multi(true).Search(true));                                         
                                                      column.Bound(x => x.ProductName).Filterable(ftb => ftb.Multi(true).Search(true));
                                                      column.Bound(x => x.Price).Filterable(ftb => ftb.Multi(true).Search(true));
                                                  })
                     .Pageable().Sortable().Filterable().Resizable(resize => resize.Columns(true))
                     .DataSource(dataSource => dataSource.Ajax().ServerOperation(false).Model(model => model.Id(p => p.ProductID))
                     )                   
                    )

Viktor Tachev
Telerik team
 answered on 02 Mar 2018
1 answer
305 views

I have a child-grid where I want to to subtract the 'Value' column-cell with the previous 'Value' column-cell client-side, I tried using a ClientTemplate but I couldn't get it to work .

Ex, Let's say I am looking at the 'Value' with the 'SensorId' 3, I want the 'Change' column to be: 'Value' where 'SensorId' == 3 - 'Value' where 'SensorId' == 4, and so forth.

Thanks in advance.

@(
Html.Kendo().Grid<ErvinBeta.Models.ViewModels.ValueViewModel>().Name("ValueGrid#=SensorId#")
    .DataSource(ds => ds.Ajax()
    .Model(m => m.Id(sv => sv.SensorId))
    .PageSize(15)
    .Read(read => read.Action("ReadValue", "Home", new { SensorId = "#=SensorId#" }))
    .Sort(sort => sort.Add(sv => sv.Timestamp).Descending()))
 
    .Columns(columns =>
    {
        columns.Bound(sensorValue => sensorValue.ValueId).Visible(false);
        columns.Bound(sensorValue => sensorValue.SensorId).Visible(false);
        columns.Bound(sensorValue => sensorValue.Value).Title("Value")
             .HtmlAttributes(new { @class = "valueColumn" }).Width(150)
             .Filterable(ftb => ftb.Cell(cell => cell.Operator("contains"))
             .Cell(cell => cell.ShowOperators(false)));
        columns.Bound(sensorValue => sensorValue.Category.Unit)
             .Title("Unit").Width(200).Filterable(false);
        columns.Bound(sensorValue => sensorValue.Timestamp).Title("Timestamp")
             .Format("{0:yyyy-MM-dd}").Filterable(ftb => ftb.Cell
             (cell => cell.Operator("contains")).Cell(cell => cell.ShowOperators(false)));
    })
    .Scrollable()
    .Pageable()
    .Sortable()
    .Filterable(ftb => ftb.Mode(GridFilterMode.Row))
    .HtmlAttributes(new { style = "height: 600px;", @class="valueTable"})
    .ToClientTemplate()
)

Viktor Tachev
Telerik team
 answered on 02 Mar 2018
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
DropDownButton
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
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
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?