Telerik Forums
UI for ASP.NET MVC Forum
6 answers
1.1K+ views

Currently I group on a hidden field like

GridHelpers.FilterableColumn(columns, m => m.Id).Hidden() .ClientGroupHeaderTemplate(".  . . . .");

And as part of the DataSource I added

.DataSource(dataSource => 
{
dataSource
. . . . . .
.Group(g => g.Add(p => p.Id))
;
})

But this seems to alter the way the grid is sorted for display. Is there a hook that I can influence the sorting for the grid?

 

 


Viktor Tachev
Telerik team
 answered on 10 Apr 2019
2 answers
349 views

Our dropdownlist is in a popup editor of a kendogrid.

It has a databound event where we conditionally select the 1st item.

.Events(events => events.DataBound("function() { if (this.value() == '' && this.dataSource.data().length == 1) { this.select(1); } }"))

This works to change the dropdown (and it's hidden input), but when we post back the value is zero. 

If we manually select the 1st item then it binds and posts back correctly.

A similar databound event works on other screens, but it just seems to be only a problem the built-in popup editor of the kendo grid.

Any ideas how to get the .select to update the dataItem & post back correctly?

Dimitar
Telerik team
 answered on 09 Apr 2019
1 answer
1.4K+ views

Hello,

I'm using Kendo Grid that displays a set of data based on different filter criteria (Textboxes and DropDownLists values).

I was wondering if using CompositeFilterDescriptor is an ideal way of filtering data instead of using a standard LINQ approach. 

Examples provided below.

I've tested multiple queries with Kendo Filtering with lots of criteria and different kind of operators (equal, contains, greaterThan etc..) and everything looks fine. Will I face any limitations with this approach?

 

The standard LINQ approach:
(Controller)

 

var query =
(from x in products where
x.ProductName == textSearch ||                      
x.Model == textSearch ||                      
x.Category == dropDownValue||                      
x.Seller == dropDown2Value||                      
x.Country == textSearch ||                      
x.Description == textSearch
select new Product(){
ProductId = x.ProductId,
ProductName =  x.ProductName,
Category = x.Category,
Seller = x.Seller,
Country = x.Country,
Description = x.Description
}).ToDataSourceResult(request);

 

 

The Kendo Filtering approach:

(Controller)

CompositeFilterDescriptor filterDescriptor = new CompositeFilterDescriptor
            {
                LogicalOperator = FilterCompositionLogicalOperator.Or,
                FilterDescriptors = new FilterDescriptorCollection()
                {
                    new FilterDescriptor(){Member = "Product", Operator = FilterOperator.IsEqualTo, Value = textSearch},
                    new FilterDescriptor(){Member = "Model", Operator = FilterOperator.IsEqualTo, Value = textSearch},
                    new FilterDescriptor(){Member = "Category", Operator = FilterOperator.IsEqualTo, Value = dropDownValue},
                    new FilterDescriptor(){Member = "Seller", Operator = FilterOperator.IsEqualTo, Value = dropDown2Value},
                    new FilterDescriptor(){Member = "Country", Operator = FilterOperator.IsEqualTo, Value = textSearch},
                    new FilterDescriptor(){Member = "Description", Operator = FilterOperator.IsEqualTo, Value = textSearch},
                }
            };
 
request.Filters.Add(filterDescriptor);
 
 var query = (from x in products
select new Product()
{
ProductId = x.ProductId,
ProductName =  x.ProductName,
Category = x.Category,
Seller = x.Seller,
Country = x.Country,
Description = x.Description
}).ToDataSourceResult(request);

 

Thank you!

Georgi
Telerik team
 answered on 09 Apr 2019
3 answers
107 views

I'm looking at using the grid in a generic way with the help of a custom Html Helper. 

Is it possible to pass my model to the grid like so @Html.Kendo().Grid(Model) (not like Grid<SomeClass>()) within a partial view without declaring a concrete model such as @model IEnumerable<SomeClass>? Model would be a generic such as IEnumerable<object>, dynamic or find a way to cast it as it's native type in some way.

Tsvetomir
Telerik team
 answered on 08 Apr 2019
1 answer
259 views

I have a grid that the datasource shows has data. Exporting the grid to Excel shows data. But the display shows no data in any of the columns. I am not sure how to debug this. Are there some hooks that I can verify that the data is making it to. The column headers show up just no data in each column.

 

Thank you.

 

Kevin

Viktor Tachev
Telerik team
 answered on 05 Apr 2019
1 answer
104 views

If I specify a column width like

GridHelpers.FilterableColumn(columns, m => m.Description).Width(480);

It seems that the columns that should show to the right are overridden. I don't see them. How do I specify a width AND allow for scrolling?

Thank you.

 

Georgi
Telerik team
 answered on 05 Apr 2019
1 answer
86 views

Right now if an item is grouped the paging doesn't seem to break only on group borders. Say there are 7 items in the group in some cases 4 of the items might be displayed on one page and the rest of the 3 displayed on the next. Is there a way to control the paging so that a "break" only occurs on group boundaries?

 

Georgi
Telerik team
 answered on 04 Apr 2019
1 answer
116 views

Hi,

I am trying to implement 3 level grid following the approach used in Server Hierarchy demo https://demos.telerik.com/aspnet-mvc/grid/serverhierarchy. Is it possible or i should use ClientDetailTemplateId approach?

 

If it is not possible to use server hierarchy approach for multi level grid then can i use both approaches together? .DetailTemplate for second level and ClientDetailTemplateId for third level.

 

 

 

Georgi
Telerik team
 answered on 04 Apr 2019
1 answer
177 views

I'm building an MVC5 web app with a single shared Index view which calls all the associated Editor Templates. It's been working out great until I got to the Kendo Grid. 

It seems that the Kendo Grid in InCell or InLine editing is not supported when the grid is inside an editor template. If I do so I'm getting a javascript error Cannot read property '[propname]' of null. Only when I move the grid from its editor template to a standard razor view does it work. I realize that the grid actually fetches its property's editor template but that shouldn't be stopping it as I'm doing the same in other complex elements.

Is there a way this can work with InCell or InLine editing? If not supported, is there a component I can implement/override?

Georgi
Telerik team
 answered on 03 Apr 2019
11 answers
4.5K+ views

I am not sure what I am missing but I am unable to send an object as a parameter to a controller, the request keep failing with 500 (Internal Server Error).

C# Object:

public class RateQueryDto
{
    public long WorkHistoryId { get; }
    public int WorkerId { get; }
    public int ClientId { get; }
    public DateTime WeekEndingDate { get; }
}

 

MVC Controller method:

[HttpPost]
public ActionResult Read([DataSourceRequest] DataSourceRequest request, RateQueryDto rateQuery)
{
    return Json(true);
}

 

Grid configuration:

@(Html.Kendo().Grid<ConfirmHoursRateModel>()
      .Name("grid")
      .HtmlAttributes(new { style = "height:250px;" })
      .AutoBind(false)
      .Columns(columns =>
      {
          columns.Bound(c => c.Id).Hidden(true);
      })
      .Editable(editable =>
          editable.Mode(GridEditMode.InCell))
      .Navigatable()
      .DataSource(dataSource => dataSource
          .Ajax()
          .ServerOperation(false)
          .Batch(true)
          .Model(model =>
          {
              model.Id(w => w.Id);
          })
          .Read(read => read.Action("Read", "ConfirmHours").Data("confirmHoursReadData")))
      )

 

Javascript:

function confirmHoursReadData() {
    var grid = $("#confirm-hours-grid").data("kendoGrid");
    var selectedItem = grid.dataItem(grid.select());
    return {
        WorkHistoryId: selectedItem.WorkHistoryID,
        WorkerId: selectedItem.WorkerID,
        ClientId: selectedItem.ClientID,
        WeekEndingDate: selectedItem.WeekEndingDate
    };
}

 

 

 

Viktor Tachev
Telerik team
 answered on 03 Apr 2019
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
Upload
ComboBox
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
ListView (Mobile)
Pager
Accessibility
ColorPicker
DateRangePicker
Wizard
Security
Styling
Chat
MediaPlayer
TileLayout
DateInput
Drawer
SplitView
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Template
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
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?