Telerik Forums
Kendo UI for jQuery Forum
3 answers
661 views
Hello,i am a computer science student ,working for a small software company and totally newbie about KendoUI.
I have a MVC project  that connects to database ,get and shows data's on KendoUI grid.I would like to  use combobox on my custom editor template with KendoUI grid pop up.

There is Kendo combobox on Index page.It fetchs and shows records from db  with selected column().
I am using  Kendo grid -  pop up  as a  interface.There are add,edit, and update buttons.When i click add or edit button  pop up screen opens which is related to my custom template.Every command is working well(add,edit,delete)

The problem is when i add Kendo combobox to my custom editor template , it  shows nothing on grid.Edit and delete buttons are missing and when i click to add button it shows this ajax code.It looks like some problem about rendering.
{"Data":[],"Total":4,"AggregateResults":null,"Errors":null}

Here is my Kendo combobox code:
@(Html.Kendo().ComboBox()
  .Name("productComboBox") //The name of the combobox is mandatory. It specifies the "id" attribute of the widget.
  .DataTextField("ALLERGYTYPE") //Specifies which property of the Product to be used by the combobox as a text.
  .DataValueField("ID") //Specifies which property of the Product to be used by the combobox as a value.
// .Filter(FilterType.Contains)
 .Placeholder("ALLERGYTYPE")
  
 .DataSource(source =>
 {
    source.Read(read =>
    {
        read.Action("GetProducts", "AllergiesData"); //Set the Action and Controller name
    })
    .ServerFiltering(true); //If true the DataSource will not filter the data on the client.
 })

Getting data controller for combobox -
public JsonResult GetProducts()
{
    PHRDevEntities patient = new PHRDevEntities();
 
 
    return Json(patient.PR_PATIENTALLERGY, JsonRequestBehavior.AllowGet);
 
 
}

Another controller to get,create ,update etc.
public ActionResult Get([DataSourceRequest]DataSourceRequest request)
       {
           return Json(DataAccess.Get(request), JsonRequestBehavior.AllowGet);
       }
 
 
       public ActionResult CreateSingle([DataSourceRequest]DataSourceRequest request, TEntity itemNew)
       {
           return Json(DataAccess.Create(request, itemNew.ToArrayFromObject(), false, ModelState), JsonRequestBehavior.AllowGet);
       }
 
public ActionResult Create([DataSourceRequest]DataSourceRequest request, [Bind(Prefix = "models")]IEnumerable<TEntity> itemsNew)
       {
           return Json(DataAccess.Create(request, itemsNew, true, ModelState));
       }
 
       public ActionResult UpdateSingle([DataSourceRequest]DataSourceRequest request, TEntity itemUpdated)
       {
           return Json(DataAccess.Update(request, itemUpdated.ToArrayFromObject(), false, ModelState), JsonRequestBehavior.AllowGet);
       }
 
 
       public ActionResult DestroySingle([DataSourceRequest]DataSourceRequest request, TEntity itemToDelete)
       {
           return Json(DataAccess.Destroy(request, itemToDelete.ToArrayFromObject(), false, ModelState), JsonRequestBehavior.AllowGet);
       }

My custom editor template:
@model KendoUIMvcApplication1.DATA.PR_PATIENTALLERGY
       <strong>PR_PATIENTALLERGY</strong> <br />
 
        <table width="100%" cellspacing="5" style="margin:20px">
                                <tr>
                                    <td width="10%">@Html.LabelFor(model => model.PATIENTID)</td>
                                    <td width="40%">@Html.EditorFor(model => model.PATIENTID)
                                                    @Html.ValidationMessageFor(model => model.PATIENTID)</td>
 
                                    <td width="10%">@Html.LabelFor(model => model.DOCTOR)</td>
                                    <td width="40%" >@(Html.Kendo().ComboBox()
    .Name("productComboBox") //The name of the combobox is mandatory. It specifies the "id" attribute of the widget.
    .DataTextField("ALLERGYTYPE") //Specifies which property of the Product to be used by the combobox as a text.
    .DataValueField("ID") //Specifies which property of the Product to be used by the combobox as a value.
   // .Filter(FilterType.Contains)
    .Placeholder("ALLERGYTYPE")
     
    .DataSource(source =>
    {
       source.Read(read =>
       {
           read.Action("GetProducts", "AllergiesData"); //Set the Action and Controller name
       })
       .ServerFiltering(true); //If true the DataSource will not filter the data on the client.
    })
    //.SelectedIndex(0) //Select first item.
     
)
                             @Html.ValidationMessageFor(model => model.DOCTOR)</td>
 
                                </tr>
                     <tr>
                                 <td width="10%">@Html.LabelFor(model => model.ISACTIVE)</td>
                                    <td width="40%" >@Html.EditorFor(model => model.ISACTIVE)
                                                                @Html.ValidationMessageFor(model => model.ISACTIVE)</td>
                  </tr>
                            </table>
I have also DataAccess methods to control data.I can post them if it is needed.
He is the almost same problem with me:  stackoverflow
Vladimir Iliev
Telerik team
 answered on 26 Jun 2013
1 answer
108 views
Hi there I have a line chart with grouped data and narrowRange: true set.

When one of my datapoints has a null value it seems that narrow range is ignored.  Folks are choosing series from a dropdown and when one series has a null the scale changes suddenly which isn't ideal.

Here is a fiddle with all datapoints for each line  and narrowRange working well-  http://jsfiddle.net/jriley17/vDdmt/
and here is one with a null value for one of the points -  http://jsfiddle.net/jriley17/j83Sk/

thanks!
Iliana Dyankova
Telerik team
 answered on 26 Jun 2013
1 answer
147 views
I have following code and I am getting e.dataItem as undefined. Is there a way to get access to dataItem and its properties at client using JavaScript?

Html.Kendo().Grid<AdminReport>()   
.Name("AdminReportList")
.Columns(c =>        
{
c.Bound(r => r.Name).Title("Report Name").Width(50);                    
c.Bound(r => r.Id).Title(action).Width(230).Sortable(false).Filterable(false)
})
.Pageable(p => p.PreviousNext(true))
.Sortable()
.Filterable()   
.Events(e => e.DataBound("onRowBound"))   
.DataSource(d => d       
.Ajax()       
.Model(m => m.Id(r => r.Id))       
.Read(read => read.Action("_ListAllReports", "AdminReports"))       
.Events(e => e.Error("OnError")))
.Render();
function onRowBound(e) {
    
  if ((e.dataItem.SomeProperty === true)) {
       //Some code...
    }
 
}
Dimiter Madjarov
Telerik team
 answered on 26 Jun 2013
1 answer
119 views
Is there way to show spinner for chart while used datasource fetches data from server (ajax call)?

Thanks!

Kiril Nikolov
Telerik team
 answered on 26 Jun 2013
2 answers
151 views
I want the Stacked bars have no border, how can I config?
wei
Top achievements
Rank 1
 answered on 26 Jun 2013
7 answers
378 views
Reading http://docs.kendoui.com/getting-started/framework/spa/view I understand that the "render" method renders a view inside a container by replacing the current content with the new content.

However, when testing, I did not see that behaviour. Actually on "render" the view is appended to the current content, inside the wrapping "div" element.

Michael G. Schneider
mgs
Top achievements
Rank 1
 answered on 26 Jun 2013
1 answer
158 views
Our page contains complex "Widgets" and each widget might have multiple views, and we're using MVVM for the data.

I'm wondering (and I've seen posts eluding to this) if I can scrap the url routing portion and just be able to define views for each widget?...I'm concerned with the routes in the url and multiple widgets all getting confused and\or creating a terrible url.  Really nobody would be going "back", bookmarking, or linking anyway.

