Telerik Forums
UI for ASP.NET MVC Forum
1 answer
67 views

Bom dia, eu tenho uma grid dentro de um popup, esse popup recebe uma model com 5 propriedades e uma lista "opcoes". Eu gostaria de saber como populo essa grid com essa lista da model. Tentei conforme o codigo abaixo, mas sem sucesso.

 

        @(Html.Kendo().Grid<Entidades.OpcaoPerguntas>(Model.Opcoes)
            .Name("gridOpcao")
            .Columns(columns =>
            {
                columns.Bound(o => o.CodigoOpcao).Visible(false);
                columns.Bound(o => o.Ordem).Visible(false);
                columns.Bound(o => o.DescricaoOpcao).Title("Descrição da Opção");
                columns.Bound(o => o.DescricaoDivisor).Title("Divisor");
                columns.Bound(o => o.DescricaoTipoOpcao).Title("Tipo de Opção");
                columns.Bound(o => o.Meta);
                columns.Bound(o => o.Pontos);
            })
            .Sortable()
            .DataSource(dataSource => dataSource
                .Ajax()
                .Batch(true)
                .ServerOperation(false)
                .Model(m => m.Id(i => i.CodigoOpcao))
)

            )

Nikolay
Telerik team
 answered on 12 May 2020
5 answers
347 views
I have a Grid for a strongly typed model with a DateTime property CreateDate.
Html.Kendo().Grid<Department>()
When editing a row, it posts the DateTime back to the server in the following format:
CreateDate:Thu Jul 11 2013 11:54:13 GMT-0500 (Central Daylight Time)
It posts to the following Controller action:
public ActionResult UpdateDepartment([DataSourceRequest] DataSourceRequest request, Department department)

.Net automatically binds the other values sent across, but if fails when parsing the CreateDate with the following message:

The value 'Mon Jul 08 2013 08:50:16 GMT-0500 (Central Daylight Time)' is not valid for CreateDate.

My culture is the default en-US.

