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

I have a colour code property on my model which has UIHint set to a colour picker partial view.

Everything works as expected for existing values in my grid but not when I add a new row from the Grid.

I have tried setting default values onto my model property and even put debug lines to write out when the Get property is called.

 However when the Add button is pressed from the Grid, the get property is NOT called and I get a Cannot parse colour "" error.

 How can a default be given to the colour picker?

 

Dimiter Madjarov
Telerik team
 answered on 28 Aug 2015
3 answers
623 views

Hi, 

 I'm using a template for grid popup edit. There are validations for the text input such as pattern="[a-zA-Z0-9_-]{20390}" and they work fine. However, I also want to make validation on  the server side, and I can only use error event of data source:

     error: function (e) {
                alert(e.xhr.responseJSON.error.message);
            }

 

This approach works but its style is not consistent with the former validation message. How can I show the message from remote below the input box, just as they are validated locally?

 Thanks.

Daniel
Telerik team
 answered on 28 Aug 2015
16 answers
958 views

Hello.

 Which is the appropriate way to set up Kendo UI for Asp.net MVC Ajax binding?   

http://demos.telerik.com/aspnet-mvc/grid/index (demo link from the products page)

http://docs.telerik.com/kendo-ui/aspnet-mvc/helpers/grid/ajax-editing (google that result)

 https://github.com/telerik/kendo-examples-asp-net-mvc/blob/master/grid-crud/Controllers/HomeController.cs (On github and hasn't been updated to mvc 5)

 Anyone know for sure?  I just find it confusing that when I google I get multiple answers for the same topic.  I appreciate the assistance.

Jeff
Top achievements
Rank 1
 answered on 27 Aug 2015
1 answer
180 views

Hi,

I am using kendo Tooltip to display on images on my page. but every time I hover over on image, tooltip appears on right corner of my screen.

Please help me to fix this annoying issue.

I have attached screenshot and files.

<div class="demo-section">
<ul id="products" class="dairy-photos">
<li><a href="#" data-id="11">
<img src="@Url.Content("~/images/11.jpg")" /></a>
</li>
</ul>
</div>
@(Html.Kendo().Tooltip()
.For("#products")
.Filter("li a")
.LoadContentFrom("DetailsNew", "TooltipNew")
.Position(TooltipPosition.Top)
.Width(220)
.Height(280)
.Events(events => events.RequestStart("requestStart"))
)
<script type="text/javascript">
function requestStart(e) {
e.options.data = {
id: e.target.data("id")
}
}
</script>
<style>
.demo-section
{
height: 460px;
}
.dairy-photos
{
float: left;
list-style-type: none;
margin: 60px 0 0 60px;
padding: 0;
width: 430px;
line-height: 0;
}
.dairy-photos li
{
display: inline-block;
margin: 0;
padding: 0;
width: 110px;
height: 110px;
position: relative;
}
.dairy-photos li:hover
{
-moz-box-shadow: 0 0 10px rgba(0,0,0,0.8);
-webkit-box-shadow: 0 0 10px rgba(0,0,0,0.8);
box-shadow: 0 0 10px rgba(0,0,0,0.8);
z-index: 1;
}
.dairy-photos li, .dairy-photos li:hover
{
transition: all .2s;
-moz-transition: all .2s;
-webkit-transition: all .2s;
}
.dairy-photos a
{
display: inline-block;
}
.dairy-description
{
float: right;
width: 250px;
margin: 80px 60px 0 0;
}
.dairy-description h2
{
font-size: 2.7em;
font-weight: normal;
}
.dairy-description p
{
line-height: 2em;
}
.dairy-details
{
padding: 10px 0 0 0;
}
.dairy-details h3
{
font-weight: normal;
font-size: 1.5em;
margin-top: 10px;
}
</style>

Plamen
Telerik team
 answered on 27 Aug 2015
3 answers
99 views

Hi,

       I have 2 tables

             Table1 : ID,Table2ID

              Table2 : ID, Description

Table1 as a 1 to many relationship with Table2

Table2 as a 0..1 to many relationship with Table2

I would like to show Table1 in a grid and have a treeview to display the Table2 during Create and Update.

Can someone help me to achieve this?

 

regards

Boyan Dimitrov
Telerik team
 answered on 27 Aug 2015
1 answer
118 views

Hello, 

I am trying to update the grid through popup

I am getting the below error 
0x800a138f - JavaScript runtime error: Unable to get property 'data' of undefined or null reference
also if I click the Edit button and again click on cancel in the Edit popup , the record i have used is missing in the grid
Please help me 
here is my code.
 dataSource: {
                type: "json",
                transport: {
                    read: URL,
                    update: {
                            url: UpdateURL,
                            dataType: "json",
                            type: "POST"
                    },
                    parameterMap: function (data, operation) {
                        if (operation !== "read") {
                            return kendo.stringify(data);
                        }
                    }
                },
                requestStart: function(e) {
                    if (e.type == "update") {
                        //My LOGIC
                        debugger;
                    }
                },

                schema: {

  type: "json",
  id: "ID",
                    model: {
                        fields: {
                            ID: { type: "number", editable: false},
                            Name: { type: "string", validation: { required: true } },
                            Status: { type: "string" },                            
   Access: { type: "string", nullable: true },
                            Address: { type: "string" },
                            Comment: { type: "string", validation: { required: true } },
                            ParentID: { type: "number", validation: { required: true } },
                            ParentName: { type: "string" },
                        }
                    }
                },
                serverPaging: false,
                serverFiltering: false,
                serverSorting: false
            },
            height: 550,
            filterable: true,
            sortable: true,
            pageable: {
                pageSize: 100,
                refresh: true
            },


            columns: [

            { command: ["edit"], title: "&nbsp;", width: "100px" },
   { field: "ID", title: "ID", width: "300px" },
            { field: "Name", title: "SubInventory", width: "300px" },
            { field: "Status", title: "Active", width: "75px" },
            { field: "Access", title: "Access", width: "200px" },
            { field: "Address" },
            { field: "Comment", tite: "Comments", width: "250px" },
            { field: "ParentID", title: "ParentName", width: "180px", editor: dropdownforParent}
]
            , filterMenuInit: onFilterMenuInitSI,
            editable: "popup",
        }).data("kendoGrid");

