Telerik Forums
UI for ASP.NET MVC Forum
1 answer
293 views

Hello ,

 

i have a mobile application which embeds a grid with scrollable Feature. Works fine in all android Browsers. But on iPhone the vertical scroll do not work. What could be causing this . I have set height as well.

@(Html.Kendo().MobileView()
.Name("Adressaktivitäten")
.Stretch(true)
.Layout("mobile-tabstrip")
.Title("Adressaktivitäten")
.Content(@<text>
<div >
<table style="width:100%;">
<tr><td>
@if (Model.AdressImgURL != "")
{
<img src="@Url.Action("GetAdressImage", "AdressDetail", new { strFilePath = Model.AdressImgURL })" alt="" style="height:100px;width:80px;" >
}
else
{
<img src="~/Images/vendor_big.png" alt="" style="height:80px;width:80px;" >
}
</td>
<td ><span style="white-space: pre-line;font-weight:bold;">
@Model.Title
</span>
</td>
<td class='alnright'> <a data-role="button" data-icon="search" style="font-size:16px;vertical-align:middle;border-radius: 0px;border:none;outline: 0;" href="@Url.Action("Index", "Adress")"></a>
</td>
</tr>
<tr></tr>
<tr></tr>
</table>
<div>
@(Html.Kendo().Grid(Model.AdrAktGrid)
.Name("Grid_Activity")
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("ObjectActivity_Read", "AdressActivity"))
.ServerOperation(false)
)
.Columns(columns =>
{
if (ViewBag.ObjListHeader != null)
{
for (int j = 0; j < ViewBag.ObjListHeader.GetLength(0); j++)
{
if (ViewBag.ObjListHeader[j, 0] == "ID")
{
columns.Bound(ViewBag.ObjListHeader[j, 0]).Title(ViewBag.ObjListHeader[j, 0]).Visible(false);
}       
                else
{
if (ViewBag.ObjListHeader[j, 0] != null)
{
if (ViewBag.ObjListHeader[j, 1] == "False")
{
columns.Bound(ViewBag.ObjListHeader[j, 0]).Title(ViewBag.ObjListHeader[j, 0]).Visible(false);
}
else
{
columns.Bound(ViewBag.ObjListHeader[j, 0]).Title(ViewBag.ObjListHeader[j, 0]).Width(120);
}
}
}
}
}
})
.HtmlAttributes(new { style = "height: 300px;" })
.Selectable(selectable => selectable
.Mode(GridSelectionMode.Single))
.Scrollable()
.Resizable(r => r.Columns(true))
)
</div>
</div>
</text>)
)

 

In older iphone browser it works fine though.

 

Thanks

 

Anamika

Konstantin Dikov
Telerik team
 answered on 02 Nov 2017
5 answers
906 views

Hi
May last question of the year.  I promise!  I really don't ask for help much for a long time user.

For my MVC scheduler edit popup I use a CustomEditorTemplate.cshtml because I added 2 extra fields.  Nice!

In that file I use the code below for my OwnerID dropdownlist which usually has 8 items. 
However,  I oftem limit the dropdownlist to only one item when I know the user is filtered to one OwnerID.
So I want the dropdown list to only have that one OwnerID in it automatically selected.  But... for some reason a blank row is at the top of the DDL so the user has to manually select the only one item.  I don't use .OptionLabel("xxx").  How can I get rid of the empty row at the top and make this work?

I can't switch to another ddl control because I need .Data("filterdata")  to pass parameters to.

Thanks

 

 

<div data-container-for="OwnerID" class="k-edit-field">
       @(Html.Kendo().DropDownListFor(model => model.OwnerID)
       .HtmlAttributes(new { data_bind = "value:OwnerID", style = "width: 300px" })
       .DataTextField("Text")
       .DataValueField("Value")
       .ValuePrimitive(true)
       .Template("<span class='k-scheduler-mark' style='background-color:\\#= data.Color?Color:'' \\#'></span>\\#=Text\\#")
       .DataSource(ds => ds
                .Read(read => read
                      .Action("GetDepartmentListx", "Scheduler")
                      .Data("filterdata")  // in index page this function passes checkbox data parameters
                      ))
       )
   </div>
