Telerik Forums
UI for ASP.NET MVC Forum
3 answers
338 views
I have a grid that is showing fields and one of them is a Name field that can be long. When adding and editing a record, I want the Name field to be a textbox that is 2 rows high.

I created a EditorTemplate that looks as follows:

@(Html.TextArea("Name", new{style="width:200px;height:30px;",row="2",cols="30"})

I placed this at the top of the Name field in the ViewModel:

[UIHint("SponsorNameMultilineText")]

I am now seeing a text box but it has too many lines in it - I want it to be shorter. How do I do that?

 

 

 

 

 

 

Daniel
Telerik team
 answered on 20 Feb 2013
1 answer
322 views
Hi,

I have a hierarchical grid with where the child is displaying data from the parent, I suspect its the way Im binding to the data.

Parent

@(Html.Kendo().Grid(Model.CVXElements) // Specify the type of the grid
.Name("Grid")
.Columns(columns =>
{
    columns.Bound(p => p.ElementSeqNo).Title("Element ID").Width("100px").ClientTemplate(
        Html.ActionLink("#= ElementSeqNo #", "PUSH", "ElementBuilder", new {url = "~/PagCC/EB_ElementAddEdit.aspx", ID = "#= ElementSeqNo #", cvxCode = Model.CVXCode  }, null).ToString());
   
    columns.Bound(p => p.ElementName).Width("900px");
    columns.Bound(p => p.ElementStatus).Width("100px");
    columns.Bound(p => p.ElementActive).Title("Live").Width("100px");  
    columns.Bound(p => p.ParentElement).HtmlAttributes( new {@style= "display:none"}).HeaderHtmlAttributes(new { @style= "display:none;" });                   
})
.ClientDetailTemplateId("ParentElementTemplate")
.Events(events => events.DataBound("dataBound"))
.DataSource(dataSource => dataSource
.Ajax()
)
.Events(events => events.DataBound("dataBound"))
Child
<script id="ParentElementTemplate" type="text/kendo-tmpl">
    @(Html.Kendo().Grid<ElementBuilder.Models.Elements>(Model.CVXElementParents)
            .Name("ParentGrid")
            .Columns(columns =>
            {
 
                                columns.Bound(p => p.ElementSeqNo).Title("Element ID").Width("91px")
                                .ClientTemplate(
                                    Html.ActionLink("#= ElementSeqNo #", "PUSH", "ElementBuilder", new {url = "~/PagCC/EB_ElementAddEdit.aspx", ID = "#= ElementSeqNo #"  }, null).ToString());
                               
                                columns.Bound(p => p.ElementName).Width("910px");
                                columns.Bound(p => p.ElementStatus).Width("100px");
                                columns.Bound(p => p.ElementActive).Title("Live").Width("88px"); 
            })
            .DataSource(dataSource => dataSource
                .Ajax()
                .Read(read => read.Action("HierarchyBinding_ParentElements", "ElementBuilder", new { iElemSeqNo = "#=ElementSeqNo#" }))
            )
            .ToClientTemplate()
 
    )
</script>
Both grids use the ElementSeqNo field to create a Hyperlink, however as stated, the child is taking the parent element data.

Any suggestions appreciated.

Regards
Ross
Daniel
Telerik team
 answered on 20 Feb 2013
5 answers
188 views

Hi,

I'm have a Grid of users (Ajax datasource) with CRUD commands.

Is it possible to specify different templates for each command (one template for create, one for edit etc....?

Regards
Daniel
Telerik team
 answered on 20 Feb 2013
2 answers
466 views
Hi,

We have a requirement in our application that the user should not check the Root node, we need to disable the checkbox of root node alone.
We are loading the treeview using Ajax Binding (Load on Demand).
Please help.!

Thanks,
Vidya

Vidya
Top achievements
Rank 1
 answered on 20 Feb 2013
1 answer
137 views
Hi,

I display time in my grid by using:
columns.Bound(p => p.StartDate).Format("{0:HH:mm}").Title("Tid");
When i change my timezone the time changes, how do i prevent this?

i use:

<script src="@Url.Content("~/Scripts/kendo/2012.3.1121/cultures/kendo.culture.sv-SE.min.js")"></script>
 
<script>
      $(document).ready(function () {
        //set culture of the Kendo UI
        kendo.culture("sv-SE");
    });
</script>
But it still changes when i change my timezone.
Daniel
Telerik team
 answered on 20 Feb 2013
1 answer
1.4K+ views
Hello Telerik Team,

I'd like to know if there's any way to pass in an extra parameter to my controller action when using async upload.  Below is what the controller looks like.

public ActionResult Save(IEnumerable<HttpPostedFileBase> files, string uploadID)
{
 
}

One workaround I came up with is to use the route value below.  The I can update the saveUrl property of the upload control to inject the correct uploadID before the upload begins.  

@(Html.Kendo().Upload()
    .Name("files")
    .Async(a => a
        .Save("Save", "Upload", new { uploadID = "XXX" })
        .Remove("Remove", "Upload")
        .AutoUpload(true)
    )
)

If there's a proper solution to this, please advice.  Thank you!
Rene
Top achievements
Rank 1
 answered on 20 Feb 2013
0 answers
107 views
WOW!

I have written an async file upload in the past and I could not believe how easy you guys have made it to do async uploads. Unreal!

Try prying Kendo out my hands lol.

This framework is **awesome**.

Thank You!
Rene
Top achievements
Rank 1
 asked on 19 Feb 2013
4 answers
721 views
Hello,
what type is oData,how is formated the data?and what other types can be for grid datasource?
can i see somewhere a description of all grid parameters what they does?

i used oData type,and get from the server with GetProductList mvc action in json format the data,and nothing is happening,the grid is not filled.
the grid definition is like that
$(document).ready(function () {
                    var grid = $("#grid").kendoGrid({
                        dataSource: {
                            type: "odata",
                            transport: {
                                read: "/Controls/GetProductList"
                            },
                            pageSize: 15,
                            serverPaging: true,
                            serverSorting: true,
                            serverFiltering: true
                        },
                        toolbar: kendo.template($("#template").html()),
                        height: 450,
                        sortable: true,
                        pageable: true,
                        columns: [
                            { field: "ProductID", width: 100 },
                            { field: "ProductName", title: "Product Name" },
                            { field: "UnitPrice", title: "Unit Price", width: 100 },
                            { field: "QuantityPerUnit", title: "Quantity Per Unit" }
                        ]
                    });

Best Regards,
Daniel
Daniel
Top achievements
Rank 1
 answered on 19 Feb 2013
0 answers
159 views
please delete this post
I fixed a bug
Gusev
Top achievements
Rank 1
 asked on 19 Feb 2013
2 answers
548 views
Hello,
I have the following problem. When I bind an empty list of items to the grid (Server Binding) the grid shows me an empty row. The empty row has a class name "t-no-data" assigned. I could not find the css class "t-no-data" in any of the Kendo CSS files. Because of the prefix "t-" and not "k-" I assume this is a leftover from the Telerik MVC controls.

I just tried to override the "t-no-data" class in my custom css file and set the tr height to 0px to hide the empty row, but that does not work...
.t-no-data
{
    height: 0px;
}

Here is how I defined the Grid in the Razor View:
@* Server Grid-Binding *@
@{
    @(Html.Kendo().Grid(Model)
        .Name("GridWFClasses")
        .Columns(columns =>
        {
            columns.Bound(c => c.ID).Width(50).Title(WFClasses.ColumnID).Hidden(true);
            columns.Bound(c => c.Reference).Template(
                @<text>
                     <a href="javascript:redirectToControllerAction('@item.ControllerUrl')">@item.Reference</a>
                 </text>).Width(150).Title(WFClasses.ColumnReference);
            columns.Bound(c => c.WFTemplateFile.FileName).Width(150).Title(WFClasses.ColumnTemplate);
            columns.Bound(c => c.Description).Width("*").Title(WFClasses.ColumnDescription);
            columns.Bound(c => c.Url).Width(250).Title(WFClasses.ColumnUrl);
            columns.Bound(c => c.EditRights).Width(70).Title(WFClasses.ColumnEditRights);
        })
        .Resizable(m => m.Columns(true))
    )
}
And here is a screenshot so you see what I am talking about:

https://dl.dropbox.com/u/34560718/Kendo_Grid_EmptyLine.png

Can anyone tell me how I can hide the empy line? Thanks.
BigzampanoXXl
Top achievements
Rank 1
 answered on 18 Feb 2013
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
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?