Telerik Forums
UI for ASP.NET MVC Forum
2 answers
175 views

Can anyone help me with this issue.

I only can upload image in PNG format, but when i uplaod an image in JPG or GIF format the grid doesn't show me anything.

I try to convert JPG to PNG but is the same and don't show anything.

Any suggest of how can i do this.

This is my code example:

This is my grid in view:

@(Html.Kendo().Grid<TelerikMvcApp4.Models.PublicacionImagenModel>()
    .Name("grid")
    .HtmlAttributes(new { style = "height:335px;" })
    .Columns(columns =>
    {
        columns.Template(e => { }).ClientTemplate(" ").Width(140).Title("Imagen").HtmlAttributes(new { style = "height:40px" });
        columns.Command(command => command.Destroy()).Width(110);
    })
    //.AutoBind(false)
    .ClientRowTemplate(
        "<tr id='a' data-uid='#: uid #'>" +
            "<td class='photo'>" +
            "<img src='data:image/png;base64,#: imagen64 #' alt='#: data.Puim_clave_pub #' style='width: 180px; height:100px;'/>" +
            "</td>" +
         "<td style='width:80px'>" +
             "<a class='k-button k-button-icontext k-grid-delete'" +
         "<span class='k-icon k-delete'></span>Eliminar</a>" +
         "</td>" +
         "</tr>"
    )
    .DataSource(dataSource => dataSource
        .Ajax()
        .Batch(true)
        .PageSize(10)
        .ServerOperation(false)
        .Model(model =>
        {
            model.Id(p => p.Puim_clave);
        })
        .Read(read => read.Action("RowTemplate_Read", "Gestion"))
        .Destroy(destroy => destroy.Action("Editing_Destroy_Img", "Gestion"))

    )
    .Scrollable()
                )

And this is the controller action:

[AcceptVerbs(HttpVerbs.Post)]
        public ActionResult Editing_Destroy_Img([DataSourceRequest] DataSourceRequest request, [Bind(Prefix = "models")]IEnumerable<TelerikMvcApp4.Models.PublicacionImagenModel> expedientes)
        {
            string sqlDelete = "delete from gmc_publicacion_imagen where puim_clave = :deletePub";

            HttpCookie authCookie = Request.Cookies[FormsAuthentication.FormsCookieName];
            FormsAuthenticationTicket authTicket = FormsAuthentication.Decrypt(authCookie.Value);

            OracleConnection con = new OracleConnection(authTicket.UserData.ToString());
            OracleCommand cmd = new OracleCommand(sqlDelete, con);
            cmd.Parameters.Add(new OracleParameter("deletePub", OracleDbType.NVarchar2));

            try
            {
                con.Open();
                Permisos.OtorgarPermisos(con);
                //if (expedientes != null && ModelState.IsValid)
                //{
                foreach (var exp in expedientes)
                {
                    cmd.Parameters["deletePub"].Value = exp.Puim_clave;
                    cmd.ExecuteNonQuery();

                }
                //}
            }
            catch (Exception ex)
            {
                Session["excepcionGestion"] = ex;
            }
            finally
            {
                con.Close();
                con.Dispose();
                cmd.Dispose();
            }

            return Json(expedientes.ToDataSourceResult(request, ModelState));
        }

 

I'll wait for your answers. Thanks

Konstantin Dikov
Telerik team
 answered on 24 Oct 2016
1 answer
349 views

Hello there,

I've a parent/child grid and I need to edit some columns in the child grids.

When the page load the server send all the parent and children data needed to work in the client side, I mean, the user will be able to expand any child grid without the need of reading the data from the server when expanding a grid because the data is already in the client.

I've attached a screenshot.

Currently I've populated the child grids and I'm able to edit the rows but every time I edit one row in any child grid and the editor lose the focus the parent grid collapse all expanded children keeping the edited values.

I've been working around that but I've no idea how to fix it and I've never used the Telerik controls.

Here I attached a clean project reproducing the issue https://www.dropbox.com/s/9g76yrbccwh11r3/TelerikMvcApp1.7z?dl=0

I really need to be able to edit the child grids without READING data from the server every time the user expand a child because the data in the child grid is built using heavy calculations and it takes a lot of time to finish.

Can anyone help me fix the problem?

Thank you.

Konstantin Dikov
Telerik team
 answered on 24 Oct 2016
0 answers
506 views

https://github.com/ftamminga/KendoUISignalRApp

This is a working example of a C# Asp.Net MVC5 application with a Telerik Kendo Grid that uses SignalR for data transport and synchronization. The examples from Telerik fail when using server side filtering and sorting out of the box. This example shows how to address the issues without too much problems. It only takes a small amount of work server side and a bit of javascript client side to make it work flawlessly.

Just open the application in two or more browser screens and play with some sorting, filtering. Add some entries, change them.
A short video of the basics can be seen here: https://goo.gl/m0hfmJ
It shows two synchronised browser screens. What's changing in one screen will reflect in the other.

The example uses the same database as the Telerik examples, to be found at https://github.com/telerik/ui-for-aspnet-mvc-examples/tree/master/grid/signalR-bound-grid You only have to change the connection string to a working database with the product samples.