Dimitar
Telerik team
 answered on 02 Nov 2017
2 answers
368 views

Hi,

In kendo grid view, on databound locked and lockable is not looking good and layout problem. Here sample code

http://dojo.telerik.com/@Suman%20G/OdUCiP

Is there any alternative events available?.

Regards
Suman G

Suman
Top achievements
Rank 1
 answered on 02 Nov 2017
3 answers
648 views
Using the Kendo Autocomplete to search in a collection of 5000+ items stored in a database. Due to that is chosen to perform the filtering on the server. The problem is that the search value (parameter filter) received by the function is always NULL.

The project is MVC4/razor based, on the page the autocomplete is defined like this:

@(Html.Kendo().AutoComplete()
                  .Name(
"ExternalId")
                  .Placeholder(
"Search...")
                  .MinLength(3)
                  .DataSource(source => source.Read(read => read.Action(
"SourcesForAutoComplete", "Source")
    .Data(
"onAdditionalData"))
                  .ServerFiltering(
true))
                  .HtmlAttributes(
new { style = "width:468px" }))
The javascript handling the additional data events is placed at the end of the cshtml of the page:
<script>
    function onAdditionalData() {
        return { filter: $("#ExternalId").val() };
    }
</script>

The MVC Source controller has the following function to provide the data and search functionality:
public JsonResult SourcesForAutoComplete(string filter)
{
    using (var db = new EasyTaskIntegrationEntities())
    {
        ...
        return Json(result, JsonRequestBehavior.AllowGet);
    }
}
Can anyone explain why the filter value received is NULL instead of the value typed in the Autocomplete?
kamlesh
Top achievements
Rank 1
 answered on 02 Nov 2017
2 answers
639 views

I'm evaluating the Kendo for Asp.Net controls and am currently looking at the Grid. I want to build an new/edit form for a Person model. A person can have 0 or more phone numbers. The user should be able to enter the person's first name, last name, multiple phone numbers, and then at the bottom of the form, click a save button to save the person and their phone numbers to the database all at once in a transaction.

For phone number entry, I want to allow the user to click a "New" button that, when clicked, opens a modal dialog containing the form to create a new phone number (e.g. a drop down list for the phone type and a textbox for the phone number.) After filling out the form, they click "Ok" and it displays this unsaved phone number in a table. The phone number's row has an edit and delete button. If I click the edit button, it opens the modal and displays the phone number again as I entered it to allow me to edit it. If I click the delete button, it asks for confirmation from the user and if they provide it, it removes the phone number. Again this is all happening client-side.

Looking at the Kendo Grid, the Popup mode is the right idea as far as the user experience for data entry, but it appears that it is requried to save to make a server call to save to the database upon closing the modal? Since the person that the phone number is a child of does not exist, this won't work, not to mention I want to save in a single transaction. But if there's a way to allow the popup to close and save changes on the client-side only, that's all I need. The Grid's batch editing mode looks like the editing occurs client-side so it may allow me to submit my person and the phone numbers to save in a single transaction, but it uses inline editing, which we do not like for our user experience.

Is it going to be possible to modify the client-side behavior to allow editing Grid rows in a modal dialog so they can be sumitted (and bound to their model) all at once? If so, what would it take to accomplish? I understand the Grid's edit modes can't be mixed, but I'm not sure that means I can't wire up my own javascript that works with my own modal form and the client-side Grid API if necessary.

Jesse
Top achievements
Rank 1
Veteran
 answered on 01 Nov 2017
1 answer
591 views

The Kendo DropDownList seems to take forever to load css. The values are loaded immediately although what is in the dropdown is the value not the text. The page is creating numerous dropdowns. It depends on the call but approximately 300. It works flawlessly with the mvc DropDownListFor. The Kendo call uses this:

@(Html.Kendo().DropDownList().Name("Reason" + person.Id.ToString()).DataTextField("Text").DataValueField("Value").BindTo(@Model.Reasons).Value(@person.ReasonId.ToString()))

All I have to do for the mvc drop down is the following:

@Html.DropDownListFor(m => person.Reason, Model.Reasons)

 

