How can I pass the selected Kendo Menu Text to Controller - c#-4.0

How can I pass the selected Kendo Menu Text to Controller???
menu.Add()
.Text("Reports")
.Items(item =>
{
item.Add().Text("Home").Action("Index","Sample");
item.Add().Text("About Us").Action("Index", "Sample");
});
Since both the menu items call the same controller, I need to pass the Menu Items Text to the controller to identify which menu was selected...

You can use the route values:
item.Add().Text("Home").Action("Index","Sample", new { text = "home" });
item.Add().Text("About Us").Action("Index", "Sample", new { text = "about us" });

Related

BarButtonItems not visible in iOS 11

I have an iOS app developed using Xamarin. Now I am trying to migrate it to iOS 11. My problem is that none of the BarButtonItems in navigation bars are visible in any controller, yet they are functional and I can tap them.
some of those button items are set in storyboard, by adding Navigation Item into the controller. titles of those button items are also invisible. even the standard back button.
the other bar button items are set in code by SetRightBarButtonItem or SetLeftBarButtonItem. I have both custom icon buttons and system item buttons. an example for system item button is:
this.NavigationItem.SetLeftBarButtonItem(new UIBarButtonItem(UIBarButtonSystemItem.Stop, (sender, e) => { ... }), true);
and another with custom icon button:
this.NavigationItem.SetRightBarButtonItem(new UIBarButtonItem(UIImage.FromBundle("gear"), UIBarButtonItemStyle.Plain, (sender, e) => { ... }), true);
These navigation bar button items have been working without problems for a long time. how can I fix them with the new navigation bar structure in iOS 11? (I do not enable large titles in navigation bars)
Just do something like this.
var button = new UIBarButtonItem(UIImage.FromBundle("gear"),UIBarButtonItemStyle.Plain, (sender, e) => { ... });
button.SetTitleTextAttributes(new UITextAttributes()
{
TextColor = UIColor.Blue,
TextShadowColor = UIColor.Clear
}, UIControlState.Normal);
this.NavigationItem.SetRightBarButtonItem(button, true);

Showing modal dialog when navigating away from a tab in TabStrip

Is there a way to display a modal dialog when user selects a tab in TabStrip component? The code below displays window.confirm, can not get modal dialog to display.
onTabSelected(e : any){
if (!window.confirm("Continue with navigation?")) {
e.prevented = true;
}
}
The dialog is not a direct substitute for window.confirm, because it cannot block the UI thread. To substitute the window.confirm with the Kendo UI dialog, you can prevent all tab selection, and wait for the dialog result:
onTabSelected(e: any) {
e.prevented = true;
this.dialogService.open({
content: "Continue with navigation?",
actions: [
{ text: "No" },
{ text: "Yes", primary: true }
]
}).result.subscribe((result) => {
if (result.primary) {
// change tab through code
this.tabStrip.selectTab(e.index);
}
});
}
See this plunkr for a working demo.
Ended up canceling the tab selection event, showing modal dialog, and resubmitting event based on the user answer.

How do I add sub items to the main menu, and how do I put it on the side of the page?

How do you add a navigation menu bar which is positioned on the left side of the home page of a Vcl.js application?
How do you create sub menu items to the top menu navigation bar on the home page?
I am looking at the sample Customer Center example that was provided for the vcl.js framework.
menu handling is done on main.ts at the application level
var item = V.Application.addNavbarItem("HOME2", "icon-home icon-white", () => {
V.Application.navigateToPage("PageHome2", []); //this is the default click event
});
var subitem = b.addMenuItem('submenu');
subitem.onClicked = () => {
//on click
}

ASP.NET MVC GridView filtering by value from textbox on button click? (DevExpress)

Summary: I want to enter a text to the textbox, push the button, and the GridView should display the reduced content -- filtered by the value.
Details: Being a DevExpress APS.NET MVC 5 beginner, I have a simple demo application that uses the GridView. The first example uses the Gridview with filter row -- everything generated by the DevExpress (14.2) GridView wizard.
When entering some value to the column filter, the displayed content is reduced after a while:
I need to implement the alternative where I enter the value to the textbox, and the GridView content is updated only after pushing the Apply button:
The view is defined as follows:
#{
ViewBag.Title = "GridView filtering";
}
<h2>#ViewBag.Title</h2>
#Html.DevExpress().Label(settings =>
{
settings.Name = "Label";
settings.Text = "Filter for the Name column";
}).GetHtml()
#Html.DevExpress().TextBox(settings =>
{
settings.Name = "TextBox";
}).GetHtml()
#Html.DevExpress().Button(settings =>
{
settings.Name = "BtnApply";
settings.Text = "Apply";
settings.UseSubmitBehavior = true;
}).GetHtml()
#Html.Action("GridViewPartial")
I am lost on how to bind the button click to the functionality, how to get the textbox content, and how to pass it to the GridView and make it updated.
The Apply button should not perform submit in this scenario. Set its UseSubmitBehavior property to False. Handle the button's client-side Click event. To access it in mark-up, use ButtonSettings.ClientSideEvents:
#Html.DevExpress().Button(settings =>
{
settings.Name = "BtnApply";
settings.Text = "Apply";
settings.UseSubmitBehavior = false;
settings.ClientSideEvents.Click = "btnApplyClick";
}).GetHtml()
In the btnApplyClick JS function, use the TextBox'es clien-side GetText method to get the text typed in your TextBox. Then, use the Grid's client-side AutoFilterByColumn to apply your filter to the grid by the Name column:
<script type="text/javascript">
function btnApplyClick(s, e) {
var filter = TextBox.GetText();
GridView.AutoFilterByColumn("Name", filter);
}
</script>
Where "GridView" is the name of your GridView extension.

dijit menu onmouseover

I am using menu using dijit.menu and Its work with right click and left click.
How I open the menu on mouse over and close on onmouseout?
dijitActionMenu = new dijit.Menu({
targetNodeIds:[actionMenuId],
leftClickToOpen:"true"
});
Have you tried something like
// Create a new Tooltip
var tip = new dijit.Tooltip({
// Label - the HTML or text to be placed within the Tooltip
label: '<div class="myTipType">This is the content of my Tooltip!</div>',
// Delay before showing the Tooltip (in milliseconds)
showDelay: 250,
// The nodes to attach the Tooltip to
// Can be an array of strings or domNodes
connectId: ["myElement1","myElement2"]
});
More details are here dialogs_tooltips.Even dijit.Menu have onMouseOver even.
onMouseOver Event
I am able to get the dijit/Menu onmouseover.
Create an element which will invoke onmouseover event.
Element
show() will call custom widget which will create menu for you.
E.g.,
show = function() {
var roll = new rollover()
}
And rollover.js will be the custom widget.
From the constructor of it, you can invoke the function and create the menu.
pMenu = new Menu({ class: "rollovermenu", id: "rolloverid" });

Resources