If this is possible, is there a demo\sample anywhere?

Steve
sitefinitysteve
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 25 Jun 2013
1 answer
146 views
I am trying to edit the grid height with a bit of jquery and binding.
It does not appear to work.
I can do the colours and the font, but the height does not want to budge.
Below is my test on fiddle.
http://fiddle.jshell.net/zawisza/2k4hX/3/

Anyone know how to fix that?
Iliana Dyankova
Telerik team
 answered on 25 Jun 2013
1 answer
742 views
In my grids I have partials views as my editor templates. In the these editor templates I try to check the values on create and edit using razor if statements. These statements do not seem to work for grid editor templates. Here is an example
@if(Model.UserName!=null)
{
@Html.LabelFor(m=>m.Username)
}
else
{
@Html.TextBoxFor(m=>m.UserName)
}

The if always seems to fail is this because after the template is rendered these statements are no longer there and cannot be reached?

Is the only way to accomplish my task is by altering these elements via jquery in the grid edit event?
Alexander Valchev
Telerik team
 answered on 25 Jun 2013
1 answer
336 views
I am trying to change the "save" icon on my edit form when an item is flagged dirty as a visual reminder to the user to save her/his work. However it does not appear as though the "dirty" attribute of the Model object is observable. Its value never changes in the UI when I bind to it nor does it ever notify when I bind to the "change" event.

I know that I can do what I want by binding to "change" but it seems silly to have to observe the entire object and have an event that fires with every change and for any change when a property already exists that purports to contain the desired information that I am after.

Or am I just missing something?

http://jsfiddle.net/RobertKaucher/Fyrs6/
Daniel
Telerik team
 answered on 25 Jun 2013
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Drag and Drop
Application
Map
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
ListBox
DropDownTree
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
Licensing
ScrollView
Switch
TextArea
BulletChart
QRCode
ResponsivePanel
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
TimePicker
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
LLM Kit
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?