Telerik Forums
UI for ASP.NET MVC Forum
1 answer
239 views
I want to have the selected items in the multi-select helper render vertically (instead of the default horizontal).  I tried using a custom tagTemplate that added a break tag, but all that did was put the "X" for removing below the text of the tag.  How can I do this?

Dane
Iliana Dyankova
Telerik team
 answered on 18 Apr 2013
1 answer
444 views
In our database, we use 0 (which resolves as 1/1/1900) for dates.

We don't have nullable dates.

What is the best practice such that dates that come into the model is 0 (or1/1/1900), format so in display mode they appear as "--" or "n/a" or "", while in edit mode, the control shows an empty box, instead of 1/1/1900?


Vladimir Iliev
Telerik team
 answered on 18 Apr 2013
3 answers
273 views
Hey,

I want to use KendoUI on the top of my ServiceStack project.
What is the recommended way to use ? I heard that the MVC of KendoUI wrappers are not compatible with HTML-Helpers of ServiceStack ?

So it would be nce to know why ?
Can I use it without the MVC wrappers of KendoUI - if yes - what's the best case ?

best wishes
Norbert

PS: ServiceStack
Atanas Korchev
Telerik team
 answered on 18 Apr 2013
1 answer
861 views
I have a grid that have a template column with an anchor to open a window popup when it is click. I need to pass the id of the line where I'm clicking the anchor, but I can get how to pass that value.

I'm attaching my code


@(Html.Kendo().Grid(Model.QuoteRequests)
                .Name("MultilineGrid")
                .Resizable(resizable => resizable.Columns(true))
                .Scrollable()
                .EnableCustomBinding(true)
                .Selectable(selectable => selectable
                    .Mode(GridSelectionMode.Multiple))
                    
                .Columns(columns => {
                    columns.Bound(qr => qr.QuoteRequestId).Hidden();
                    columns.Template(@<text><a href="#" onclick= "OpenNotes(#=QuoteRequestId#)" class = 'k-button k-button-icontext'> Notes </a></text>).Width(100);
                    }
                })

Dimiter Madjarov
Telerik team
 answered on 18 Apr 2013
1 answer
500 views
Hi,

i want fix width of column in kendoGrid, i tried using width:100px but when text is too long like
 (Ex. asgfsgdajhdkjashdasdklaskdljaslkdjlkasj) column width aoutomatically incresed,
 is there any way to handel overflow text or nowrap property to break text and add it to next line.
Dimiter Madjarov
Telerik team
 answered on 18 Apr 2013
4 answers
458 views
I'm having problems when trying to format the date that's displayed on a grid.

With the following code:
@(Html.Kendo().Grid(Model.Users)
      .Name("Grid")
      .Columns(columns =>
                   {
                       columns.Bound(u => u.UserView.CreatedOn).Format("{0:g}");
                       columns.Bound(u => u.UserView.ID).Title("").Sortable(false).Width(100)
                           .ClientTemplate("<a class='button' href='" +
                                              Url.Action("EditUser", "Admin") +
                                              "/#= UserView.ID #'" +
                                              ">Edit</a>"
                           );
                   })
      .Pageable()
      .Sortable()
      .Scrollable(scr => scr.Height(400))
      .Resizable(resize => resize.Columns(true))
      .DataSource(dataSource => dataSource.Ajax().ServerOperation(false)))
The date appears unformatted (e.g. /Date(1361292162723)/) and the edit button appears in the other column (see the edit image).

If I change the code so that the date column uses a client template with the date formatting:
@(Html.Kendo().Grid(Model.Users)
      .Name("Grid")
      .Columns(columns =>
                   {
                       columns.Bound(u => u.UserView.CreatedOn).ClientTemplate("#=CreatedOn ? kendo.format('{0:d}', kendo.parseDate(CreatedOn)) : ''#");
                       columns.Bound(u => u.UserView.ID).Title("").Sortable(false).Width(100)
                           .ClientTemplate("<a class='button' href='" +
                                              Url.Action("EditUser", "Admin") +
                                              "/#= UserView.ID #'" +
                                              ">Edit</a>"
                           );
                   })
      .Pageable()
      .Sortable()
      .Scrollable(scr => scr.Height(400))
      .Resizable(resize => resize.Columns(true))
      .DataSource(dataSource => dataSource.Ajax().ServerOperation(false)))
Then the date formats correctly but the edit button in the other column no longer appears. It just shows the ID as a string (see the noedit image).

How can I get the date to format correctly and have the other client template working?
Daniel
Telerik team
 answered on 18 Apr 2013
1 answer
234 views
Hi,
While retrieving the value of dropdownlist I am getting 'undefined'. here is my code: 

 @(Html.Telerik().DropDownList()
          .Name("cmbInvoieNo")
          .BindTo(new SelectList(Model.PIModel, "InvoiceID", "InvoiceName"))
                   .Placeholder("Select Invoice Number...")
                   .HtmlAttributes(new { style = "width: 230px; float: left;" })
                                    ) 
 <div><button type="submit" class="t-button t-state-default" onclick="getInvoiceNo()"> @Model.ButtonCaption</button> </div>
