Telerik Forums
UI for ASP.NET MVC Forum
0 answers
144 views

Hello everyone, when I use grid to display data, the data is displayed normally when I use one grouping condition, but when I use multiple grouping conditions, an error will be reported. The database I use is mysql, and the error is when I call the todatasourceresult method

This is one grouping condition

This is two grouping condition

Here is my code and error information

Thank you all

 

 

 

盼宇
Top achievements
Rank 1
Iron
 asked on 05 Aug 2022
0 answers
180 views

 

In Main View

==========

columns.Bound(p => p.HuomName).Width(50).ClientTemplate("#=HuomName#").Title("H.UOM").Filterable(false).EditorTemplateName("HuomTemplate");

 

In Editor Template View

=====================

@(Html.Kendo().ComboBoxFor(m => m)
                      .Placeholder("Select H.UOM")
                      .DataValueField("uomID")
                      .DataTextField("HuomName")
                       .HtmlAttributes(new { @class = "form-control", @tabindex = "6" })
                      .DataSource(source => {
                          source.Read(read =>
                          {
                              read.Action("getGridH_UOM", "Order").Data("hUomFilter");
                          }).ServerFiltering(true);
                      })
                      .Events(e =>
                      {
                          e.Change("on_H_uom_grid_Change");
                      })
                )
Ecosoft
Top achievements
Rank 1
 asked on 03 Aug 2022
1 answer
166 views

Summary

As of Telerik v2022, after loading a persist state in a Grid, the HTML tags change from <a> to <span>. 

When we updated to Telerk 2022, we noticed that after loading a persisted state grid, the format of column heading changed. This led us to investigate the HTML tags before and after loading persist states and note that the HTML tags changed. This was true even on the Grid Persist State example in Telerik Docs: https://demos.telerik.com/aspnet-mvc/grid/persist-state.

Before Loading State

This is after loading the page and before interacting with the grid at all. (ie: Pressing F5)


<tr>
	<th class="k-header k-filterable" data-field="ContactName" data-index="0" data-title="Contact Name" id="322f9873-a501-4984-9596-11746efc9cbe" scope="col" data-role="columnsorter" style="touch-action: none;">
		<a class="k-link" href="/aspnet-mvc/grid/persiststate_customers_read?grid-sort=ContactName-asc">Contact Name</a>
		<a class="k-header-column-menu" href="#" title="Contact Name edit column settings" aria-label="Contact Name edit column settings" tabindex="-1">
			<span class="k-icon k-i-more-vertical"></span>
		</a>
	</th>
</tr>


After Loading State

This is after loading the persisted state of the grid. (ie: Clicking the "Load State") This behaviour is the same regardless if you save the state before. After clicking "Load State" without editing anything (in order to keep HTML as close as possible) this is the HTML.


<tr>
	<th scope="col" role="columnheader" data-field="ContactName" aria-haspopup="true" rowspan="1" data-title="Contact Name" aria-label="Contact Name Press ctrl + space to group" data-index="0" headers="undefined" id="65f2198b-846f-464a-9cb2-c04152d624eb" class="k-header k-filterable" data-role="columnsorter" style="touch-action: none;">
		<span class="k-cell-inner">
		<span class="k-link">
			<span class="k-column-title">Contact Name</span>
		</span>
		<a class="k-header-column-menu" href="#" title="Contact Name edit column settings" aria-label="Contact Name edit column settings" tabindex="-1">
			<span class="k-icon k-i-more-vertical"></span>
		</a>
		</span>
	</th>
</tr>

 

Differences

When initially loading, the "k-link" class is initially in an <a> tag, however, after loading persist state, it is in a <span> tag. Since our CSS file was tied to the type of the HTML tag, this broke our formatting functionality. Is this behaviour intentional? Especially as this can cause formatting, JS tied behaviour and other issues with sites that transition to use a Telerik 2022 Persist State Grid.

 

Ivan Danchev
Telerik team
 answered on 03 Aug 2022
0 answers
419 views

Hi,

I have a kendo grid for MVC and bound columns. I have to format date in one of columns as specified above.(QQ-YYYY)(Quarter Of the year format.) I tried below for followup date, but doesnt work. Please let me know solution that works other than this

 