Kiril Nikolov
Telerik team
 answered on 27 Aug 2015
1 answer
2.3K+ views

Hello there. So I have a gridwhich I can export to Excel.

When doing the export, I'm having two problems.

 This is my function.

 

function excelExport(e) {
       
            var sheet = e.workbook.sheets[0];
 
            for (var rowIndex = 1; rowIndex < sheet.rows.length; rowIndex++) {
                var row = sheet.rows[rowIndex];
 
                for (var colIndex = 0; colIndex < (sheet.columns.length-2); colIndex++) {
  
                    if (row.cells[colIndex].value == "Weekend-") {row.cells[colIndex].format = "[Blue];";}
                    if (row.cells[colIndex].value == "Vacation Day-") { row.cells[colIndex].format = "[Yellow];"; }
                    if (row.cells[colIndex].value == "Holiday-") { row.cells[colIndex].format = "[Green];"; }
                    if (row.cells[colIndex].value == "Critical Task-") { row.cells[colIndex].format = "[Red];"; }
 
                }
            }
    }

 

Problem Num1: Is there any other way to choose other colors?... I only found very few so far like these: Green, Red, Blue and Yellow. If I try colors such as Orange, Light Blue, Purple, which are colors that I really need, it doesn't work. Instead of "[ColorName;"], is there another way.

 

Problem Num2: With this format I'm only formatting the text itself, but what I really want is, for example, whenever in the cell there is the "CriticalTask-" value, I want the cell background color to be red.

 

Thanks for the help!

Dimiter Madjarov
Telerik team
 answered on 27 Aug 2015
5 answers
1.6K+ views

Hi,

 I am trying to do the below demo :

http://demos.telerik.com/aspnet-mvc/sortable/sortable-panels

 

I am not interested in the panel. All I want is a div which is expandable and collapsible. â€‹But i don't see anything working, when i copy all the code as it is. I have tried only the div i want and tried but still it is not working. I don't see k-i-arrowhead-n , I have the latest version.  I have all css too.

 

<div class="panel-wrap">
    <div id="main-content">
        <div id="news" class="widget">
            <h3>News <span class="collapse k-icon k-i-arrowhead-n"></span></h3>
            <div>
 
                <h4><span>Jan 22, 2014</span> Stanford Speaker Series Looks at the Rising Tide of Eastern European High Tech Firms with Telerik CEO Vassil Terziev</h4>
 
                <h4><span>Dec 10, 2013</span> Telerik Test Studio Now Offers Cross-Browser Test Recording and Subscription-Based Pricing for 1M-Strong Developer Community</h4>
 
                <h4><span>Nov 22, 2013</span> Telerik AD is Named "Best Employer in Bulgaria" for Sixth Consecutive Year</h4>
 
                <h4><span>Nov 20, 2013</span> Telerik Embraces the Responsive Web with Latest Kendo UI Improvements</h4>
            </div>
        </div>
    </div>
</div>
 
<script>
   $(document).ready(function () {
            //exapand
            $(".panel-wrap").on("click", "span.k-i-arrowhead-s", function (e) {
                var contentElement = $(e.target).closest(".widget").find(">div");
                $(e.target)
                    .removeClass("k-i-arrowhead-s")
                    .addClass("k-i-arrowhead-n");
 
                kendo.fx(contentElement).expand("vertical").stop().play();
            });
 
            //collapse
            $(".panel-wrap").on("click", "span.k-i-arrowhead-n", function (e) {
                var contentElement = $(e.target).closest(".widget").find(">div");
                $(e.target)
                    .removeClass("k-i-arrowhead-n")
                    .addClass("k-i-arrowhead-s");
 
                kendo.fx(contentElement).expand("vertical").stop().reverse();
            });
        });
</script>

 

 

Thanks,

Veena

DHHS
Top achievements
Rank 1
 answered on 26 Aug 2015
1 answer
150 views

Hello,

I use KendoMvcGrid in my webproject, i choose the option "GridEditMode.PopUp" for add and edit features. I search to not display the modification in grid when ​my popup in display.

Thank you
eo
Top achievements
Rank 1
 answered on 26 Aug 2015
3 answers
145 views

 

var input = e.container.find("input");
    input.focus(function (e) {
        setTimeout(function () {
            input.select();
        });
    });

 The above code snippet allows for selection of all text in the NumericTextBox upon focus in all browsers except the latest version of Safari on Mac OSX Yosemite (Version 10.10.5). Is there an update for this solution? Or is there an alternative solution that works for all browsers?

 

 

Petyo
Telerik team
 answered on 26 Aug 2015
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?