Telerik Forums
UI for ASP.NET MVC Forum
3 answers
995 views

Hello,

 

My Kendo menu has 3 items. First is an Icon , second is a text "Adress suchen" and third is another Icon with Sub menuitems. Using following Stylesheet i could achieve partially but i cannot Center align the text of manu. Also the left side Icon is outside the menu width.

@(Html.Kendo().Menu()
.Name("menuImages")
.Items(items =>
{

items.Add().Text("<span class=\"k-icon k-i-menu\"></span> ").HtmlAttributes(new { id = "mnuMain" }).SpriteCssClasses("k-icon k-i-menu").Encoded(false)
.Items(children =>
{
.....
children.Add().Text("Alle Objekte Anzeigen");
});            
items.Add().Text("Adressen suchen").HtmlAttributes(new { id = "mnuTitle" }).ContentHtmlAttributes(new { @style = "text-align:middle;" });
items.Add().Text("<span class=\"k-icon k-i-grid\"></span> ").HtmlAttributes(new { id = "mnuHome" }).SpriteCssClasses("k-icon k-i-grid").Encoded(false);


})

My css is

ul.k-widget.k-menu-horizontal > .k-item
{
float: right;
}
#menuImages > .k-last {
float: left;
width:40px;
}

So i want both Icon items left and right aligned and middle one text Center aligned

Thanks

 

Anamika

Neli
Telerik team
 answered on 28 Sep 2017
1 answer
1.0K+ views

Hi,

In button click event inside the script will call $("#grd").data("kendoGrid").dataSource.read(); 

script for Grid databound

function onDefaultSelect(e) {
    
    var rows = e.sender.tbody[0].rows;
    $(rows).each(function (e) {
        var grid = $("#grd").data("kendoGrid");
        var row = this;
        var dataItem = grid.dataItem(row);        
        grid.select(row);
    });    
    var getValue = this.selectedKeyNames().join(",");
}

When I button click  the selectedKeyName value is getting correct. When I button click again, the selectedkeyvalue is not changed, it getting old value. Is there any missing script ??

Regards

Suman

Stefan
Telerik team
 answered on 28 Sep 2017
1 answer
218 views

How to include filter options in the header template for a grid when exporting to PDF. For example, if user has filtered a grid column by say username = 'John', I need to change the header template to contain the text 'Sorted by username: John' in the PDF header.

The filter options should only be displayed in the exported files and not in the webpage. Can it be implemented in both - JavaScript and asp.net?

Stefan
Telerik team
 answered on 28 Sep 2017
2 answers
718 views

Hello there guys, i need your help. i have a batch edit grid view. And when i click on particular cell, i get the correct column name  of the clicked cell as long as the grid is un-grouped. When i group the columns in the grid, the name are all wrong.

Here is my grid