@(Html.Kendo().Grid(Model) .Name("grid") .Columns(columns => { columns.Bound(p => p.TeamRank).Title("Team Rank").Hidden(); columns.Bound(p => p.ETA).Title("Forecast").ClientTemplate("#=formatDate(ETA)#"); }

function formatDate(ETA) {
    var CurrentQuarter = ((ETA.getMonth - 1) / 3) + 1;
    return CurrentQuarter + "-" + ETA.getFullYear;
}
Sunitha
Top achievements
Rank 1
 asked on 02 Aug 2022
4 answers
4.2K+ views
Hi,

I have a view with telerik asp.net mvc button on it. When the user clicks on this button, I would like to redirect to another view. I looked into the control documentation but could not find anything in the Events section. Please help me.
Below is my button code for reference.

<div style="text-align:right">
    @(Html.Kendo().Button()
    .Name("add")
    .Content("Add Project")
    .HtmlAttributes(new { type = "button" })
    .Events(e => e.Click("GoToCreateView")))
</div>

Thanks.
Hamish
Top achievements
Rank 1
Iron
 updated answer on 02 Aug 2022
1 answer
197 views

Hi Team,

I already have a developer license for my project. It is going to expire soon. So, i have renewed my license from Telerik portal. Now, after renewal, what are the steps to be followed in Visual studio to update the renew License.

I am using Kendo.MVC components. 

Your inputs will be greatly helpful to move further

Ivan Danchev
Telerik team
 answered on 29 Jul 2022
2 answers
181 views

I have a page that has a pie chart and a grid. Both controls use the same data. I could create a data source for each control and have it call the service twice, but that seems inefficient. Is there a way to define the data source for the chart and handle an event when the data is returned and assign the data to the grid's data source?

Which event should be handled?

What's the command to assign the data to the grid's data source?

Thanks

Tim
Top achievements
Rank 3
Iron
Iron
Iron
 answered on 28 Jul 2022
2 answers
326 views

I'm trying to add drag and drop functionality on my Grid. I have followed the documentation here, https://demos.telerik.com/aspnet-mvc/grid/drag-drop. However, I'm getting an gridreorderingsettingsbuilder does not contain a definition for 'Rows'. I'm also getting another error on .Draggable.  I'm using version 2021.1.224.545. Do I need to update my version? 

            @(Html.Kendo().Grid<AHPD.Data.Model.Questions>()
                .Name("grdSubs")
                .Columns(columns =>
                {
                    columns.Template(@<text> </text>).Draggable(true);
                    columns.Bound(p => p.Disabled).ClientTemplate("<div style='text-align: center;'>" +
                                                                        "# if(Disabled == '0'){ #" +
                                                                        "<div><input type='checkbox' disabled style='opacity: 1;' ><label></label></div>" +
                                                                        "# } else { #" +
                                                                        "<div><input type='checkbox' disabled checked style='opacity: 1;' ><label></label></div>" +
                                                                        "# } #" +
                                                                        "</div>").Title("Off").Width(80);
                    columns.Bound(p => p.Question).Title("Question");
                    columns.Bound(p => p.QuestionId).Title("Edit").Width(80).ClientTemplate("<div style='text-align: center;'onclick=\"edit(event)\"><img src='" + Url.Content("~/Content/aert/images/edit.png") + "' style='width: 20px; height: 20px;' /></div>");
                    columns.Bound(p => p.Status).Title("Status").Width(150);
                })
                    .Sortable()
                    .Pageable()
                    .ClientDetailTemplateId("subs")
                    .Navigatable()
                    .Reorderable(reorder => reorder.Rows(true))
                    //.HtmlAttributes(new { style = "min-height:600px;" })
                    .DataSource(dataSource => dataSource
                        .Ajax()
                        .PageSize(50)
                        .Read(read => read.Action("GetQuestionsList", "Owner"))
                        .Model(model =>
                        {
                            model.Id(p => p.QuestionId);
                            model.Field(p => p.Question).Editable(false);
                            model.Field(p => p.Status).Editable(false);
                        })
                    )
                    .Events(events => events.DataBound("dataBound"))
            )


Joshua
Top achievements
Rank 1
Iron
 answered on 27 Jul 2022
3 answers
2.7K+ views
How can I return a Custom error for a Grid Operation.

E.g.: If the database delete is not possible show a popup that something is gone wrong.

Controller Method:
[HttpPost]
public ActionResult DestroyEmploymentStatus([DataSourceRequest] DataSourceRequest request, [Bind(Prefix = "models")]List<EmploymentStatusViewModel> employmentStatuses)
{
    if (employmentStatuses.Any())
    {
        foreach (var esvm in employmentStatuses)
        {
            var es = db.EmploymentStatuses.Find(esvm.Id);
 
            db.EmploymentStatuses.Remove(es);
            db.SaveChanges();
        }
    }
 
    return Json(employmentStatuses.ToDataSourceResult(request, ModelState));
}

regards
Ivan Danchev
Telerik team
 updated answer on 26 Jul 2022
0 answers
424 views

Hi,

i'm trying to use Kendo Upload to upload a file, using the selection or drag&drop, with file name length over 260 characters but the result of upload operation change the file name.

For example:

C:\Espropri e Patrimonio\Patrimonio\Tutela 2022\AAAAA\FASCIA DI RISPETTO\BENESTARE\CARTACEO-INFORMATICO\VAILOG (Conferenza Servizi AAAAA Italia Transport)\DOCUMENTAZIONE INFORMATICA-CARTACEA\RIPRISTINO\13.05.2022 Prot. ent. AAAAA (progetto)\Document timestamp signed.pdf.tsd.p7m

The file name change into "DOCUME~1.P7M".

I've reproduce the problem also with the demo at https://demos.telerik.com/kendo-ui/upload/initialfiles.

Is there a way to solve the problem?

Cchecking the API I do not see that the property "name" but also in this case the name of the file is "DOCUME ~ 1.P7M"

https://docs.telerik.com/kendo-ui/api/javascript/ui/upload/configuration/files#files.name

 

Many thanks

Stefano

stefano
Top achievements
Rank 1
 asked on 26 Jul 2022
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?