Telerik Forums
Kendo UI for jQuery Forum
2 answers
487 views
Hi,

Need to reorder rows in kendo mvc grid using up/down buttons and also want the order to save in db.

Please provide a sample code to acheive this.

Many Thanks
Petur Subev
Telerik team
 answered on 22 May 2014
1 answer
86 views
I have a grid with 10 columns of various widths:

columns: [{
        field: "items__item",
        title: "Item Id",
        width: 25
    }, {
        field: "items__name",
        title: "Item Name",
        width: 125
    }, {
        field: "items__average_historic_price",
        title: "Avg Hist Price",
        width: 25
    }, {
        field: "items__price_currency",
        title: "Currency",
        width: 25
    }, {
        field: "items__quantity",
        title: "Quantity",
        width: 25
    }, {
        field: "attribute79_value",
        title: "Major Customer?",
        width: 125
    }, {
        field: "attribute84_value",
        title: "Orig City",
        width: 75
    }, {
        field: "attribute85_value",
        title: "Orig State",
        width: 25
    }, {
        field: "attribute89_value",
        title: "Dest City",
        width: 75
    }, {
        field: "attribute90_value",
        title: "Dest State",
        width: 25
    }
]

The grid renders fine. I have columnMenu set to true. When I go to any column menu and deselect a checkbox in the Columns section, that column is hidden as expected but all the remaining columns shrink and collapse to the left (see attached).

This behavior does not happen if i set all columns to the same width (ex: 200).
Nikolay Rusev
Telerik team
 answered on 22 May 2014
6 answers
190 views
Hi, it is possible to set the showWorkHours option using MVVM? If is it possible which is the data-??? parameter?

Thanks in advance
Darryl
Top achievements
Rank 1
 answered on 22 May 2014
1 answer
214 views
I've created a hierarchical grid which seemed like it was working properly until I started expanding multiple rows. In the attached screen shots if I click on row 5 it works, but then when I click on row 10 the data comes back under row 5 and row 10 is empty. I can reproduce this with any combination of rows. 

The child grid is defined as follows
<script id="template" type="text/kendo-tmpl">
    @(Html.Kendo().Grid<Ebook2Web.PricingGridSvc.PricingGridDetail >()
            .Name("PricingGridDetail_#PricingGridId#")
            .Columns(columns =>
            {
                columns.Bound(d => d.PricingGridDetailId);
                columns.Bound(d => d.StartPrice);
                columns.Bound(d => d.EndPrice);
                columns.Bound(d => d.Price);
                columns.Bound(d => d.TierId);
                columns.Bound(d => d.ModifiedBy);
                columns.Bound(d => d.ModifiedDate);     
            })
            .DataSource(dataSource => dataSource
                .Ajax()
                .Read(read => read.Action("CreatePricingGridDetail", "PricingGrid", new { pricingGridId = "#=PricingGridId#" }))
            )
            .ToClientTemplate()
    )
 
</script>

and the controller method as 
public ActionResult CreatePricingGridDetail(int pricingGridId, [DataSourceRequest] DataSourceRequest request)
       {
           var pricingGrid = PricingGrids.SingleOrDefault(x => x.PricingGridId == pricingGridId);
           return Json(pricingGrid.Details.ToDataSourceResult(request));
       }
 I've attached the full files in the zip. This is my second Kendo grid and first hierarchical one so I'd appreciate any help.

Bill
wdudek
Top achievements
Rank 1
 answered on 21 May 2014
4 answers
499 views
Hi,

AFAIK the tabs can currenly only placed at the top.
Would be a nice feature to be able to position them at the left, bottom or right.

Jaap
Pani
Top achievements
Rank 1
 answered on 21 May 2014
3 answers
621 views
Hello!

I am working on grid that contains user account data.  We want to allow an administrator to change the password for a given user, however, a simple change of the password is undesirable.  We want to pop up a window to allow the change to occur.  This option should _only_ be available on the row currently being edited.  I have found that I can place a button in a column through the use of the ClientTemplate.  I chose a button over a hyperlink since I read I can enable/disable the button, and have set the button to be disabled by default.  Unfortunately, when I hook into the Edit event to call the javascript, I cannot pull the button out of the <td>

Here is the grid definition:

