Telerik Forums
UI for ASP.NET MVC Forum
14 answers
666 views
Hello,
can i make a custom razor helper that builds a kendo grid?
For example if i have
@(Html.Kendo().Grid<Namespace.ViewModels.TesttViewModel>()
.Name("Grid")

.Columns(columns =>
{
columns.Template(x => { }).ClientTemplate(
@"<a class='k-button' href='javascript: void(0)' onclick='doLoading(this)' style='min-width:32px!important'><span class='k-icon k-edit'></span></a>
<a class='k-button' href='javascript: void(0)' onclick='deleteRow(this);return false;' style='min-width:32px!important'><span class='k-icon k-delete'></span></a>"
).Width(100);

columns.Bound(p => p.Code).Title(Namespace.Resources.Resources.FieldText_TM_Code);
columns.Bound(p => p.Name).Title(UCMSPayroll.Resources.Resources.FieldText_TM_Name);
columns.Bound(p => p.MaxLength).Title(UCMSPayroll.Resources.Resources.FieldText_TM_MaxLength).Width(130);
columns.Bound(p => p.IsActive).ClientTemplate("<input type='checkbox' disabled='true' name='IsActive' #= IsActive ? checked='checked' : '' # />").Title(UCMSPayroll.Resources.Resources.FieldText_TM_IsActive);
columns.Bound(p => p.IsHour).ClientTemplate("<input type='checkbox' disabled='true' name='IsHour' #= IsHour ? checked='checked' : '' # />").Title(UCMSPayroll.Resources.Resources.FieldText_TM_IsHour);
columns.Bound(p => p.Precision).Title(UCMSPayroll.Resources.Resources.FieldText_TM_Precision);
columns.Bound(p => p.Priority).Title(UCMSPayroll.Resources.Resources.FieldText_TM_Priority);
columns.Bound(p => p.Formula).Title(UCMSPayroll.Resources.Resources.FieldText_TM_Formula);


})

.ToolBar(toolBar => toolBar.Template(@"<a id='addSome' class='k-button k-button-icontext k-grid-add' onclick='createRow()' href='javascript: void(0)'><span class='k-icon k-add'></span>add</a>
<span id='spanAdd' style='display:none;font-size:150%;margin-top:25px'><b>Add</b></span>
<span id='spanEdit' style='display:none;font-size:150%'><b>Edit</b></span>
<div style='float:right;color:black;font-size:150%'><b>measure</b></div>
"

))
.Pageable()
.Sortable()
.Scrollable()

.DataSource(dataSource => dataSource
.Ajax()
.Events(events => events.Error("error_handler"))
.Model(model => model.Id(p => p.PkTallyMeasurement))
.Create(update => update.Action("EditingInline_Create", "Home"))
.Read(read => read.Action("EditingInline_Read", "Home"))
.Update(update => update.Action("EditingInline_Update", "Home"))
.Destroy(update => update.Action("EditingInline_Destroy", "Home"))
.PageSize(5)

)
)

so there is a lot of code,and i would like to use something like in the razor view:
@NameSpace.MyGrid(model)
and this should create all the above code that at least the portions that ar not changing such as the templates,the Pageable,Sortable,Datasource and so on.

Regards,
Daniel
Daniel
Top achievements
Rank 1
 answered on 29 Apr 2013
1 answer
239 views
Hi,
I have property i my viewmodel: Email with attribute: [Email(ErrorMessage = "not a valid email address")]
The attribute comes from DataAnnotationsExtensions.
The client error message shows up when using Server side binding but not when using Ajax.

How do I enable client side validation when using Ajax?

Regards,
Mattias
Daniel
Telerik team
 answered on 29 Apr 2013
1 answer
120 views
Hi.

I am using a Grid  with popup editing.

how can I hide the model.ID from the user in the popup?
Robert
Top achievements
Rank 1
 answered on 29 Apr 2013
