Telerik Forums
UI for ASP.NET MVC Forum
2 answers
212 views

We are using code from this example Here in the databinding of our grid to conditionally set cell background color but when we turn on grouping, the code fails due to the addition of the grouping rows added.  we have tried getting the child rows of the group but just cannot get the syntax right.  Any help would be great.

Thanks, 

Erik

for (var x = 0; x < Months.length; x++) {
    // get the index of the column
    var columnIndex = this.wrapper.find(".k-grid-header [data-field=" + Months[x] + "]").index()-1;
 
    // iterate the data items and apply row styles where necessary
    var dataItems = e.sender.dataSource.view();
    for (var j = 0; j < dataItems.length; j++) {
        var group = e.sender.tbody.find(".k-grouping-row");
        var row = group.children().find("[data-uid='" + dataItems[j].uid + "']");
        var cell = row.children().eq(columnIndex);
        var monthNum = x + 1;
        if (x === 12) {
            monthNum = 12;
        }
        if (((selFY === curfyear) && (curfmon > monthNum)) || (selFY < curfyear)) {
            cell.addClass('disabledColor');
        }
    }
Erik
Top achievements
Rank 2
 answered on 03 Apr 2017
1 answer
152 views

I am trying to use the Kendo UI grid with serverPaging with Angular and ASP.NET MVC.  Whenever I click "next page" in the grid, when it hits my Action Method, the request object is all zeros accept for Page which is ALWAYS = 1 so my paging never happens  Here is my Angular code:

<code style="color: #000;">$scope.mainGridOptions = {<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>        dataSource: {<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>            transport: {<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>                read: {<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>                    url: '/SSQV4/SSQV5/Search/GetSearch',<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>                    type: "GET"<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>                }<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>            },<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>            schema: {<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>                data: "results",<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>                total: "Total"<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>            },<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>            pageSize: 25,<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>            serverPaging: true<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">><</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>        },<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>      sortable: true,<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>      pageable: true,<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>      resizable: true,<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">><</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>      columns: [{<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>          field: "CompanyID",<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>          title: "Company ID"<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">><</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>      }, {<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>          field: "CompanyName"<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">><</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>      }, {<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>          field: "City"<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">><</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>      }, {<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>          field: "State"<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">><</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>      }, {<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>          field: "Deficiencies"<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>      }]<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>  };</code>

 

Here is my MVC Controller code:

public async Task<ActionResult> GetSearch([DataSourceRequest(Prefix = "Grid")] DataSourceRequest request)<br>        {<br>            int pageNum = request.Page;<br>            if (request.PageSize == 0)<br>            {<br>                request.PageSize = 25;<br>            }   <br>            MajorID = UserInfo.intMajorID;<br>            var SearchString = System.Web.HttpContext.Current.Session["SearchString"] as String ?? "";<br>            strSqlQuery = " LEFT JOIN tblSSQReleaseToMajor RT (READUNCOMMITTED) ON C.CompanyID = RT.CompanyID and RT.MajorID = " + MajorID + " LEFT JOIN tblTrainingRelease TR on C.CompanyID = TR.ContractorID";<br> <br>            MajorID = UserInfo.intMajorID;<br>            string preSqlQuery = ""<br><br>            var results = await SearchClient.PostReleasedSearch(preSqlQuery, strSqlQuery, 5000, 1);<br><br>            var searchResults = new SearchResultsViewModel();<br>            searchResults.Total = results.Count();<br>            if (request.Page > 0)<br>            {<br>                results = results.Skip((request.Page - 1) * request.PageSize).ToList();<br>            }<br>            results = results.Take(request.PageSize).ToList();<br><br>            searchResults.results = results;<br><br>            return Json(searchResults, JsonRequestBehavior.AllowGet);<br><br>        }

 

What am I missing here?

Stefan
Telerik team
 answered on 03 Apr 2017
1 answer
493 views

I am trying to use server-side paging in my project I am using Angular, and Asp.net MVC.  Whenever click "next page" the request object values are always 0 accept for Page which is always 1.  Because the page is always 1, I can't ever move to the next page.

Here is my Angular code:

 $scope.mainGridOptions = {
        dataSource: {
            transport: {
                read: {
                    url: '/SSQV4/SSQV5/Search/GetSearch',
                    type: "GET"
                }
            },
            schema: {
                data: "results",
                total: "Total"
            },
            pageSize: 25,
            serverPaging: true
        },
      sortable: true,
      pageable: true,
      resizable: true,
      columns: [{
          field: "CompanyID",
          title: "Company ID"
      }, {
          field: "CompanyName"
      }, {
          field: "City"
      }, {
          field: "State"
      }, {
          field: "Deficiencies"
      }]
  };

Here is my MVC Controller code:

 

public async Task<ActionResult> GetSearch([DataSourceRequest(Prefix = "Grid")] DataSourceRequest request)
        {
            int pageNum = request.Page;
            if (request.PageSize == 0)
            {
                request.PageSize = 25;
            }   
            MajorID = UserInfo.intMajorID;
            var SearchString = System.Web.HttpContext.Current.Session["SearchString"] as String ?? "";
            strSqlQuery = " LEFT JOIN tblSSQReleaseToMajor RT (READUNCOMMITTED) ON C.CompanyID = RT.CompanyID and RT.MajorID = " + MajorID + " LEFT JOIN tblTrainingRelease TR on C.CompanyID = TR.ContractorID";
 
            MajorID = UserInfo.intMajorID;
            string preSqlQuery = ""

            var results = await SearchClient.PostReleasedSearch(preSqlQuery, strSqlQuery, 5000, 1);

            var searchResults = new SearchResultsViewModel();
            searchResults.Total = results.Count();
            if (request.Page > 0)
            {
                results = results.Skip((request.Page - 1) * request.PageSize).ToList();
            }
            results = results.Take(request.PageSize).ToList();

            searchResults.results = results;

            return Json(searchResults, JsonRequestBehavior.AllowGet);

        }

Why is page always 1?  If I click on Page 2, 3, the request object page is always 1.

Any assistance is greatly appreciated.

Stefan
Telerik team
 answered on 03 Apr 2017
1 answer
320 views

I have a grid in which I conditionally allow editing of a column.  I do this by conditionally applying the readonly attribute, like so:

$("#my_column_name").attr("readonly", true);

 

Chrome 57.0.2987.98 respects this, and I can't click into the cell to edit it.

IE 11.0.9600.x, however, allows me to click into the cell and prepend values to the cell's existing value.

Thanks,

Duke

Stefan
Telerik team
 answered on 03 Apr 2017
1 answer
619 views

I have here a MENU which would show partial views as the content. The function openPatientDetails is a switch statement that basically just adds a class to those divs that I want to hide and removes the class to those divs that I want to show. So every time I click from the Menu which adds/removes the hidden class, I also need the url to change without reloading the browser and every time I click back or forward it should go to the partial view that I am supposed to be. I tried the history.pushState but it's so static because I need to do it for all of the tabs. Is there any way to solve this issue?

<div class="panel-body">
    <div id="row_menu" class="row" style="margin-top: -15px;">
        @(Html.Kendo().Menu()
                .Name("Menu_PatientDetails")
                .Items(items =>
                {
                    items.Add().Text("Patient Information").Selected(true).Enabled(false);
                    items.Add().Text("Insurance").Enabled(false);
                    items.Add().Text("Visits").Enabled(false);
                    items.Add().Text("Notes").Enabled(false);
                    items.Add().Text("Documents").Enabled(false);
                })
                .Events(e=>e.Select("openPatientDetails"))
        )
    </div>
 
    <div id="PatientInformationPanel">
        @Html.Action("ShowPatientInformation", "Patient")
    </div>
 
    <div id="PatientInsurancePanel" class="hidden">
        @Html.Action("ShowPatientInsurance", "Patient")
    </div>
 
    <div id="PatientYearPanel" class="hidden">
        @Html.Action("ShowPatientYear", "Patient")
    </div>
 
    <div id="CasesPanel" class="hidden">
        @Html.Action("ShowPatientCases", "Patient")
    </div>
    <div id="PatientDocumentPanel" class="hidden">
        @Html.Action("ShowPatientDocuments", "Patient")
    </div>
</div>

 

function openPatientDetails(e) {
     $(e.item).addClass("k-state-selected");
     $("#PatientInformationPanel").removeClass("hidden");
     $("#PatientInsurancePanel").addClass("hidden");
     $("#PatientYearPanel").addClass("hidden");
     $("#CasesPanel").addClass("hidden");
     $("#PatientDocumentPanel").addClass("hidden");
}

 

Ivan Danchev
Telerik team
 answered on 03 Apr 2017
5 answers
2.0K+ views
Hi,

I wondering if it's possible to put a horizontal scroll bar because when I retrieve the information, columns has an overflow of the screen
I attach an image that shows the problem
Dimo
Telerik team
 answered on 03 Apr 2017
2 answers
187 views

Hi community,

I encountered the issue shown in the screenshot while loading data from the database. The loading image indicator is shown, but it isn't fitting correctly.
The them used is Fiori and my kendo version is 2017.1.118

Any advice how to fix this issue?

Many thanks and kind regards,
Thomas

Thomas
Top achievements
Rank 2
 answered on 03 Apr 2017
14 answers
554 views

Hi,

I updated my project to use the latest Telerik MVC release 2016.3.1028, but after this update the grids that i had DisplayDeleteConfirmation(false) does not work anymore and when i click on cancel it displays the message box with "are you sure". When i downgraded to a old version it worked fine.

Now since i have installed the current version the previous version 2016.3.914 that i was using is no more displayed in the update tool in Visual Studio for me to downgrade, please let me know how can i downgrade to this specific version.

Thanks in advance

Arvind

Michael
Top achievements
Rank 1
 answered on 01 Apr 2017
2 answers
248 views
I have an MVC KendoGrid with a custom popup editor that contains 3 select lists using razor DropDownListFor html helpers.  I am using the optionLabel parameter on the helper to show "-- Select One --" empty option when creating a new record, but it is not being selected for 2 selects that have integer values. The other select that has a string type for value in the model is showing the "-- Select One --" corrrectly.  Is there something I can do to have it selected in all 3 dropdown lists for new records?
Pavlina
Telerik team
 answered on 31 Mar 2017
2 answers
2.2K+ views
Is there any way to have a loading indicator on the MVC Chart?  I've seen plenty of examples on how to do that in the JS Chart but none on the MVC Chart.  I have some charts with a lot of data that are taking 15-20 seconds to display so the user is sitting there wondering if the chart is even working.
John
Top achievements
Rank 1
 answered on 31 Mar 2017
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?