Telerik Forums
Kendo UI for jQuery Forum
1 answer
209 views
Hi Team -

I am trying to play with locked columns within Kendo MVC Grid. No doubt, It is very intuitive. But when I'm trying to add a custom CssClass to grid table using TableHtmlAttributes method, It does not work

.TableHtmlAttributes(new { @class = "blue" })

It works well without locked column. Can you please suggest?

Thanks,
Raman
Dimiter Madjarov
Telerik team
 answered on 17 Jun 2014
2 answers
813 views
View:
@(Html.Kendo().Grid<ITNBuy.Models.BuyBuilder>()
.Name("gdBuy")
.AutoBind(false)
.HtmlAttributes("@class=gdBuy")
.Columns(columns =>
{
    columns.Bound(p => p.cName).Title("Market").Width(150);    
    columns.Bound(p => p.cStation).Title("Station").Width(100);
    columns.Bound(p => p.cDemo).Title("Demo").Width(100);
    columns.Bound(p => p.cProduct).Title("Prod").Width(100);
    columns.Bound(p => p.cDayofweek).Title("Days").Width(100);
    columns.Bound(p => p.cTime).Title("Time").Width(100);
    columns.Bound(p => p.cCode).Title("Code").Width(100);
    columns.Bound(p => p.cProgram).Title("Program").Width(100);
    columns.Bound(p => p.Cncl).Title("Cncl").Width(100);
})
.HtmlAttributes(new { style = "height:430px;" })
.DataSource(dataSource => dataSource
    .Ajax()
    .Batch(true)
    .Read(read => read.Action("PopulateGrid", "BuyBuilder")
        .Data("LoadParameters")
        )
    .Update(update => update.Action("Products_Update", "BuyBuilder"))
    .Destroy(destroy => destroy.Action("Products_Destroy", "BuyBuilder"))
    .ServerOperation(false) //false = don't read on page load
    .PageSize(100)
    //.Events(events => events.Error("error_handler"))
    .Model(model =>
            {
                model.Id(p => p.buylineid);
                model.Field(p => p.buylineid).Editable(false);                
            })   
)       
.Pageable()
.Editable(editable => editable.Mode(GridEditMode.InCell))
.Selectable()
.Sortable(sortable => sortable
    .AllowUnsort(true   )
    .SortMode(GridSortMode.MultipleColumn))
.Scrollable(scrollable => scrollable.Virtual(true))
.ToolBar(toolBar =>
        {
            toolBar.Create();
            toolBar.Save();
        })    
)