1 answer
698 views
Hi,

Is there a way of changing the filename of a file (within the Javascript)  that is about to be posted asynchronously? For example I have tried in the select method of the upload tool, the following:

"select": function (e) {
          e.files[0].name = "changed_named.jpg";
}

However, when the file reaches my MVC controller action, the HttpPostedFileBase object has the original filename. I've also tried doing this in the 'upload' event with no luck.

Thanks,
T. Tsonev
Telerik team
 answered on 29 Apr 2013
1 answer
170 views
Hi,

Is it possible to prepare a user interface with a few regions that is separeted by splitters that can be replaceable by drag and drop?

Thanks in advance,
Dimo
Telerik team
 answered on 29 Apr 2013
1 answer
128 views
Hello!
I have the problem:
If I use 100% scale , then I see first picture
If I use 110% or 125% scale, then  I see second picture
Why display with 125% scale is so incorrect?
scale
scale
Dimo
Telerik team
 answered on 29 Apr 2013
1 answer
145 views
Is there any way to use the virtual scrolling with a pager control?  Everything works fine except if you go to a new page and then try to scroll, it resets to the previous page.
Atanas Korchev
Telerik team
 answered on 29 Apr 2013
1 answer
213 views
Hi,

I am currently making my first
experiences with Kendo UI and a ASP.NET MVC 4 project. At the moment I have a
list stored in a standard .Net System.Collections.Sortedlist object and would
like to fill a Kendo UI combobox with the values from that list. I also tried
to first build a Kendo datasource object, that contains the elements from that
Sortedlist, but I could not get that to work.

How can I:

  • fill a Kendo UI combobox with elements from a .Net System.Collections.Sortedlist
object?

or

  • fill a Kendo UI datasource (which I will later use to create the combobox)
with elements from a .Net System.Collections.Sortedlist object?

Regards

Sven
Daniel
Telerik team
 answered on 29 Apr 2013
4 answers
1.0K+ views
Hello again,
if i want to pass inside a javascript function,a string parameter how can i do that?

for example this sentence
.ToolBar(toolBar => toolBar.Template("<a class='k-button k-button-icontext k-grid-add' onclick='addCustomCheckBoxField('IsHour')' href='javascript: void(0)'><span class='k-icon k-add'></span>add</a>"))

gives me an syntax error.
i would like to pass the IsHour as a string value for the function.
Maybe it is more a javascript problem,but it is used in kendo ui context.

Regards,
Daniel
Daniel
Top achievements
Rank 1
 answered on 29 Apr 2013
1 answer
431 views
I am using the kendo mvc grid .I want implement the scroll bar  but data part is scrolling properly but hearer of grid is not scrolling with data.

@(Html.Kendo().Grid(Model) 
    .Name("gridSyndromic")
    .Columns(columns =>
    {
        columns.Bound(p => p.Syndromes.Name).Title("Syndromes").Width(210);
        columns.Bound(p => p.Symptoms3).Title("No of Clients With").Width(210)
              
        
        columns.Command(command => { command.Edit(); command.Destroy(); }).Width(172);
    })
                           .ToolBar(toolbar =>
                           {
                               toolbar.Create();

                           })
    .Editable(editable => editable.Mode(GridEditMode.InLine))
    .Pageable()
    .Sortable()
    .Scrollable()
    .Resizable(p=>p.Columns(true))
    .HtmlAttributes(new { style = "height:506px;width:400px;" })
    .DataSource(d => d.Server().PageSize(10).Create(update => update.Action("EditingInline_Create", "Syndromic"))
                        .Read(read => read.Action("Index", "Syndromic"))
                        .Update(update => update.Action("EditingInline_Update", "Syndromic")).Destroy(update => update.Action("EditingInline_Destroy", "Syndromic"))
                        .Model(model => model.Id(p => p.SymptomsId)))
     


Thanks
Dimo
Telerik team
 answered on 29 Apr 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?