Telerik Forums
UI for ASP.NET MVC Forum
0 answers
268 views
Hi, I want to position my window OFF center to the left. So it does not cover up a part of the screen I want the user to see. I am using this to open it. Any ideas on how I can manipulate the positioning? Css? 

.data('tWindow').center().open()
James
Top achievements
Rank 1
 asked on 23 Aug 2012
0 answers
148 views
Hi,

I start to test Kendo mvc helpers and I have few questions about grid:
- how to change-translate delete confirmation text in pop-up,
- how to set column to readonly, also on edit pop-up dialog,
- how to format elements on edit pop-up, like input and lable,
- how to change font size on command buttons or how to use only images without text on buttons

This is for first day :0)
Thx for any help or ideas

Tomaz
Tomaz
Top achievements
Rank 1
 asked on 23 Aug 2012
1 answer
258 views
Hi,

We are porting our Telerik MVC project to Kendo MVC.
How can we achieve this with Kendo?

Clientside rebind
var grid = $('#DaGrid').data('tGrid');
grid.refresh(
{
searchfilter: search
}
);

c#
public ActionResult Select_archief(string searchfilter)
        {
....
}

Thus a rebind with filter parameter.

Thanks,
Martin
Daniel
Telerik team
 answered on 23 Aug 2012
3 answers
1.3K+ views
This is my Kendo treeview definition:

@(Html.Kendo().TreeView()
        .Name("CollectionsheetTree")
        .DataSource(dataSource => dataSource
            .Read(read => read
                .Action("_getProjectCollectionsheetTree2", "Project", new { projectId = _projectId })            )
        )
 .HtmlAttributes(new { style = "height: 200px; overflow: auto; " })
 .DragAndDrop(!Model.IsReadOnly)
)

When the ajax call has completed, I need to run some processing on the treeview to style it (e.g. change the text font).

I put the code  in the $(document).ready as suggetsed by the Kendo documentation:

 $(document).ready(function () {
     var treeView = $("#CollectionsheetTree").data("kendoTreeView");

            treeView.find(".k-in").each(function() {
                var element = $(this),
                    data = element.find('> .data');

                if (data.length) {
                    //element.css('background-color', '#aabbcc' );
                    element.addClass("treeviewNode");
                    data.remove();
                }
            });
});