Facturen
Top achievements
Rank 1
 asked on 24 Oct 2016
2 answers
696 views

I have a grid where it is like an invoice sheet.

Quantity

Cost

Discount

TotalAmount

 

The TotalAmount column has a client template that calculates its value via Quantity, Cost, and Discount . This column when you try to edit it will refresh with the correct value from the implementation of the client template. However, we would like to refresh this cell whenever the other three values are changed... and then we will change the TotalAmount field to read only...

How could we go about accomplishing this?

 

Thanks
AJ

Viktor Tachev
Telerik team
 answered on 24 Oct 2016
3 answers
437 views

Is there any way to achieve this? I found that I have to choose between one of the two options, and I'd like to keep them both.

Thanks in advance.

Kostadin
Telerik team
 answered on 24 Oct 2016
5 answers
153 views

We are getting an 'undefined is not an object' error in kendo.web.js in the built-in leafDatacells function.

I believe this is called when the grids are loading. It happens in several of our pages.

 

  a = $(a);
  var indexA = a.attr(indexAttr);

We recently updgraded our Kendo controls and are now experiencing a (somewhat random) value-undefined error.
The error occurs in the Kendo.Web.js file in function leafDataCells(container) {..}
In the second line of code above a is undefined so it throws an exception trying to use a.

When debugging it does not seem consistent so its hard to trace through the code.
However here are the details that popup when it happens:

Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET CLR 1.1.4322; InfoPath.3; .NET4.0C; .NET4.0E)
Timestamp: Mon, 27 Apr 2015 20:57:02 UTC
Message: 'undefined' is null or not an object
Line: 1
Char: 667171
Code: 0
URI: http://

dev-sptd/bundles/kendo?v=oYZbo7NQSLuvHxwnjnakMZia9RBFZeO-xvVApBboXHo1

We do use grid sorting but is there an alternative to using leafDataCells function or a way to disable it and still sort, or is this a bug that needs to be worked on?

Thanks

Rosen
Telerik team
 answered on 24 Oct 2016
4 answers
188 views

Hi,

I have the following listview below - what I want to have is that at every reload ($("#gridMitglied").data("kendoListView").dataSource.read();) and after paging
the first row should be visible (listview Scrolling) - the listview is not selectable!

now after a reload or changing the page not the first row is visible which is not usable...

@(Html.Kendo().ListView<SEARCH_GPDB>()
        .Name("gridMitglied")
        .TagName("div")
        .ClientTemplateId("template")
        //.ClientAltTemplateId("templatealt")
        //.Selectable(ListViewSelectionMode.Single)
        .Pageable(pageable => pageable
            .Refresh(true)
            .ButtonCount(5)
        )
        .DataSource(dataSource => dataSource
            .Ajax()
            .Read(read => read.Action("Mitglied_Read", "Suche").Data("Suche"))
            .PageSize(20)
        )
        .Pageable()
)
Robert Madrian
Top achievements
Rank 1
Veteran
Iron
 answered on 21 Oct 2016
1 answer
230 views

I'm using kendo html helper mvc with the next code in the View: 

@(Html.Kendo().Grid(Model)
            .Name("Grid")
            .HtmlAttributes(new { })
            .Columns(columns =>
            {
                columns.LoadSettings(new List<GridColumnSettings>() { new GridColumnSettings() { Hidden = true } });
                columns.Bound(c => c.TextCol1).Hidden(true);
                (....)
            })
            .RowTemplate(@<div class="objLst">
            <div class="row">... ... ...</div ></div>)

 

I need to group the elements of the grid using javascript. I have the next code:

var grid = $("#Grid").data("kendoGrid");
grid.dataSource.group({field:"TextCol1" });

 

but when I run the javascript instruction, the application (kendo grid) makes an GET request to the server to group the data. I need that the grouping run only on the client side.

It's possible? Or I should migrate all code to javascript?

Thank you.

 

Konstantin Dikov
Telerik team
 answered on 21 Oct 2016
1 answer
240 views

Is there a way to create a wizard inside a kendo window with postback on each step? 

Tried following this link, but wasn;t able to get : http://developer.telerik.com/featured/step-wise-forms-with-asp-net-mvc-and-kendo-ui/

Grids inside kendo tabs do not work ( no ajax calls being made to populate grids ).

Danail Vasilev
Telerik team
 answered on 21 Oct 2016
3 answers
358 views

Hello!!!

I'm using MVC Scheduler with a all day event template. 

<script id="event-template" type="text/x-kendo-template">
    #if(data.IsControl && hasControlElement(data)) {#
            #= title#
     #}else {#
    <div class="amagat">
    </div>
    #}#
</script>

I want to hide all the events with the template that contains <div class="amagat"/>

I've tried it by javascript and css, but no luck... 

<style>
    .k-event > .amagat {visibility: hidden ; display: none}
</style>

 

I've attached two images with the current result and the desired result.

 

Thanks!!

Veselin Tsvetanov
Telerik team
 answered on 20 Oct 2016
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
MultiColumnComboBox
Dialog
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
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?