Telerik Forums
UI for ASP.NET MVC Forum
1 answer
191 views
Hi,

I have noticed that the textboxes etc, that comes when you are editing in-line always have the same width.
How can I make them have the width so that they fill xx% of the column width that they are in or a fixed customized width.

Best

Ole
Ole
Top achievements
Rank 1
 answered on 16 Oct 2012
10 answers
495 views
I am trying to port a telerik mvc project to use the Kendo controls and am having difficulties on a few issues with the grid. If anyone can help with any of these issues I would appreciate it!
  • I am using an editor template for editing a certain view model object. The add/edit window that pops up is way too narrow and has a horizontal scroll bar. If I wrap a <div> around my fieldset and put width on it, the width is ignored. Currently the form is not usable because it is so narrow. How can I specify the width of my editor template? The following also has no effect:
    • .Editable( editing => editing
          .Mode( GridEditMode.PopUp )
          .DisplayDeleteConfirmation( true )
          .Window( window => window.Width( 500 ) ))
  • When I click the "Add" button, the title of the window still states "Edit". How do I dynamically change this based on the mode?
  • I need to have a "Details" button in my master grid which will open a modal popup that displays all the details of the selected row. How is this accomplished with the Kendo grid?
  • Edit, Add & Delete buttons only have text. In the Telerik version we could specify to display text, text + image or image only. Where has this functionality gone? I need to only display icons on the buttons.
  • In the editor template, the "Update" button does not fire off the specified controller method. It simply closes the window.
  • The filter icon does not show up and filtering is not possible

I have looked through the limited documentation and examples and have not been able to answer these questions but if I missed an example I am happy to have that pointed out so I can take a look.

Thanks for your help!

Praseeda
Top achievements
Rank 1
 answered on 16 Oct 2012
2 answers
138 views
I'm attempting to use a foreign key column and I sometimes get an unterminated string error while loading the page.  I determined that this is due to having a single quote in the data (not uncommon for users to do that).