Should I do something different in the bind?

Veselin Tsvetanov
Telerik team
 answered on 01 Nov 2017
4 answers
529 views

I am using Kendo MVC Upload control.  I am using it non-async mode with Multiple files marked false.

I want to use the events to control enabling/disabling the form Submit button.  This works except in one case.  If you select a file that fails validation, then select a new file that succeeds validation.  My Submit button is still marked disabled.

This seems to be because the onSelect event fires 1st and then the onRemove event fires 2nd.
I would like to suggest it would be better for the OnRemove event fire 1st and the onSelect event to fire 2nd.

$(document).ready(function () {
    $("#SubmitButton").attr("disabled", true);
});

function onSelect(e) {
    if (e.files[0].validationErrors == undefined) {
        $("#SubmitButton").attr("disabled", false);
    } else {
        $("#SubmitButton").attr("disabled", true);
    };
}

function onRemove(e) {
    $("#SubmitButton").attr("disabled", true);
}

 

Chuck
Top achievements
Rank 1
 answered on 01 Nov 2017
2 answers
470 views

I'm using latest build of Kendo UI MVC (2017.3.913) and I have a complex form which contains TabStrip.
Each Tab within the TabStrip contains PanelBar with multiple expandable\collapsible panels that allow me to view and edit data. When I expand a Panel the vertical scroll-barallows me to scroll down to view details etc.. Everything works fine so far.

On the form I also dynamically add a Kendo Window (dialog) and do various things like - Select Address,Select Person etc.. Dynamically creating it is a must - I destroy it after every time i use it. For demonstration the javascript function below creates the Window what I require to show the problem:

 

//This dynamically creates a Window (but donst show it yet)
function testCreateWindowDynamically()
{
  $(document.body).append("<div id='myContainerDiv' class='dlgContainer'></div>");
  $("#myContainerDiv").append("<div id='myDialogWindow' class='dlgDialog'></div>");
  var dialog =
    $("#myDialogWindow").kendoWindow({
      title: "",
      modal: true,
      actions: ["Close", "Minimize", "Maximize"],
      visible: false
    });
 
  $("#myDialogWindow").data("kendoWindow").maximize();
}

 

When I run this the vertical scroll bar on the tab strip disappears and I cant scroll down to view content not displayed on screen. Why is the vertical scroll bar disappearing?

 

Veselin Tsvetanov
Telerik team
 answered on 01 Nov 2017
8 answers
694 views

I'm looking at the Hierarchy Grid Demo (http://demos.telerik.com/aspnet-mvc/grid/hierarchy) for inspiration on something similar I need to do.

In the demo, it's a list of people, and the detail grid shows orders placed for the person in the parent grid.  So hypothetically, how would you implement a client side filtering condition that used data from the details to get a list of the parents?  Say I want a list of all people who had orders shipped to Australia?  Would I have to build a custom search, then populate the grid with the results, or is there a way to build that filter condition within the built in grid capabilities?

Stefan
Telerik team
 answered on 01 Nov 2017
7 answers
551 views
Hi all,

I am busy trialing KendoUI Complete for MVC with a purchase coming month end.

I have a KendoUI Grid in place with the editor mode being set to GridEditMode.PopUp.
I have created an EditorTemplate for the popup and this is working great for editing existing records. Everything 100% here.

My problem comes in with creating a new one. The editor only shows 2 fields - Description and Date (Textbox and DatePicker).
When I click the Update button in the editor I get a validation message "The Key Field Is Required" and cannot create the new record.
I have decorated the key property in my model with Editable(false), Browsable(false) and ReadOnly(true)  and still the message persists.
The key field is not even displayed in the Editor, so why is there validation on it?
The key field is a Guid type.

Any ideas how to get around this?

Another smaller issue, is I cannot resize the editor. I have tried ".Window(window => window.HtmlAttributes(new { @style = "width:500px;" }))" but it has zero effect. The editor is always the same default size no matter what I do.

TIA
Mike
Jesse
Top achievements
Rank 1
Veteran
 answered on 31 Oct 2017
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
Security
ColorPicker
DateRangePicker
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
DropDownButton
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
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
LLM Kit
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?