<div id="topGrid">
@(Html.DashboardGrid<DashBUserViewModel>(svm) //GirdName, Export Method Name, Controller Name, add new class, edit template
.Columns(columns =>
{
columns.Bound(x => x.Id).Hidden(true);
columns.Command(command => { command.Edit(); command.Destroy(); }).Width(svm.cRUDColSize);
columns.Template(p => { }).ClientTemplate("<a onclick=OnSingleChange('#=Id#')>Assign Role</a>").Width(svm.cRUDColSize);
columns.Template(p => { }).ClientTemplate("<button class='myClass' disabled onclick=ChangePassword('#=Id#')>Change Password</button>").Width(svm.cRUDColSize);
// REMOVED FOR BREVITY
.Events(events => events.Cancel("showAdd").Edit("editRow").Save("showAdd")) // to blank out the template text to avoid issues
)
</div>


Here is the javascript method (the enable() method is undefined):

function editRow(currentRow) {
// Hide the add button to prevent weird errors
this.wrapper.find(".k-grid-add").hide();

if (currentRow.model.isNew()) {
currentRow.container.find("td:eq(2)").text("");
}

currentRow.container.find("td:eq(3)").enable();
}

Does anyone know how to get the button and set it to enabled?

Much thanks,

Andrew Giles

Dimiter Madjarov
Telerik team
 answered on 21 May 2014
1 answer
5.4K+ views
Hi, Can anyone please let me know how we can write our own function for sorting when the column header is clicked. And do we need to write two function for asc and desc? Any help appreciated!
Dimiter Madjarov
Telerik team
 answered on 21 May 2014
5 answers
318 views
When I click a data-role="backbutton" button and move just a little bit as I click, the BackButton navigates back but the attached click event calling my code does not fire.

Steps to reproduce:
http://plnkr.co/edit/XzaXgNzODJqgqdVHANKb?p=preview

1. Click on the Find tab control entry (2nd one on the bottom)
2. Click on the Filter button in top right hand corner
3. Click on the "Floors" item (next to last)
4. Click on a few floors.  Check box will be displayed on right.
5. Click on the "Filter" button in top left hand to go back to Filter view.
6. When back on the "Filter" view it "should" show the number of floors selected.

In step 5 above, if you drag a little bit when you click the back button will fire but the attached click event calling my code is not fired and the number of floors selected will not be displayed properly on the "Filter" view.

I have recorded a video of this plunker recreating the problem on an iPad Air:
http://youtu.be/fJmgikqhdEQ










Kiril Nikolov
Telerik team
 answered on 21 May 2014
1 answer
145 views
Hi, I have an application which has a huge amount of data to be loaded into Kendo grid. I am using web forms(aspx). Since I need to download some thousands of rows into grid, I am trying to load the data from database by giving the page size.

I want the sort to be done for all the rows, but for my code, sorting is done only for those 2000 rows in the current view.

Can anyone please let  me know which is the good way to do serversorting and serverpaging with lot of data in the database that should be loaded into the kendo grid.

Thanks in advance!

Here is my code:
 Dim get_data As String = "select fname, lname, address, phnum from contacts limit  " & limit & ", 2000"

'limit here is taking the page numberr
          Dim JSON_result As String = "["
          'get the data from DB and make it a JSON string
 
          Dim connection1 As New MySqlConnection(constr)
          connection1.Open()
          Dim get_Command As New MySqlCommand(get_data, connection1)
          Dim reader As MySqlDataReader = get_Command.ExecuteReader()
          While reader.Read()
 
              Dim FirstName As String = reader("fname").ToString()
              Dim LastName As String = reader("lname").ToString()
              Dim address As String = reader("address").ToString()
              Dim phnum As String = reader("phnum").ToString()
             
 
              JSON_result += "{""First Name"":""" & FirstName & """, ""Last Name"":""" & LastName& """, ""Address"":""" & address & """, ""contact"":""" & phnum& """},"
          End While
          JSON_result = JSON_result.Remove(JSON_result.Length - 1)
          JSON_result += "]"

And my front end looks like:

var grid = $("#gridAllRuns").kendoGrid({
                       dataSource: {
                           type: "json",
                           transport: {
                               read: url_load
                           },
                           schema: {                               
                               total: function (response) {
                                   return 43658;
                               }
                           },
                           serverPaging: true,
                            
                           pageSize: 2000
                       },
                       dataBound: onDataBound,
                       height: $(document).height() - 250,
                       groupable: true,
                       sortable:true,
                       reorderable: true,
                       //selectable: "multiple",
                       resizable: true,
                       pageable: true,
                      
                          filterable: {
                           extra: false,
 
                           operators: {
                               string: {
                                   eq: "equal to",
                                   startswith: "starts with",
                                   neq: "not equal to"
                               }
                           }
                       },
                       toolbar: kendo.template($("#template").html()),
                       columns: [
                           { title: "First name", field: "First Name"},
                           { title: "Last name", field: "Last Name" },
                           { title: "Address", field: "Address" }]
            }



Daniel
Telerik team
 answered on 21 May 2014
1 answer
103 views
We are using Kendo UI Controls and its Validations.

Now the problem is the Kendo validations are not working in manner like MVC validations.

I want to know how to get kendo validation working like the way Classic MVC validations works.

Following is the scenario which I would like to achieve by either of ways.

--- Kendo UI Validation raise popup beneath the controls whenever validations occurs. And I don't want required field error message like tool tip or popup.

I want to have simple red border around the control (drop-down list or text box) if I m not selecting any item from drop-down list and submit the button.

So I want to avoid that popup/tooltip situation whenever validations fires.
Daniel
Telerik team
 answered on 21 May 2014
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Drag and Drop
Application
Map
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
DropDownTree
ListBox
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
Licensing
PivotGridV2
ScrollView
Switch
TextArea
BulletChart
QRCode
ResponsivePanel
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
TimePicker
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
LLM Kit
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?