Controller:
 public ActionResult PopulateGrid(string quarters, int? market, string station,
            string client, string contract, int? show, string cost, string dp, 
            string start, string end,
            string sortBy, bool blnFilter, bool includeTrade, bool exact, bool tradeonly,  bool option, 
            [DataSourceRequest]DataSourceRequest request)
        {
            var userid = Session["UserId"].ToString();
            int id = Int32.Parse(userid);

            return Json(db.GetData(quarters, market, station, client, contract, show, cost, dp, start, end, sortBy, blnFilter, includeTrade, exact, tradeonly, option, id).ToDataSourceResult(request), 
        }

GetData Function:
 public List<BuyBuilder> GetData(string quarters, int? market, string station,
            string client, string contract, int? show, string cost, string dp, string start,
            string end, string sortBy, bool blnFilter, bool blnIncludeTrade, bool blnExact, bool blnTradeonly,
            bool blnOption, int userId)
        {
            List<BuyBuilder> list = new List<BuyBuilder>();

            string conn = ConfigurationManager.ConnectionStrings["DevConnString"].ConnectionString;
            SqlConnection cn = new SqlConnection(conn);

            SqlCommand oCmd = new SqlCommand("Buy_BuyLine_Load", cn);

            oCmd.CommandType = CommandType.StoredProcedure;
            oCmd.Parameters.Add("@strQuarters", SqlDbType.VarChar).Value = quarters;
            oCmd.Parameters.Add("@strStation", SqlDbType.VarChar).Value = station;
            oCmd.Parameters.Add("@intShow", SqlDbType.Int).Value = show;
            oCmd.Parameters.Add("@intUserId", SqlDbType.Int).Value = userId;
            oCmd.Parameters.Add("@intMarket", SqlDbType.Int).Value = market;

            SqlDataAdapter oAdptr = new SqlDataAdapter(oCmd);

            DataSet dsResults = new DataSet();
            cn.Open();
            //oCmd.ExecuteNonQuery();
            oCmd.CommandTimeout = 600;
            // oAdptr.Fill(dsResults, "Results");
            cn.Close();

            var dataTable = new DataTable();
            oAdptr.Fill(dataTable);

            string costConvert = "";
            foreach (DataRow dr in dataTable.Rows)
            {
                BuyBuilder u = new BuyBuilder();
                u.buylineid = ((long)dr["buylineid"]);
                u.cName = dr["cName"].ToString();
                u.cStation = dr["cStation"].ToString();
                u.cDemo = dr["cDemo"].ToString();
                list.Add(u);
            }
            return list;
        }

Not sure how many records before it fails but i know it works for 2500 records and fails for 5000 records.  The grid just does not display the data once it returns more than 5000 records.  Please help. I also tried virtualization and that did not work as well.


Xinzhou
Top achievements
Rank 1
 answered on 17 Jun 2014
1 answer
86 views
Hello,

I have an grid bounded to some data & now I want to apply some pre-defined filters & sort to the Grid. If I use the methods dataSource.filter(initialFilter) or dataSource.sort(sortParams) an immediate request is sent to the controller. 

I want to do this operations offline & once I have added both the Sorts & Filters I want to do dataSource.read() which than my server side code shall take care of the added sorts & filters

Can you let me know how can I achieve the same?

Thanks & Regards,
Manoj Kapoor
Manoj
Top achievements
Rank 1
 answered on 17 Jun 2014
3 answers
628 views
This doesn't make any sense to me. I don't see it pointed out anywhere in the docs either.

You can see in the custom validator example:

productnamevalidation: function (input) {
  if (input.is("[name='ProductName']") && input.val() != "") {}

I didn't pay any attention to the .is()​ at first, but now I know why. I thought updating to the latest KendoUI would resolve the issue, but it does not. You can still see the behavior on the trykendo site: http://trykendoui.telerik.com/ajat/2. Open the console and you can see that it runs for every field.

Please incorporate the .is() check or another approach so that I don't have to remember to do it...
Kiril Nikolov
Telerik team
 answered on 17 Jun 2014
3 answers
176 views
Hello,

I am trying a simple layout as below.
The footer element doesn't show on any device.

Thanks for  your time and help.

--
Hiren



<!DOCTYPE html>

<html>
<head>
<title>Navy 4 Seniors</title>
<link href="../resources/css/kendo.mobile.all.min.css" rel="stylesheet" />
</head>

<body>

<div id="home" data-role="view" data-layout="default">KendoUI  Mobile World</div>
<section data-role="layout" data-id="default">
<header data-role="header">
<div data-role="navbar">Header</div>
</header>
<footer data-role="footer">
<div data-role="tabstrip">
<a href="#home">Footer</a>
</div>
</footer>
</section>
<script src="../resources/js/jquery.min.js"></script>
<script src="../resources/js/kendo.all.min.js"></script>
<script>
        var app = new kendo.mobile.Application();
    </script>
</body>
</html>
Kiril Nikolov
Telerik team
 answered on 17 Jun 2014
10 answers
1.4K+ views
I am using Bootstrap on a page that has the HTML 5 Report Viewer and the HTML 5 Report Viewer completely goes away.  If I remove the link to Bootstrap the HTML 5 Report Viewer is shown and works again.

I am using Bootstrap on all of my other pages.  How can I get Bootstrap to work on the pages where I have the HTML 5 Report Viewer?

Thanks and Best Regards,

Mark Kilroy
Stef
Telerik team
 answered on 17 Jun 2014
1 answer
292 views
Hi All,
Probably a simple question for you experienced folk.  How do I get the id of the element being dropped in the onDrop function?

​$(".dropArea").kendoDropTarget({ group: "choicesGroup", drop: onDrop });

function onDrop(e) {
                 /* how to get the id of the element being dropped? */
            }

Thank you!
Alexander Valchev
Telerik team
 answered on 17 Jun 2014
1 answer
198 views
We need to implement a treeview with checkboxes in a dropdownlist so that multiple selections can be made by the user, like the functionality offered now by RadDropDownTree for WebForms. I see there is an example of a treeview (no checkboxes) in a drop down. We are developing now in MVC and would like to be able to do replicate this functionality with jQuery.
Can you provide example code of how to implement a treeview with checkboxes for multiselect in a dropdown?
Thanks.
Dimiter Madjarov
Telerik team
 answered on 17 Jun 2014
1 answer
119 views
Is it possible to disable mouse field events and dragging on the stock chart?
T. Tsonev
Telerik team
 answered on 17 Jun 2014
3 answers
417 views
I am trying to use the Notification control. However, when attempting to use it, the following compiler error is thrown: 

 CS1061: 'Kendo.Mvc.UI.Fluent.WidgetFactory<dynamic>' does not contain a definition for 'Notification' and no extension method 'Notification' accepting a first argument of type 'Kendo.Mvc.UI.Fluent.WidgetFactory<dynamic>' could be found (are you missing a using directive or an assembly reference?)

I believe I am using all the correct Kendo libraries. 

My declaration is as follows: 

    @(Html.Kendo().Notification().Name("popupNotification"))


I am using the following scripts and css files: 

<link href="@Url.Content("~/Content/bootstrap.css")" rel="stylesheet" type="text/css" /><br><link href="@Url.Content("~/Content/kendo/2014.1.416/kendo.common.min.css")" rel="stylesheet" type="text/css" /><br>    <link href="@Url.Content("~/Content/kendo/2014.1.416/kendo.dataviz.min.css")" rel="stylesheet" type="text/css" /><br> <link href="@Url.Content("~/Content/kendo/2014.1.416/kendo.default.min.css")" rel="stylesheet" type="text/css" /><br> <link href="@Url.Content("~/Content/kendo/2014.1.416/kendo.dataviz.default.min.css")" rel="stylesheet" type="text/css" /><br><script src="@Url.Content("~/Scripts/kendo/2014.1.416/jquery.min.js")"></script><br><script src="@Url.Content("~/Scripts/kendo/2014.1.416/kendo.all.min.js")"></script><br><script src="@Url.Content("~/Scripts/kendo/2014.1.416/kendo.aspnetmvc.min.js")"></script><br><script src="@Url.Content("~/scripts/kendo.modernizr.custom.js")"></script><br><script src="@Url.Content("~/Scripts/kendo.web.ext.js")"></script><br><link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />


Any ideas? Thank you. 




Kiril Nikolov
Telerik team
 answered on 17 Jun 2014
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Drag and Drop
Application
Map
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
DropDownTree
ListBox
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
Licensing
PivotGridV2
ScrollView
Switch
TextArea
BulletChart
QRCode
ResponsivePanel
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
TimePicker
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
LLM Kit
+? more
Top users last month
Simon
Top achievements
Rank 2
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
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?