This is easy to duplicate using the MVC Example project by simply changing an Employee name in the Northwind database to contain a single quote.  The Grid Foreign Key demo will show the error.  (BTW, Firefox doesn't really indicate the error, it just stops.  IE blows up.)

Encoding the string doesn't help.  The resulting data simply shows the &#39; value in the output.

Anyone else have a similar problem?
Mathieu
Top achievements
Rank 1
 answered on 15 Oct 2012
1 answer
157 views
I have a pretty basic grid that is not populated on load.  It requires users to enter search criteria first, which then searches the database and populates the grid.  Below is the grid code

Html.Kendo().Grid<ArrayOfSearchResultObjectSearchResultObject>(Model.Results)
.Name("srchGrd")
.Columns(columns =>
{
    columns.Bound(o => o.Chemical).ClientTemplate("<a title='#=Chemical#' href='" + Url.Action("", "ChemBioSearch", new { area = "Tools" }, Request.Url.Scheme) + "/GetDetail?ChemName=#=Chemical#&DetailID=#=ID#&DetailSource=#=SearchSource#&id=" + Model.ProjectGUID.ToString() + "' >" +
    "#=Chemical# </a>"
    ).Title("Chemical");
    columns.Bound(o => o.CasNumber).Title("CAS #");
    columns.Bound(o => o.UnNumber).Title("UN ID #");
    columns.Bound(o => o.FriendlySourceName).Title("Data Source");
})
        .DataSource(ds =>
        {
            ds.Ajax().ServerOperation(false).Read(read => read.Action("_GetSearchResults", "ChemBioSearch", new { area = "Tools" }));
        }
                    )
.Scrollable(scrolling => scrolling.Enabled(false))
.Sortable(sorting => sorting.Enabled(true))
.Pageable(paging => paging.Enabled(true))
.Filterable(filtering => filtering.Enabled(true))
.Groupable(grouping => grouping.Enabled(false))
.Render();
which used to work great but broke ever since i upgraded to the Kendo 924 version (and same problem since the 1002 as well) it doesn't work like it used to. 

Basically i have 2 controller methods.  The first (SearchChemBio) gets called when the user enters the search data and hits enter.  data gets sent no problem and send a partialresult (which contains the grid).  I have the ajax call in there in order to handle sorting/filtering/paging. 

[AcceptVerbs(HttpVerbs.Post | HttpVerbs.Get)]
[OutputCache(NoStore = true, Duration = 0, VaryByParam = "*")]
public ActionResult _GetSearchResults([DataSourceRequest] DataSourceRequest request,ChemBioSearchModel mdl)
{
    if ((mdl != null) && (mdl.IsValid))
    {
        ArrayOfSearchResultObject rslt = SearchGlobal(mdl);
        if ((rslt != null) && (rslt.Items.Length > 0))
        {
            foreach (ArrayOfSearchResultObjectSearchResultObject arr in rslt.Items)
            {
                mdl.Results.Add(arr);
            }
        }
        return Json(mdl.Results.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
    }
    return Json(new List<ArrayOfSearchResultObjectSearchResultObject>().ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
}
 
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult SearchChemBio(ChemBioSearchModel mdl)
{
    if (mdl != null)
    {
        if (ModelState.IsValid)
        {
            ArrayOfSearchResultObject rslt = SearchGlobal(mdl);
            if ((rslt != null) && (rslt.Items !=null) && (rslt.Items.Length > 0))
            {
                foreach (ArrayOfSearchResultObjectSearchResultObject arr in rslt.Items)
                {
                    mdl.Results.Add(arr);
                }
            }
            return PartialView("SearchResults", mdl);
        }
        else
        {
            return View(mdl);
        }
    }
    throw new ArgumentException("No Model found for Chem Bio Search");
}
unfortunately now, the model in the Ajax call (_GetSearchResults) is always blank now (it didn't used to be before the update).  Is there something i'm missing?  I feel like i'm doing double work here, but can't figure out how to marry both calls.
Phil
Top achievements
Rank 1
 answered on 15 Oct 2012
5 answers
452 views
Hi Guys!  I am new Asp.net MVC and KendoUI.... can you help me on how populate the grid dynamically? or for example if have to pick in a combobox, it will display the data according to the selected item???

Thank you very much! God bless
Gopi
Top achievements
Rank 1
 answered on 15 Oct 2012
0 answers
88 views
TreeView is not expanding on mobile devices (well, at least on iOS and Android):
ver 2012.2.913
styles and scripts in order:
kendo.common.min.css
kendo.default.min.css"
kendo.mobile.all.min.css

jquery-1.7.1.min.js
kendo.all.min.js
kendo.aspnetmvc.min.js

not expanding example:
         @(Html.Kendo().TreeView()
                .Name("sometree")
                .Items(treeview =>
                {
                    treeview.Add()
                        .Expanded(false)
                        .Selected(true)
                        .Items(items =>
                        {
                            items.Add().Text("S");
                            items.Add().Text("S");
                            items.Add().Text("S");
                        });
                })
                )
Simon
Top achievements
Rank 1
 asked on 15 Oct 2012
1 answer
806 views
Hi

Is there any way I can loop through the rows for a particular page or at least the page visible to the user.
What am I doing right now is iterating through all the rows in the datasource as below

var grid = $("#MyKendoGrid").data("kendoGrid");
var data = grid.dataSource.data();
$.each(data, function (i, row) {
        //do something
 });

But what if I want to iterate on the rows of a particular page.
I can get the current page by grid.dataSource.page(); Then what's next?

Please advise.
Nikolay Rusev
Telerik team
 answered on 15 Oct 2012
0 answers
121 views
Hi,

I have a "Create" form in my MVC application that has some fields like firstName, lastName...  and a Kendo grid.  The grid has two columns (namve/value pairs).

I can't create the values in the grid until I create the rest of the form.  I need to post all of the data on the form back at the same time.

Is there a way to post the grid data along with the rest of the form data?


Dave
Top achievements
Rank 1
 asked on 14 Oct 2012
0 answers
166 views
Hello,
I'm uploading a CSV file and try to parse it.
I want to return to the client a responsive message what is the issue (as I found it).

I've tried this:
Response.StatusCode = (int)System.Net.HttpStatusCode.BadRequest;
Response.ContentEncoding = Encoding.UTF8;
            Response.ContentType = "application/json; charset=utf-8";
            

return Json(myResponse, Response.ContentType, Response.ContentEncoding);

Where myResponse is of a specific type containing my status code. I'm checking the value of my Status Code (called Rc) and act accordingly. 

I'm changing the StatusCode, because the retry button appears and the user can try uploading again easily).
It work fine in Chrome and FF, but not in IE (all in my dev server)
I've change the behavior to be like this:

// for IE responseText
if (Request.Browser.IsBrowser("IE"))
{
     Response.StatusCode = (int)System.Net.HttpStatusCode.OK;
     Response.ContentType = "text/html; charset=utf-8";
}
// End of

and that solve the issue for IE.

BUT:
When moved to testing environment, the myResponse is holding the 'BadRequest' string and not my Json response, and then I don't have any info to display to the client.

So - I've removed the line 
Response.StatusCode = (int)System.Net.HttpStatusCode.BadRequest;

and my js handler look like that
function onUploadSuccess(e) {
            //alert("Success (" + e.operation + ") :: " + getFileInfo(e));
 
            if (e.response.Rc != 'OK')
                addFileRow(e.files[0].name, e.response.ErrorMessages, e.response.CurrentTime, "uploadRowError""");
            else {
                var runCmd = "<div .... />";
                addFileRow(e.files[0].name, e.response.ErrorMessages, e.response.CurrentTime, "uploadRowSuccess", runCmd);
            }
        }
And the question: Can I mark the operation as failed in the onSuccess handler ? Thanks Shimshon
Shimshon
Top achievements
Rank 1
 asked on 14 Oct 2012
0 answers
110 views
Hi,
I am using KendoUI Grid in ASP.NET MVC3 Application and using MvcContrib.Mvc3-ci.3.0.73.0 for portable view. Everything in the grid working perfect. But having problem when I add "Batch Editing" feature. My error screen showing message like this:

The best overloaded method match for 'Kendo.Mvc.UI.Fluent.GridEditingSettingsBuilder<KendoGridMvcCodeFirst.Models.Customer>.Mode(Kendo.Mvc.UI.GridEditMode)' has some invalid arguments

I guess the issue is related to MvcContrib, because same code works in my another test application. My view page code look like this:

@(Html.Kendo().Grid<KendoGridMvcCodeFirst.Models.Customer>()
    .Name("Customers")
    .ToolBar(tb => tb.Create())
        .Editable(editable => editable.Mode(GridEditMode.InCell))
    .Pageable()
        
    .DataSource(dataSource => dataSource.Ajax()
            .Batch(true)
        .Model(model => model.Id(c => c.CustomerID))
        .Read("GetCustomers", "Home")
        .Update("UpdateCustomer", "Home")
        .Create("InsertCustomer", "Home")
        .Destroy("DeleteCustomer", "Home"))
    .Columns(cols =>
    {
        cols.Bound(c => c.CustomerID).EditorTemplateName("Integer");
        cols.Bound(c => c.Name).Width(300);
        cols.Bound(c => c.Phone);
        cols.Bound(c => c.Email);        
        cols.Command(cmd =>
        {
            cmd.Edit();
            cmd.Destroy();
        });
    })
)

Please help.

Thanks,
ARIF
Ariful
Top achievements
Rank 1
 asked on 13 Oct 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
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
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?