Telerik Forums
UI for ASP.NET MVC Forum
1 answer
155 views
I am using a DropDownList in a Grid.    I have nullable fields using the DropDownList.   I am having a problem deleting items that have been selected in the DropDownList.    Here is an example.    We have a nullable field for DepartmentID in a table and we have entered and saved data using the DropDownList.   Now we want to delete the DepartmentID field (or make it null again).   I have tried using the {delete} key, but that does not work.   I have tried trying to capture the {delete} key on the KeyPress in JavaScript and manually change the DepartmentID, but the {delete} key gets trapped before getting to my JavaScript so I cannot do it from JavaScript.    How do you reset the DepartmentID field back to Null?

Thanks, Larry
Alexander Popov
Telerik team
 answered on 10 Sep 2014
1 answer
191 views
Is it possible to change the title of a panel bar in jquery after the control has been created?
I want to enable a user to change the title of a panelbar.  The panel bar will be created, within the panelbar will be a textbox that the user can enter new title for the panelbar.
Dimiter Madjarov
Telerik team
 answered on 10 Sep 2014
1 answer
920 views
I have been programming for many years now, but I am new to the web development world.   Is it possible to call a Controller ActionResult (get) method from javascript?    I have a grid with a dropdownlist.  I have the grid setup to use the change event.   I have javascript for the onChange event.   In this javascript I would like to make a call to a controller to retrieve information based upon the selection that was just made with the dropdownlist.   Is this possible?
Sebastian
Telerik team
 answered on 10 Sep 2014
1 answer
1.0K+ views
Hi,

I want to know is there any way to set group column by clicking on any other check box on same page outside the grid.

<div id="grid"></div>
<input type="checkbox" id="chkOrderGroup" />

//script