01.@(Html.Kendo().Grid<P2I_UI.Models.ViewM.Plan>()
02.    .Name("PlanGrid")
03.    .Columns(columns =>
04.    {
05.        columns.Group(ScriptGroup => ScriptureGroup
06.               .Title("<center>Scripture</center>")
07.               .Columns(dd =>
08.               {
09.                   dd.Bound(e => e.MaterialCategory).Title("Type").Width(110).HtmlAttributes(new { @style = "text-align:center; font-weight:normal; font-size:80%" }).ClientTemplate("#=MaterialCategory.ShortName#").Sortable(false);
10.                   dd.Bound(e => e.Product).Title("Item No").Width(130).HtmlAttributes(new { @style = "text-align:center; font-weight normal; font-size:80%" }).ClientTemplate("#=Product.ItemNumber#").Sortable(false);
11.                   dd.Bound(e => e.ProductName).Title("Description").Width(160).HtmlAttributes(new { @style = "text-align:center; font-weight normal; font-size:80%" });
12.               })
13.        );
14.        columns.Bound(c => c.ProjectEOYInventoryAssigned).Title("Proj.<br>EOY Inv<br>Assgnd").Width(71).HeaderHtmlAttributes(new { style = "text-align:right; font-weight: normal; font-size:85%" }).HtmlAttributes(new { @style = "text-align:right; font-weight:normal; font-size:80%" }).Format("{0:,#}");
15.        columns.Group(OuterGrantQuantity => OuterGrantQuantity
16.              .Title("<center>Grant Quantity</center>")
17.              .Columns(ogq =>
18.              {
19.                  ogq.Bound(e => e.Quarter1).Title("Q1").Width(95).HtmlAttributes(new { @style = "text-align:right; font-weight: normal; font-size:80%" }).Format("{0:,#}");
20.                  ogq.Bound(e => e.Quarter2).Title("Q2").Width(95).HtmlAttributes(new { @style = "text-align:right; font-weight: normal; font-size:80%" }).Format("{0:,#}");
21.                  ogq.Bound(e => e.Quarter3).Title("Q3").Width(95).HtmlAttributes(new { @style = "text-align:right; font-weight: normal; font-size:80%" }).Format("{0:,#}");
22.                  ogq.Bound(e => e.Quarter4).Title("Q4").Width(95)..HtmlAttributes(new { @style = "text-align:right; font-weight: normal; font-size:80%" }).Format("{0:,#}");
23.              })// end of the column
24.        );
25.columns.Bound(e => e.TotalGrantedRequest).Title("Tot.<br>Granted<br>Req").Width(72).HtmlAttributes(new { @style = "text-align:right; font-weight:normal; font-size:80%" }).Format("{0:,#}");
26.        columns.Bound(e => e.StandardCostPerUnit).Title("Cost<br>Per Unit").Width(72)..HtmlAttributes(new { @style = "text-align:right; font-weight:normal; font-size:80%" }).Format("{0:c}");
27.        columns.Bound(e => e.EstimatedGrantedCost).Title("Est.<br>Granted<br>Cost").Width(73)..HtmlAttributes(new { @style = "text-align:right; font-weight: normal; font-size:80%" }).Format("{0:c0}");
28.        columns.Bound(e => e.TotalNumberNeeded).Title("Tot.<br>Number<br>Needed").Width(75).HtmlAttributes(new { @style = "text-align:right; font-weight: normal; font-size:80%" }).Format("{0:,#}");
29.        columns.Command(e => e.Destroy().Text(" ").HtmlAttributes(new { @title = "Delete" })).Width(1);
30.    })
31.    .ToolBar(toolbar => { toolbar.Create(); toolbar.Save(); })
32.    .Editable(editable => editable.Mode(GridEditMode.InCell))
33.    .Events(events =>
34.    {
35.        events.Edit("onEditPlanGrid");
36.    })
37.    .Navigatable()
38.    .Sortable()
39.    .DataSource(dataSource => dataSource
40.        .Ajax()
41.        .Batch(true)
42.        .PageSize(30)
43.        .ServerOperation(false)
44.        .Model(model =>
45.        {
46.            model.Id(p => p.PlanScriptureID);
47.            model.Field(p => p.MaterialCategory).DefaultValue(ViewData["defaultMaterialCategory"] as P2I_UI.Models.ViewM.MaterialCategoryVM);
48.            model.Field(p => p.Product).DefaultValue(ViewData["defaultProduct"] as P2I_UI.Models.ViewM.ProductVM);
49.            model.Field(p => p.ProjectEOYInventoryAssigned);
50.            model.Field(p => p.TotalGrantedRequest).Editable(false);
51.            model.Field(p => p.StandardCostPerUnit);
52.            model.Field(p => p.EstimatedGrantedCost).Editable(false);
53.            model.Field(p => p.TotalNumberNeeded).Editable(false);
54.        })
55.        .Create("Script_Create", "Plan")
56.        .Read("Script_Read", "Plan")
57.        .Update("Script_Update", "Plan")
58.        .Destroy("Script_Delete", "Plan")
59.        .Events(e1 => e1.Change("onChange"))
60.    )
61.)
62. 
63.    function onEditPlanGrid(e) {
64. 
65.        var grid = $("#PlanGrid").data("kendoGrid");
66.        var fieldName = grid.columns[e.container.index()];
67. 
68.        console.log("this is fieldName:", fieldName)
69.        //if (fieldName === undefined) {
70.        //    e.sender.closeCell();
71.        //}
72.    }

 

How do i get the correct column name of the cell that was clicked?. Thank

 

Chinonso
Top achievements
Rank 1
 answered on 27 Sep 2017
1 answer
306 views

Hello,

