Telerik Forums
UI for ASP.NET MVC Forum
5 answers
1.2K+ views
Hi
I have this issue with KendoUI window control. I will add some code as well.

My view with window opening logic.

@(Html.Kendo().Window()
    .Name("window")
    .LoadContentFrom("FirstAction", "Controller", new { area = ""})
    .Modal(true)
    .Visible(false)
      )
<script type="text/javascript" language="javascript">
    function openModalForm(e) {
        e.preventDefault();
        var windowElement = $('#window').data("kendoWindow");
        windowElement.refresh();
        windowElement.center();
        windowElement.open();
    }
</script>
                <span>@Html.ActionLink("Link to open window", "Action", Controller", new { area = "" }, new { onclick = "javascript:openModalForm(event);" })</span>

FirstAction in Controller returns this:
public ActionResult FirstAction()
{
   return PartialView("_MainWindowContent", new MyModel());
}

_MainWindowContent contains:
@model MyWeb.Models.MyModel
<div class="popup" id="popupDiv">
    @{
        Html.RenderPartial("_FirstStep", Model);
    }
</div>

_FirstStep contains:
@model MyWeb.Models.MyModel
    <div class="form">
        <h1 class="step-1">Form field title</h1>
        <div class="form-list">
            @using (Ajax.BeginForm("FirstStep", "Controller", null, new AjaxOptions { HttpMethod = "POST", UpdateTargetId = "popupDiv", InsertionMode = InsertionMode.Replace }, new { id = "mainForm" }))
            {
                <ul>
                    <li class="form-field" id="firstField">
                        @Html.LabelFor(m => m.FirstField, "First field")
                        <div class="input-box">
                            @Html.TextBoxFor(m => m.FirstField)
                        </div>
                    </li>
                 
                    <li class="form-field" id="secondField">
                        @Html.LabelFor(m => m.SecondField)
                        <div class="input-box">
                            @Html.TextBoxFor(m => m.SecondField)
                        </div>
                    </li>
                    <li class="form-field" id="thirdField">
                        @Html.LabelFor(m => m.ThirdField)
                        <div class="input-box">
                            @Html.TextBoxFor(m => m.ThirdField)
                        </div>
                    </li>
                    <li class="form-field" id="fourthDate">
                        @Html.LabelFor(m => m.FourthDate)
                        <div class="password-box">
                            @Html.Kendo().DatePickerFor(m => m.FourthDate)
                        </div>
                    </li>
                </ul>
                @Html.HiddenFor(m => m.HiddenValue)
            }
        </div>
        <div class="popup-navigation">
            <button id="nextButton"> Go to next step </button>
        </div>
    </div>
        <script type="text/javascript" language="javascript">
             
            $("#nextButton").click(function () {
                $("#HiddenValue").val("true");
                $("#mainForm").submit();
            });
    </script>
    </div>

FirstStep contains some logic and then return partial view "SecondStep" with some more new fields. I thought it should update the div with the id of "popupDiv". This is at least how it worked in telerik window control, which I also used a bit. But what it does on my machine is that, it just goes straight to {site}/Controller/FirstStep, that is what I see on the browser address. The whole page contains only elements from SecondStep partial view. The controller FirstStep gets all the data correctly. Is there any way to post data or update window or am I missing some attributes or something?
Daniel
Telerik team
 answered on 08 Aug 2014
2 answers
672 views
I need to add a tolltip to the Edit Button. I've tried this approach but it fails display the values for the column.
This approach displays the Following tooltip: Edit #= UserFirstName # #=UserLastName#, #=RoleDescription#
Should display: Edit MIKE JOHNSON, Adminstrator

com.Edit().HtmlAttributes(new { title = string.Format("Edit {0} {1}, {2}", "#= UserFirstName # ", "#=UserLastName#", "#=RoleDescription#") });

I was not able to find any post that shows a solution to this.
What I'm doing wrong.

Current Version: 2014.2.716

The complete code is below.

@(Html.Kendo().Grid<FDolUser>()
.Name("grid")
.Columns(col =>
{
col.Command(com =>
{
com.Edit().HtmlAttributes(new { title = string.Format("Edit {0} {1}, {2}", "#= UserFirstName # ", "#=UserLastName#", "#=RoleDescription#") });
com.Destroy();
});
col.Bound(c => c.RacfId).ClientTemplate("#=UserTypeDescription#").Title("User Type");
col.Bound(c => c.RacfId).ClientTemplate("#=VendId#").Title("Vendor Id");
col.Bound(c => c.RacfId);
col.Bound(c => c.RacfId).ClientTemplate("#=StaffMemberSequence#").Title("Staff Id");
col.Bound(c => c.RoleCode).ClientTemplate("#=RoleDescription#");
col.Bound(c => c.RacfId).ClientTemplate("#=SubScrabAcctId#").Title("ISA Id");
col.Bound(c => c.UserFirstName);
col.Bound(c => c.UserLastName);
})
.Filterable()
.Sortable()
.Pageable()
.ToolBar(t => t.Create())
.Editable(e => e.Mode(GridEditMode.PopUp))
.Events(e => e.Edit("onEdit").DataBound("onDataBound"))
.DataSource(ds => ds
.Ajax()
.Model(model => model.Id(p => p.UsrSq))
.Events(events => events.Error("onError"))
.Read(r => r.Action("GetUser", "Admin"))
.Update(u => u.Action("UserUpdate", "Admin").Data("additionalInfo"))
.Destroy(d => d.Action("userDestroy", "Admin"))
.Create(c => c.Action("UserUpdate", "Admin").Data("additionalInfo"))
.ServerOperation(true)
))
Mike
Top achievements
Rank 1
 answered on 08 Aug 2014
1 answer
240 views
We inherited a mission critical codebase that we are upgrading from .NET 1.1 to .NET 3.5.  This codebase uses RadGrid 5.1 for .NET 1.1.  This old library will not work in .NET 3.5.  We are willing to purchase whatever suite is necessary for us to acquire RadGrid.Net2.dll v. 5.1. 

Thanks,
Robert Ryan
Viktor Tachev
Telerik team
 answered on 08 Aug 2014
1 answer
146 views
For my purposes, the typical case will be 100 to 10,000 rows of data in 1 to 16 groups.  What I would like to do is for the grid to first load the applicable groups, all collapsed, and then to begin loading the data for each of these groups in the background after the page has come up.  Is this possible with out-of-the-box functionality?
Nikolay Rusev
Telerik team
 answered on 08 Aug 2014
2 answers
854 views
I have the following line in my grid:

.ToolBar(toolbar => toolbar.Create().Text("Add"))


How do I align the button to the right, which is otherwise defaulted to left?
Russ
Top achievements
Rank 2
 answered on 07 Aug 2014
3 answers
118 views
When I upgraded to 2014.2.716, a visual error started occurring in my grid controls with child controls in the grid's toolbar.

01.@(Html.Kendo().Grid<TestRowClass>()
02.    .Name("TestGrid")
03.    .ToolBar(toolbar => toolbar.Template(@<text>
04.            @(Html.Kendo().AutoComplete()
05.                .Name("TestAutoComplete")
06.            )
07.        </text>)
08.    )
09.)


I tested that in a brand new project using the CDN to make sure i eliminated all other code. The "TestRowClass" can contain any properties, i only use it to help render the grid itself.

When I use the razor scripting above, all of the <script> tag content shows up in the toolbar along side the control. The control works just fine, but the content of the script tag should not be visible.

I tried adding a simple style like "script { display:none; }" to the page, but that didn't fix the issue.

Any advice or fix would be appreciated. Thanks.
Mike
Top achievements
Rank 1
 answered on 07 Aug 2014
1 answer
122 views
Is it possible to specify a different ViewModel for  Create/Edit to what's specified in @Html.Grid<ViewModel>

I have separate ViewModels for Edit and Create as the validation rules are different.

Thanks
Steve
Nikolay Rusev
Telerik team
 answered on 07 Aug 2014
1 answer
184 views
I would like to know whether real time notification for chart is possible without refreshing the screen as like grid?If possible could you show an example of real time binding of that?

T. Tsonev
Telerik team
 answered on 07 Aug 2014
4 answers
307 views
Hi,
I'm basing my notifications on this demo: http://demos.telerik.com/aspnet-mvc/notification/templates
My templates are success, info, error, and warning.

@(Html.Kendo().Notification()
        .Name("notification")
        .Position(p => p.Pinned(true).Top(30).Right(30))
        .Stacking(NotificationStackingSettings.Down)
        .AutoHideAfter(0)
        .Templates(t =>
        {
            t.Add().Type("info").ClientTemplateID("infoTemplate");
            t.Add().Type("success").ClientTemplateID("successTemplate");
            t.Add().Type("error").ClientTemplateID("errorTemplate");
            t.Add().Type("warning").ClientTemplateID("warningTemplate");
        })
    )

Then I show them like this in JS...

notification.show({
    message: "Upload Successful",
}, "success");

I can set AutoHideAfter when I declare the notification, however I was wondering if it's possible to set AutoHideAfter for an individual template? 
That way I can disable autohide for all templates except the success template. 

Thanks for any help,
Joe

Joe
Top achievements
Rank 2
 answered on 06 Aug 2014
4 answers
229 views
I have been attempting to implement a 'Workflow Progress' control for an application that I am building.  There are three major steps, the first two have three minor steps and the final has 5 minor steps.  I've been attempting to shoehorn the menu control into this as it appears to have 90% of the functionality that I need.  The dynamic open/close, the ability to remain open after selection and the animations are all perfect.  Vertical space in the app is at a premium so I've chosen to implement the menu horizontally, all very well and good.  The issue comes when I attempt to modify the behavior of the child <li> and their containing divs.  I'd like for the children to expand horizontally from the parent, and have subsequent parents shifted down.
 
Note: the ** below represent the 'selected' items (the current step of the workflow)
[*Major-1*][Minor-1][*Minor-2*][Minor-3][Major-2][Major-3] with the hover effect on unexpanded Major steps leading to:
[*Major-1*][Minor-1][*Minor-2*][Minor-3][Major-2][Major-3][Minor-1][Minor-2][Minor-3]...etc  Which is the default menu animation, but I cannot, for the life of me, figure out how to force the children to:

(1) Display inline
(2) Force expansion of the parent without having to use position: relative !important; and the resulting offsets on each level of stack.

Any thoughts?

Thanks!



Kamen Bundev
Telerik team
 answered on 06 Aug 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
Dialog
MultiColumnComboBox
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
ColorPicker
DateRangePicker
Security
Wizard
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
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?