$("#grid").kendoGrid({
  columns: [
    { field: "name" },
    { field: "age",
      groupFooterTemplate: "Total: #= count #"
    }
  ],
  dataSource: {
    data: [
      { name: "Jane Doe", age: 30 },
      { name: "John Doe", age: 30 }
    ]
  }
});
  $(document).ready(function () {
      $('#chkOrderGroup:checkbox').change(function () {
            var g = $("#grid").data("kendoGrid")
            var objGroup = g.dataSource.group;
         // *******************************  Require code to set  column with name  "age"  as group column when check box is checked *****
      });

Require code to set  column with name  "age"  as group column when check box is checked.
Dimiter Madjarov
Telerik team
 answered on 09 Sep 2014
1 answer
285 views
We are trying to render a NumericTextBox in a Kendo grid. But the trick to lookup the id with javascript is not working. Can anyone help?

My code:
MVC View:
            @(Html.Kendo().Grid(Model.BeginVoorraadModel.Rows)
            .Name("Begingrid")
            .Columns(columns =>
            {
                columns.Bound(p => p.Totaalgewicht).Title("Totaalgewicht<br/>(kg)").ClientTemplate(
                    Html.Kendo().NumericTextBox()
                    .Name("BeginVoorraadModel.Rows[#= index('Begingrid', data)#].Totaalgewicht")   <== here is the problem!
                    .Culture("nl-NL")
                    .Decimals(2)
                    .HtmlAttributes(new Dictionary<string, object> { { "value", "#=Totaalgewicht#" }, { "class", "numTextBox" } })
                    .ToClientTemplate().ToHtmlString());

                columns.Bound(p => p.Omschrijving).Title("Omschrijving");
                columns.Bound(p => p.Stikstof);
                columns.Bound(p => p.Ureum);
                columns.Bound(p => p.Fosfaat);
                columns.Command(c => { c.Custom("Del").Click("onRemove"); });
            })
            .ToolBar(toolbar =>
            {
                toolbar.Create().Text("Toevoegen");
            })
            .Editable(edit => { edit.Mode(GridEditMode.InCell); edit.CreateAt(GridInsertRowPosition.Bottom); })
            .Resizable(resizing => resizing.Columns(true))
            .DataSource(dataSource => dataSource
            .Ajax()
            .Batch(false)
                .Model(model =>
                {
                    model.Id(p => p.Id);
                    model.Field(p => p.Totaalgewicht).Editable(false);
                })
                .Read(r => r.Action("ReadBeginVoorraad", "Kunstmest"))
                .Destroy(r => r.Action("DeleteBeginVoorraad","Kunstmest"))
            ) 

Javascript:
function index(grid, dataItem) {
    var data = $('#' + grid).data("kendoGrid").dataSource.data();

    return data.indexOf(dataItem);
}

Thnx!
Nikolay Rusev
Telerik team
 answered on 09 Sep 2014
1 answer
346 views
Dear Telerik Support Team,

I would like to know if it is possible to batch delete and update of selected rows by the external buttons. 
If yes, Could you please provide the sample code?  

Scenario is

I have a multiple rows selectable grid, "Delete Selected Items" button and "Assign DataOwner" button in my View.

If User click on "Delete Selected Items" button then the selected rows will get deleted
If User click on "Assign DataOwner" button then the selected rows Owner column will get updated as DataOwner. 
Calvin
Top achievements
Rank 1
 answered on 09 Sep 2014
1 answer
308 views
I'm getting an javascript error when trying to filter the scheduler using a Guid from a dropdownlist.  I had a very similar error when filtering by an int.  That was fixed by using parseInt(this.value)  instead of using this.value and then assigning the parseInt to  the filter value like:
var filter = {
                logic: "or",
                filters: [
                    {
                        operator: "eq",
                        field: "AssetID",
                        value: parseInt(this.value())
                    }
                ]
            };
 
Now I'm having the same type of error when the DataValueField of the dropdownlist is a Guid.

I'm doing this:
<div style="margin-left: 30px; margin-bottom: 20px">
    Choose Owner:
    @(Html.Kendo().DropDownList()
          .Name("Owner")
          .DataTextField("DisplayName")
          .DataValueField("UserID")
          .DataSource(ds => ds.Read("TaskUsers", "Users"))
          .Events(events => events.Change("userChange"))
    )
</div>
function userChange() {
 
    var scheduler = $("#scheduler").data("kendoScheduler");
 
    var selection = this.value();
     
    if (selection == "00000000-0000-0000-0000-000000000000") {
        scheduler.dataSource.filter([]);
    }
    else {
        var filter = {
            logic: "or",
            filters: [
                {
                    operator: "eq",
                    field: "AssetID",
                    value: selection
                }
            ]
        };
        scheduler.dataSource.filter(filter);
    }
}

I placed a break point in the code and 'selection' is a valid guid string and it is the guid that I expected it to be.
Can you filter by a Guid?
Edward
Top achievements
Rank 1
 answered on 08 Sep 2014
14 answers
613 views
In your examples,i noticed that the column has a big width,but when editing the column,the texbox is much smaller,so it doesn't rich the end of column limits.how can i do that?

Regards,
Daniel

Dimiter Madjarov
Telerik team
 answered on 08 Sep 2014
1 answer
86 views
Hi All,

Does anyone know if it's possible to check/uncheck the check box elements of the ColumnMenu in the kendo grid from the onDataBound event.
I have a specific requirement when I can't use the columnHide() 

Any help would be greatly appreciated.

Cheers,
Michael
Dimiter Madjarov
Telerik team
 answered on 08 Sep 2014
5 answers
242 views
Hy,

I have implemented js code to expand all child items under the selected NODE item.   And This Works FINE.

Is there a build in way in KEDO Treeview do this ? a better way...I mean.


OnRClickTreeNode()
{
var node = getTreeView().findByUid(getRightClickedItem().uid);
var treeView = getTreeView();
expandNodeChildItemsRecursive(treeView, node);
}

function expandNodeChildItemsRecursive(treeView, node) {
treeView.expand(node);
var childNodes = $(".k-item", node);
for (var i = 0; i < childNodes.length; i++) {
expandNodeChildItemsRecursive(treeView, childNodes[i]);
}
}
Rick Nguyen
Top achievements
Rank 1
 answered on 06 Sep 2014
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
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
ColorPicker
DateRangePicker
Wizard
Security
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
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
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?