I have two grids (#Grid1 and #Grid2) with a field "Column"
I need the field "Column" in the second grid to has a value less than a value from page.
According to this topic:
http://demos.telerik.com/aspnet-mvc/grid/editing-custom-validation
I just have to write "$.extend(true, kendo.ui.validator" and "a rule", but it will affect two grids
So a question sounds like: "How to write a validation rule that will affect only one grid in page?"

Georgi
Telerik team
 answered on 27 Sep 2017
1 answer
210 views

Hello,

 

In my Kendo mobile app in MobileLayout Header i want a Dropdown menu on right handside. To achieve this i am using MobileNavBar in Header and tried to put a menu inside. But it does not work. In attached Picture i have used a MobileButton inside navbar with 3 horizontal bar. So it Looks ok. Now when clicking on this button i want a Dropdown menu. is it achievable? If yes how. Here is my code so far

@(Html.Kendo().MobileView()
.Name("Adressen")
.Stretch(true)
.Layout("mobile-tabstrip")
.Content(@<text>
@AdressGrid()
</text>)
)

@(Html.Kendo().MobileLayout()
.Name("mobile-tabstrip")
.Header(obj => NavBarTemplate(this))
.Footer(
@<text>
@(Html.Kendo().MobileTabStrip()
.Items(items =>
{
items.Add().Text("Adresse").HtmlAttributes(new { @data_icon = "vendor-e" });
items.Add().Text("Sms").HtmlAttributes(new { @data_icon = "share" });
items.Add().Text("Detail").HtmlAttributes(new { @data_icon = "home" });
items.Add().Text("Home").HtmlAttributes(new { @data_icon = "home"});
items.Add().Text("Home").HtmlAttributes(new { @data_icon = "gps-e" });
})
)
</text>)
)

@helper NavBarTemplate(WebViewPage page)
{
@(Html.Kendo().MobileNavBar()
.Content(navbar =>
@<text>
@navbar.ViewTitle("Adressen")
@(Html.Kendo().MobileButton()
.Align(MobileButtonAlign.Right)
.HtmlAttributes(new { @class = "nav-button" ,@data_icon = "arrow-e"})
.Text(""))
</text>)
)

}

Thanks

 

Anamika

 

Veselin Tsvetanov
Telerik team
 answered on 27 Sep 2017
1 answer
987 views

Hi,

I want to use Grid ForeignKey column to choose objects by id.

The sample is in attachment. I want to make school column and grade column nullable, and I can set the value to null when I edit the row.

How to do this?

 

If I want to choose school column value by typing characters for filtering, is it possible to do this in Grid ForeignKey column? Or I have to use ClientTemplate to solve this problem? 

 

Because the sample file exceed the maximum size, I removed Telerik js/css files from the sample, please use version 2017.3.913

 

Georgi
Telerik team
 answered on 26 Sep 2017
2 answers
1.0K+ views

How to include image inside header & footer template for a grid when exporting to PDF and Excel.

The Image should only be displayed in the exported files and not in the webpage.
How to implement this in both JavaScript and ASP MVC?

Yanesh
Top achievements
Rank 1
 answered on 26 Sep 2017
2 answers
692 views

Hello,

Is there a way to filter the grid directly while typing without the need to hit the enter key?

For example when i type "b" in the name search box the grid show me all products with a "b" in it.

I couldn't find documentation regarding the possibility about this.

Thank you.

Roelande
Top achievements
Rank 1
 answered on 26 Sep 2017
2 answers
247 views

I have a FlatColorPicker nested inside of a Kendo PanelBar that is not behaving. It is typically NOT visible when the page renders because it is inside a collapsed panel of the PanelBar. At this point it is acceptable except that the slider on the bottom only fills half of the full width of the picker, but it does work. After my "Save" js function for the page runs, the slider disappears leaving on the round slider handle.

 

@(Html.Kendo().FlatColorPicker()
        .Name("screen_background_color_select")
        .HtmlAttributes(new { style = "width: 245px" })
        .Value(Model.screen_background_color)
        .Events(ev => ev.Change("paletteChange"))
        .Preview(true)
        .Opacity(true)
)

 

I DO have some bootstrap styling inside the Panel but I have gone so far as to remove the FlatColorPicker from the PanelBar and bootstrap to no avail.  Still behaves the same.  I have verified that the Value string for the color is correct.

If I make the simple change to a ColorPicker, it works as it should.  I change nothing from the above code except removing the "Flat".

 

Magdalena
Telerik team
 answered on 26 Sep 2017
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
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?