----------------------------------------------------------------------------------------------
@{
    <script type="text/javascript">
              function getInvoiceNo() {
            var cmbInvoice = $("#cmbInvoieNo").data("tDropDownList").text();            
            alert(" Invoice1 : " + cmbInvoice);
        }      
   </script>
}

--- On Click of 'Submit' button : $("#cmbInvoieNo").data("tDropDownList").text() return 'undefined' 
$("#cmbInvoieNo") ---  'defined'
$("#cmbInvoieNo").data("tDropDownList") ------- undefined

any Idea what could be wrong ??

Khem
Top achievements
Rank 1
 answered on 18 Apr 2013
1 answer
212 views
I am trying to implement search criteria which bind to Kendo Ui grid.
However it return no record and no error display. Is there something i
missed?

Controller code :

[HttpPost]
public ActionResult SearchProduct(ProductSearchCriteria criteria)
{
string nameCriteria = string.Empty;
string descCriteria = string.Empty;

TTSEntities dc = new TTSEntities();
if (!string.IsNullOrWhiteSpace(criteria.Name)) nameCriteria = criteria.Name.ToLower().Trim();

if (!string.IsNullOrWhiteSpace(criteria.Community)) descCriteria = criteria.Desc.ToLower().Trim();

var results = dc.Products.AsQueryable();
if (criteria.Name!= null)
results = results.Where(b => b.Name== criteria.Name);

if (criteria.Desc!= null)
results = results.Where(b => b.Desc== criteria.Desc);


return PartialView("_ProductGrid", results.ToList());
}



Index.cshtml


@model HHIMS_Web_App.Models.ProductSearchCriteria

@using (Html.BeginForm())
{
<div id="headerpanel">
<fieldset>
<legend style="font-size:14px">Search Criteria</legend>
<div>
<div class="editor-label">
@Html.LabelFor(model => model.Name)

</div>
<div class="editor-field">
@Html.EditorFor(model => model.Name)
</div>

</div>
<div>
<div class="editor-label">
@Html.LabelFor(model => model.Desc)

</div>

<div class="editor-field">
@Html.EditorFor(model => model.Desc)
</div>

<div class="smallBox">

<input type="button" value="Search" id="btnProductSearch" style="height:33px; font-size:14px; background-color:#3399FF" class="k-button" />

</div>
</div>
</fieldset>

</div>
}




<script type="text/javascript">

$(document).ready(function () {

$('#btnProductSearch').click(function (e) {
var searchParameters = GetSearchParameters();
var jsonData = JSON.stringify(searchParameters, null, 2);

$.ajax({
url: '@Url.Content("~/ProductDetails/SearchProduct/")',
type: 'POST',
data: jsonData,
datatype: 'html',
contentType: 'application/json; charset=utf-8',
success: function (data) {
$('#btnProductSearch').replaceWith(data);
},
error: function (request, status, err) {
alert(status);
alert(err);
}
});

});


function GetSearchParameters() {
var hrn = $("#Name").val();
var community = $("#Desc").val();


return { Name: name,
Desc: desc

};
}



});

</script>

_ProductGrid.cshtml

<div>
<fieldset class="searchResults">
<legend style="font-size:14px">Search Result</legend>
<br />
<div>
@(Html.Kendo().Grid<TTP.Models.ProductModel>()

.Name("Product")
.HtmlAttributes(new { @Style = "align:center; font-size:10px; width:500px" })
.Columns(columns =>
{

columns.Bound(p => p.Name);
columns.Bound(p => p.Desc);

})
.AutoBind(false)
.Editable(editable => editable.Mode(GridEditMode.InLine))
.Sortable()
//.Pageable()
.Pageable(paging => paging
.Input(false)
.Numeric(true)

.PreviousNext(true)
.PageSizes(new int[] { 5, 10, 25, 50 })
.Refresh(false)

)
.Selectable()
.Scrollable()
.ColumnMenu(c => c.Columns(false))
.DataSource(dataSource => dataSource
.Ajax()//bind with Ajax instead server bind
.PageSize(10)
.ServerOperation(true)
.Model(model =>
{
model.Id(p => p.Name);

})




)
)

</div>
</fieldset>
</div>
Petur Subev
Telerik team
 answered on 17 Apr 2013
1 answer
135 views
I have a custom edit pop-up.  I'm trying to add a hidden byte array, but it's not working.  They byte array will be dynamic but I can't even get a hard coded version to work properly.

If I put the following line in the custom edit cshtml file,
<input id="RowVersion" name="RowVersion" type="hidden" value="AAAAAAAAZZM=">
The pop-up renders it as:
<input id="RowVersion" name="RowVersion" type="hidden" value="[object Object]" data-bind="value:RowVersion">
When I try it in a regular MVC page everything works as expected.  (Also, this is the only part of the model that doesn't render correctly in the custom edit pop-up.)
Atanas Korchev
Telerik team
 answered on 17 Apr 2013
1 answer
135 views
I want to know how I have somthing like this
http://www.aspnetwiki.com/page:kendoui-ext-api-dropdowngrid
in kendo.mvc?
Dimo
Telerik team
 answered on 17 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
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
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
LLM Kit
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
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
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?