But the execution fails over on this line:
  treeView.find(".k-in").each(function() {

The error message says:
Microsoft JScript runtime error: Unable to get value of the property 'find': object is null or undefined

I think it is because when the $(document).ready is executed the treeview is still being constructed.
On the Telerik treeview control there is a OnDataBound event that can be used to ensure that a function is run only after the treeview has been fully initialised.

How can I ensure that the Kendo treeview has been initialised before calling the styling function on it?

For completeness, here is the controller method:

 

         public ActionResult _getProjectCollectionsheetTree2(kendoTreeviewItem node,   int? projectId)
         {
             var nodes = new List<kendoTreeviewItem>();
             List<DofSurvey> list;
             _dofSurvey.EnrolInUnitOfWork(_unitOfWork);
            
             int collectionSheetId;
             int.TryParse(node.id, out collectionSheetId);

             if (node.id == null)
             {
                 list = _dofSurvey.FindBy(f => f.ParentSurveyId == null & f.ProjectId == projectId, "Survey").ToList();
             }
             else
             {
                 list = _dofSurvey.FindBy(f => f.ParentSurveyId == collectionSheetId & f.ProjectId == projectId, "Survey").ToList();
             }

             list.ForEach(cs =>
             {
                 var d = new kendoTreeviewItem
                 {
                     id = cs.SurveyId.ToString(),
                     text = cs.Survey.Title + "<span class='data'></span>",
                     hasChildren = cs.ChildSurveys.Any()
                 };
                 nodes.Add(d);
             });
             return Json(nodes, JsonRequestBehavior.AllowGet);
         }


Veronique
Top achievements
Rank 1
 answered on 23 Aug 2012
0 answers
231 views

I am having issues with populating a telerik dropdown list using jquery. I get the following Error:

'get(...).options' is null or not an object

On line:

$("#courseID").get(0).options.length = 0;

Here is my telerik dropdown list:

                <%= Html.Telerik().DropDownList()
               
.Name("courseID")
               
.HtmlAttributes(new{ @id="courseID"})
                %>

Here is how I am trying to populate it using jquery:

I call the populateDDL function on "StudentID" focusout event, here is the function.

function populateDDL() {

var link = '/Student/EnrollerCourse';
$
.ajax({
    type
: 'POST',
    url
: link,
    data
: { id: $('#StudentId').val() },
    dataType
: 'json',
    success
: function (result) {
         $
("#courseID").get(0).options.length = 0;
        $
("#courseID").get(0).options[0] = new Option("Select", "Select");
        $
.each(result.courseID, function (item, value) {
           
var courseID = value;
            $
("#courseID").get(0).options[$("#courseID").get(0).options.length] = new Option(courseID);
       
});          
   
},
    error
: function (result) {
        alert
("Failed")
   
}
});
}
sam
Top achievements
Rank 1
 asked on 22 Aug 2012
0 answers
334 views
I am trying to create a dynamic form based on client requirement. if clients need custom input fields then we stored the details of the custom fields in the database. After they logged into the system we get the custom fields details as JSON result (sample shown below) by using this result i would like to create a observable model and form.

var sampleCustomFieldObj = { customfields: [ {columnName: "customField1",type:"number", displayName: "My Number Field"},{columnName: "customField2",type:"string", displayName: "My String Field"},
{columnName: "customField3",type:"date", displayName: "My Date Field"}] };

Thanks in advance,
Ramesh.
Ramesh
Top achievements
Rank 1
 asked on 22 Aug 2012
1 answer
245 views
Hi,
I am trying to load a kendo grid using Json Data coming from a controller. I would like to know how I can make my viewmodel grid observable. Please find my view model code below:

function

 

 

initControls() {

$(

 

"#ChargesGrid").kendoGrid({

dataSource: {

type:

 

"json",

transport: {

read: {

url:

 

"Charge/GetCharges",

dataType:

 

"json",

type:

 

"POST"

}

},

pageSize: 5

},

groupable:

 

false,

sortable:

 

true,

pageable: {

refresh:

 

false,

pageSizes:

 

true

},

columns: [

{ field:

 

"Description", title: resourcesSet.str_Desc, width: "150px" },

{ field:

 

"Amount_Due", title: resourcesSet.str_AmtDue, width: "50px" },

{ field:

 

"Date", title: resourcesSet.str_Date, width: "50px" },

{ field:

 

"Title", title: resourcesSet.str_Title, width: "150px" },

{ command: { text:

 

"Edit", click: showForm }, title: " ", width: "80px"}]

});

 

 

 

}



This is my html rendering the grid
<table id="ChargesGrid"></table>

Pechka
Top achievements
Rank 1
 answered on 22 Aug 2012
6 answers
316 views
By using a HierarchicalDataSource, the first time a node is expanded, the data is fetch from the data source.
The next time, the data is not retrieved from the data source.
How can one define, that on each expand, the data should be fetched from the data source?
Greg
Top achievements
Rank 1
 answered on 22 Aug 2012
1 answer
281 views
How can we make a cascading dropdownlist or combobox like the country and cities in kendo.
Thanks in Advance
Samuel
Top achievements
Rank 2
 answered on 22 Aug 2012
0 answers
509 views
I'm testing implemention of the Kendo MVC grid control using a server-side model.  My Kendo grid is bound to a model in the view and does not implement any Ajax within the control.  I think I have most of it working correctly now.  I did find that if I'm using .Sortable() on the grid control that it makes all column headers sortable regardless is there is a bound() definied for a column.  Some columns have more complex contents that require Templates.  Some columns I don't want to sort on, but without defining .Bound() I can't used .Sortable(false) on the specific column.

Without a bound defined when I click a column header it throws an unhandled exception for the value being 'undefined'.  I've set a bound on all columns now regardless if it is useful or not.  I also tried to use the .Sortable(false) and it doesn't work.  My column is still allowed to be sorted.  That is issue #1.  Issue #2 is I can't find out to get the header for a column to be completely blank.  If I define .Title(null) or .Title(string.Empty) or .Title("") all still result in a small 1 character underline in the header instead of being blank.  Below is a mock up of my code.  Can you let me know if I'm doing something wrong, if this is something I'll have to wait on for the next release or if there is a temporary workaround?

@(Html.Kendo().Grid(Model.innerModel)
        .Name("Grid")
        .Columns(columns =>
            {
                columns.Bound(p => p.Location).Title("Location");
                columns.Bound(p => p.Date).Title("Date").Format("{0:dd.MM.yyyy}");
                columns.Bound(p => p.Info).Template(@<text>@(Html.Raw(item.InfoHtml))</text>).Title("Complex Info");
                columns.Bound(p => p.moreInfo).Title("More Info");
                columns.Bound(p => p.evenMoreInfo).Title("Schedule");
                columns.Bound(p => p.DetailsId).Sortable(false).Template(@<text><a class='jb-row-detailBtn' href='/Info/Detail/@item.DetailsId.ToString()'>Details</a></text>).Title(string.Empty);
            })
       .Footer(true)
       .Pageable()
       .Sortable()
       .DataSource(dataSource => dataSource
           .Server()
           .PageSize(2)
           .Total(Model.innerModel.Count)
         )
  )
Adam Gilman
Top achievements
Rank 1
 asked on 21 Aug 2012
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
MultiColumnComboBox
Dialog
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
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?