Telerik Forums
UI for ASP.NET MVC Forum
3 answers
6.9K+ views

I would like to conditionally disable custom command button when a specific value existing in a column field.

@(Html.Kendo().Grid<Swisslog.DC.Entities.AlarmRespond>
                ()
                .Name("alarmRespondGrid")
                .Events(e => e.DataBound("commandButtons"))
                .Columns(columns =>
                {
                    columns.Bound(c => c.Customer).Title("Customer");
                    columns.Bound(c => c.CustomerID).Title("Customer #").Sortable(false).Width(100);
                    columns.Bound(c => c.EquipmentID).Title("Equipment #").Sortable(false).Width(100);
                    columns.Bound(c => c.AlarmCode).Title("Alarm").Sortable(false).Width(75);
                    columns.Bound(c => c.AltAlarmDescription).Title("Description").Sortable(false);
                    columns.Bound(c => c.FirstAlarmDateLocal).Title("Alarm Date").Format("{0:MM/dd/yy hh:mm:ss tt}").Width(175);
                    columns.Bound(c => c.AlarmCount).Title("Count").Sortable(false).Width(75);
                    columns.Bound(c => c.AssignedTo).Title("Assigned To").Sortable(false).Width(175);
                    columns.Command(command => command.Custom("Assign").Click("assignAlarm")).Width(100);
                    columns.Command(command => command.Custom("Auto Case").Click("showResolveWindow")).Width(100);
                    columns.Command(command => command.Custom("Manual Case").Click("createSfdcAlarmCase")).Width(100);
                })

 When c.AssignedTo == "" I would like to disable the Auto Case and Manual Case buttons.  It is not clear to me how to accomplish this with a custom command.

 

Jim

 

Ólafur Gíslason
Top achievements
Rank 1
 answered on 31 Dec 2020
1 answer
252 views

Hello;

I'm trying to use footer total in grid edit mode InCell for my grid. The total display correctly but I have to hit save/update button. Is it possible to auto/refresh calculate after I moved out of that cell or column without to hit the save button? Any advices. Thanks.

Nikolay
Telerik team
 answered on 31 Dec 2020
3 answers
990 views

I have implemented cascading drop down functionality using the following URL

https://github.com/telerik/ui-for-aspnet-mvc-examples/tree/master/grid/grid-editing-cascading-dropdownlist

Is there a way to display Text of the drop down in the grid cell instead of Id

earlier help is highly appreciated

 

Nikolay
Telerik team
 answered on 30 Dec 2020
2 answers
253 views
What do I need to configure to get this toggle button to show up on my Scheduler control using MVC? Consulting the sample code that generates this gives me no clues.
Responsive
Top achievements
Rank 1
Veteran
 answered on 29 Dec 2020
4 answers
2.8K+ views

Hello,

 

 

I  am working with telerik ui for asp.net mvc.

I have a textbox named path of poste.

By entering, it should show me the tree view of my local directories in a window.

when I select a directory, I need to show only the full path in my text box.

So i need to show the path of the selected folder from my local folders. How can I do this ?

Any help or suggestions please ?

Nikolay
Telerik team
 answered on 28 Dec 2020
1 answer
623 views

Hi,

I’m trying to use the filter component with dynamic datasource. (Asp.net MVC)
I'm writing something like this:
    @(Html.Kendo().Filter<dynamic>()
        .Fields(f =>
        {
            foreach (var field in Model.Fields)
            {
                f.Add().Label(field.Label).EditorTemplateHandler(“func”+field.type);            
            }
        }).FilterExpression(f =>
        {
            f.AddRange(Model.Filters);
        }))




For filters, I had to create my own conversion function (string json -> IFilterDescriptor) because I couldn't get the one used for the grids to work (= FilterDescriptorFactory.Create)

And now, I am blocked by the dynamic change of operators. These change depending on the type of field. However, I do not pass a field (because dynamic), and I do not have a "SetType" function as for "kendo-ui" (https://docs.telerik.com/kendo-ui/api/javascript/ui/filter/configuration/fields.type)

How can I do ?

Regards
P.S. I'm with v2020.3.915

Preslav
Telerik team
 answered on 24 Dec 2020
3 answers
2.0K+ views

I have a Kendo Editor which is defined as below:

@(Html.Kendo().Editor()
                    .Name("myEditor")
                    .Tag("div")
                    .Tools(tools => tools
                            .Clear()
                            .Bold()
                            .Italic()
                            .Underline()
                            .Strikethrough()
                            .JustifyCenter().JustifyFull().JustifyLeft().JustifyRight()
                            .CreateLink().Unlink().TableEditing().FontColor().BackColor())
                     .Value(@<text>
                                Hello Kendo Editor <some text with html tags here>
                        </text>)
                )

Then I have two buttons that show up only for the admins - Save and Edit, and they are defined as below -

<button type="button" id="btnedit">Edit</button>
 <input type="submit" name="btnSave"  id="btnSave" value="Save" class="btn btn-default" />

 

There are other two submit buttons on the form like below -

<input type="submit" name="btnAgree"  id="btnAgree"  value="Agree" class="btn btn-primary" />
<input type="submit" name="btnDisagree" id="btnDisagree" value="Disagree" class="btn btn-default" />

 

And the form handles the submit of Agree and Disagree buttons by using the BeginForm("ActionMethod", "Controller", FormMethod.Post) like below -

@using (Html.BeginForm("Index", "MyControllerName", FormMethod.Post))

 

Now I want that, when an admin user comes in and makes changes to the Editor text and hits 'Save' button, I want the text of the editor to get saved in database. I can handle the saving part. I just want to know, how can I get the text from the Kendo Editor and send the text value to the action method in the controller.  

I tried the solution provided in this thread here - http://www.telerik.com/forums/save-changes-to-and-print-content-of-editor-in-mvc

So, using the solution here I added an action method with the string argument name similar to the Editor name like below -

public ActionResult Save(string myEditor) {

// TO DO: Save the text to the database

 }

When I run my application, and hit 'Save' button, I get the below error - 

HTTP Error 404.0 - Invalid navigation
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

It does not hit the 'Save' Action method. How can I get that working?

Thanks

Ivan Danchev
Telerik team
 answered on 23 Dec 2020
12 answers
368 views

While selecting an item from the dropdowntree control, items without children shows-up properly but those with child items don't have labels, including the child items. The <span class='k-in'> is empty, it is direct-child of <div class='k-bot'> which is under the <li role='treeitem'>.

I followed this example but omitted the second mapping because from the root parents to the children, they share the same structure. IEnumerable of my "TreeItem" class:

public class TreeItem<T>{

public T Item {get;set;}

public IEnumerable<TreeItem<T>> Children {get;set;}

public bool HasChildren {

get {

return this.Children != null && this.Children.Coun() > 0;

}

}

}

 

And here's how I configured the binding part:

@(Html.Kendo().DropDownTree()

.Name("Categories")

.BindTo(Model.CategoriesList, mapping => {

mapping.For<TreeItem<Category>>(binding => binding

.Children(c => c.Children)

.ItemDataBound((item, categ) => {

item.Expanded = true;

item.HasChildren = categ.HasChildren;

item.Id = categ.Item.Id;

item.Text = categ.Item.Name;

item.Value = categ.Item.Id.ToString();

})

)

})

.LoadOnDemand(false)

)

the Model.CategoriesList is IEnumerable<TreeItem<Category>> which makes it the same structure as the Children of the TreeItem<Category> in here, if it matters.

Petar
Telerik team
 answered on 22 Dec 2020
3 answers
84 views
Is there a way to open the upload dialog when a user drags and drops files, so that they can keep track of the files being uploaded and their status?
Ivan Danchev
Telerik team
 answered on 22 Dec 2020
3 answers
1.3K+ views

Hello,

 

I'm trying when exporting a Grid to excel file to format some columns raw content into hyperlink text. 

 

here is the implementation of my excelExport function:

 

01.function excelExport(e) {
02.        if (!exportFlag) {
03.            e.sender.showColumn(3);
04.            e.sender.showColumn(4);
05.            e.sender.showColumn(5);
06.            exportFlag = true;
07. 
08.            var sheet = e.workbook.sheets[0];
09.            var data = this.dataSource.view();
10. 
11.            for (var i = 0; i < data.length; i++) {
12.                sheet.rows[i + 1].cells[3].formula = "=HYPERLINK(" + data[i].LinkExportPdf + ", Export Pdf " + data[i].Id + ")";
13.                sheet.rows[i + 1].cells[4].formula = "=HYPERLINK(" + data[i].LinkExportPpt + ", Export Ppt " + data[i].Id + ")";
14.            }
15.            e.preventDefault();
16. 
17.            setTimeout(function () {
18.                e.sender.saveAsExcel();
19.            });
20.        } else {
21.            e.sender.hideColumn(3);
22.            e.sender.hideColumn(4);
23.            e.sender.hideColumn(5);
24.            exportFlag = false;
25.        }
26.    }

 

What i tried to do first is to assign direct the value by changing the cell value which doesn't provide any result, 2nd problem, when debugging the columns 3, 4 and 5 aren't into my sheet object even with the showColumn and when downloading the excel file, like any of the operation above isn't take in consideration.

 

My Grid set Events like this:

1..Events(e =>
2.{
3.     e.DataBound("dataBound");
4.     e.ExcelExport("excelExport");
5.})

 

The excel setting is like this:

 

1..Excel(excel => excel
2.       .FileName("ExcelFileName.xlsx")
3.       .AllPages(false)
4.       .ProxyURL(Url.Action("BackOfficeExportFunction", "Grid"))
5.)

 

Thanks in advance for your help !

Tsvetomir
Telerik team
 answered on 22 Dec 2020
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?