I found a forum post where someone has a similar issue. (http://www.kendoui.com/forums/kendo-ui-framework/globalization/datasource-date-format-incompatibile-with-asp-net-mvc-date-format.aspx#Z6fZydEt5E63AuZr05gjLQ)

Is there a solution that allows Kendo and .Net to automatically bind the model?

I have a workaround, and I realize I could use a custom model binder. However, both solutions are less than optimal.
Ivan Danchev
Telerik team
 answered on 11 May 2020
7 answers
1.7K+ views

I have a grid of customer transactions and a child detail grid which expands the transaction into line info for the transaction.  This works well but I only want the child detail grid to be available for rows on the parent with a certain transaction type id.

Is this possible?

Petar
Telerik team
 answered on 11 May 2020
1 answer
407 views

Hi ,

I have a Grid with Data binded and Save button outside the grid , i need to POST the grid data   from view to controller action method  in Save button click, i am getting count 0 in the list in the action method when POST. Is there a way to read grid data and get as list, i want in server side.

Note the Grid is inside tabstrip control

Help will be appreciated!!

Anton Mironov
Telerik team
 answered on 11 May 2020
5 answers
533 views

Hi All

We have observed that if grid is filtered and user hits on add row button. The new row is added but is not visible. Which makes no good sense as user then keeps on hitting add row but doesn't see anything moving.

 

Is there a way wherein we can make newly added row visible even if there is a filter applied.

 

Thanks

M.

Ivan Danchev
Telerik team
 answered on 11 May 2020
3 answers
680 views

I have a kendo grid that contains a ClientDetailTemplateId.  The Client Details grid contains a column in which the data type from the model is set to Datatype.Password.  The grid is also set up for InCell editing.

When the detail grid shown, all values in the Password column are visible in plain text. When I click in the cell, the password is then converted to the typical password field characters to hide the password.  When I click out of the cell, the changes are shown in plain text again.

How can I prevent the password column from showing the passwords in plain text when not in 'edit' mode.  I thought that adding the Datatype attribute to the view model would handle this, but apparently only in edit mode.

Regards,

Shawn

arodriguezbr
Top achievements
Rank 1
 answered on 10 May 2020
4 answers
1.5K+ views

Hello, I recently update the Kendo version of my project to 2016.1.226.545, and after that I can't show the data on the grids i have, the first time a page load the grid is empty, if I click any column, like sorting the grid, display a Json Object on the screen. Am I losing a js file to add or has anyone an idea what could be happening? Before the update the code was working perfectly.

Here is how i am doing the code, 

 

View

                    @(Html.Kendo().Grid<Project.Models.Products>()
                    .Name("Products")
                    .Scrollable()
                    .Sortable()
                    .EnableCustomBinding(true)
                    .HtmlAttributes(new { style = "height:auto;" })
                    .DataSource(dataSource => dataSource
                        .Ajax()
                        .Model(model =>
                        {
                            model.Id(x => x.Code);
                        })
                        .ServerOperation(false)
                        .PageSize(20)
                        .Read(read => read.Action("LoadProducts", "Products"))
                        )

                    .Columns(columns =>
                    {
                        columns.Bound(p => p.Product).Title("Product").Width(70);
                        columns.Bound(p => p.Code).Title("Code").Width(70);
                        columns.Bound(p => p.Description).Title("Description").Format("{0:0,0.0}").Width(250);

                    }))

 

Controller

 

        public ActionResult Products()
        {
            return View();
        }

 
        public ActionResult LoadProducts([DataSourceRequest]DataSourceRequest request)
        {
            clsData cns = new clsData();

            IQueryable<consultProducts> s2 = cns.getProducts().ToList().AsQueryable();

            DataSourceResult result = s2.ToDataSourceResult(request, p => new Products
            {
                Code= p.code,
                Product= p.product,
                Description= p.description,

            });

            return Json(result, JsonRequestBehavior.AllowGet);
        }

 

And the result is a Json object like this 

 

{"Data":[{"Code":0001,"Description":"Natural oil","Product":01}],"Total":1,"AggregateResults":null,"Errors":null}

Alexander
Top achievements
Rank 1
 answered on 09 May 2020
8 answers
319 views

I am new to MVC and really new to using the Telerik tools.  I have a grid made in my HTML and the headers come up and no data.  I would like to get the data to show up in the Grid.  I am sure I need to add something to the controller, just do not know what.  I have looked all over and I am getting information overload.  Here is what I have in my grid, what do I need in my controller?:

 

@(Html.Kendo().Grid<CertificateTrackingSystem.Models.Status>
()
.Name("StatusGrid")
.Columns(columns =>
{
columns.Bound(c => c.statusID)
.Visible(false).IncludeInMenu(true)
.Title("ID").Width(30);
columns.Bound(c => c.NameofStatus)
.Title("Status Name").Width(70);
//columns.Command(commands =>
//{
// commands.Edit().Text(" ".).UpdateText(" ").CancelText(" ");
// commands.Destroy().Text(" ");
//}).Title("Actions").Width(150);
}
)
.Filterable(ftb => ftb.Mode(GridFilterMode.Menu))
.DataSource(dataSource =>
dataSource.Ajax()
.Sort(sort => sort.Add("Status").Descending())
.Model(model =>
{
model.Id(Status => Status.statusID);
model.Field(Status => Status.NameofStatus).Editable(false);
}
)
)//.Events(e => e.sync("sync_handler"))
// .Create(create => create.Action("AddComments", "Document", new { areas = "Document", docID = @documentID, docRev = @documentRev }).Data("GetRequestToken"))
// .Read(read => read.Action("ReadComments", "Document", new { areas = "Document", documentID = @documentID, documentRev = @documentRev }).Type(HttpVerbs.Get))
// .Update(update => update.Action("UpdateComments", "Document",new { areas = "Document" }).Data("GetRequestToken"))
// .Destroy(destroy => destroy.Action("DeleteComments", "Document", new { areas = "Document"}).Data("GetRequestToken"))
// .PageSize(5)
// .ServerOperation(false)//.Pageable(x => x.PageSizes(new List<object> { 5, 10, 20, 50, "all" }).Refresh(true))
//.Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("Comments"))
//.Sortable()

)

 

 

 

 

 

Christine
Top achievements
Rank 1
Veteran
 answered on 08 May 2020
2 answers
150 views

I have a Grid with foreign key column 'Products' with custom editor template. There is a separate button 'Add new Product; which opens up a modal to add new product . After adding new product when I try to create a new record in the Grid and select the newly added product, it shows up as blank in the Grid. When I refresh the page it shows up then. What I am missing?

Foreign key in grid:

columns.ForeignKey(c => c.ID, (System.Collections.IEnumerable)ViewData["products"], "ID",  "ProductName").Title("Product")..EditorTemplateName("RemoteForeignKeyProducts).

 
'RemoteForeignKeyProducts' is the custom editor template for products:
@model object 
@(Html.Kendo().DropDownListFor(m => m)
  .DataSource(source =>
  {
      source.Read(read =>
      {
         read.Action("GetProducts", "Home").Type(HttpVerbs.Post);
      }).ServerFiltering(false);
  })
  .DataValueField("ID")
  .DataTextField("ProductName")

)

GetProducts() is a function in controller
  public ActionResult GetProducts()
        {
            using (     var db = new Entities())
            {
                var objects = db.Products.Select(p => new { p.ID, p.ProductName}).ToList();

                return Json(objects);
            }

        }

 

Angel Petrov
Telerik team
 answered on 08 May 2020
1 answer
131 views
I'm using "kendo-upload" in my Angular application. I'm able to upload files upto 125 mb, but when i try to upload files like 500MB, 1GB etc, its not going through.

Is there any filesize limitations on "kendo-upload", Do i need to set any settings for uploading such large files ?
Martin
Telerik team
 answered on 08 May 2020
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
Upload
ComboBox
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
ListView (Mobile)
Pager
Accessibility
ColorPicker
DateRangePicker
Wizard
Security
Styling
Chat
MediaPlayer
TileLayout
DateInput
Drawer
SplitView
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Template
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
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?