telerik-grid

Kendogrid destroy() and recreate the table on a new datasource, why do the old table columns still exist?

别来无恙 提交于 2019-12-18 11:48:18
问题 When invoking destroy() in KendoUI Grid and then recreate the table on a new DataSource : why do the old table columns still exist? The only element here that stays the say is the element. How do I tell the grid to read the new datasource columns (it reads everything else correct). (if I make 2 different elements, they both populate properly but I rather just keep 1 element and replace the elements table by destroy and reinit) 回答1: Most probably this is because you are not clearing the

JSON2 Error / Conflict with another script

大城市里の小女人 提交于 2019-12-13 20:18:20
问题 I am using the JSON2 library in order to use JSON.stringify to send some JSON data to my MVC controller. When I include another script in my view (Telerik MVC) I start to get script conflicts when using IE7. When I click the refresh button in the grid, I get the following error: Line: 191 Error: Object doesn't support this property or method String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function (key) { return this.valueOf(); }; The error occurs on the

invoke method batcheditcommand from C#.net [duplicate]

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 08:17:53
问题 This question already has an answer here : how to use webmethod with telerik batch edit grid (1 answer) Closed 4 years ago . I used telerik:RadGrid batch editing; to fill this grid I used below syntax: function GridBind(GridID, GridData) { var TableView = GridID.get_masterTableView(); TableView.set_dataSource(GridData); TableView.dataBind(); } To Invoke batcheditcommand I used below syntax. It’s written under non-postback button Javascript event: function SaveAllChanges(sender,args) { var

How to refresh a Telerik datagrid using UWP and MVVM Light

风流意气都作罢 提交于 2019-12-13 04:09:10
问题 Thanks for visiting. I am having trouble refreshing a Telerik grid when the Refresh button is clicked. In other words, if the user changes the data and decides not to save it, clicking the refresh button should reload the grid with the original values. Here is my XAML in the View for the Refresh: <Button Content="Refresh" Grid.Row="1" Margin="92,5,0,11" Command="{x:Bind ViewModel.RefreshDataCommand}"/> Here is my XAML in the View for the Grid: <tg:RadDataGrid ColumnDataOperationsMode="Flyout"

Kendo Grid Column title with red asterick to indicate required field

僤鯓⒐⒋嵵緔 提交于 2019-12-13 02:57:03
问题 I am using a kendo grid with multiple columns. But i need to display few columns with red asterick to indicate required filed. Can someone help me on this. <div id="failureTypeInfoGrid" style="width:100%;overflow-x:auto;"> @(Html.Kendo().Grid(Model.lstSerialData) .Name("serialGrid") .Events(e => e.Edit("onEdit")) .Columns(columns => { columns.Bound(c => c.UnitId).Hidden(true).ClientTemplate("#= UnitId #" + "<input type='hidden' name='SerialData[#= index(data)#].UnitId' value='#= UnitId #' />"

Linq type conversion on generic types

强颜欢笑 提交于 2019-12-12 14:06:10
问题 I have this code I found but it doesnt work even after i tried many conversions. Basically it converts smartly a Datatable into a List that can be serializable. The error is that it can't convert a Dictionary<string, object> to a List<object> : public GridBindingData GetSomething() { DataTable dt = GetDatatable(); var columns = dt.Columns.Cast<System.Data.DataColumn>(); var data = dt.AsEnumerable() .Select(r => columns.Select(c => new { Column = c.ColumnName, Value = r[c] }) .ToDictionary(i =

When grid enters edit mode DateTime picker clears value

为君一笑 提交于 2019-12-12 13:17:14
问题 I have a DateTime field bound to a grid. When the grid enters edit mode the date/time picker displays, but the value is cleared from it. This forces the user to re enter the date/time. Any idea why it value is cleared when the edit mode is triggered? @(Html.Telerik().Grid<ExpenseGridModel>() .DataBinding(dataBinding => dataBinding.Ajax() .Select("ExpenseAjaxBinding", "ExpenseEntry") .Update("ExpenseUpdate", "ExpenseEntry") ) .Name("ExpensesGrid") .DataKeys(keys => keys.Add(r => r.id))

RadGrid make field invisible on Edit

时光怂恿深爱的人放手 提交于 2019-12-12 04:48:43
问题 <telerik:RadGrid runat="server" ID="rdReport" AutoGenerateColumns="false" AllowPaging="true" Skin="Metro" OnItemCommand="ItemCommand" OnItemDataBound="rdReport_ItemDataBound" OnPreRender="rdReport_PreRender" DataSourceID="FountainSource" AllowAutomaticUpdates="true" AllowAutomaticDeletes="true"> <MasterTableView DataKeyNames="ID" CommandItemDisplay="None"> <Columns> <telerik:GridEditCommandColumn ButtonType="ImageButton" /> <telerik:GridBoundColumn DataField="LocName" HeaderText="Location"

Telerik Grid Row Custom Formatting on either bit/int/string field

孤街醉人 提交于 2019-12-12 04:15:36
问题 I'd prefer for either string or int but would settle for it based on bit. The Goal is if the value of a String field == 'blah blah blah' that it will turn that whole row grey(blue table with red and green already used on it so I'm open to any other colour suggestion) I've tried .RowAction(row => { if (row.DataItem.[Bound Data col Name] == "[String value]") { row.HtmlAttributes["style"] = "background:grey;"; } }) and .RowAction(row => { if (row.DataItem.[Bound Data col Name] == "[String value]

Using Telerik MVC grid, editing row blanks TimePicker and DateTimePicker

元气小坏坏 提交于 2019-12-12 03:26:36
问题 I have a Telerik grid populated by an Ajax command similar to the following: PowerStatusGrid.cshtml @{Html.Telerik().Grid(Model) .Name("PowerStatusGrid") .DataKeys(k => k.Add(o => o.StatusItemId)) .Columns(columns => { columns.Bound(o => o.ItemName).Title("Name").Width(250).ReadOnly(true); columns.Bound(o => o.DateTimePicker).Title("Date/Time").Width(150); columns.Command(commands => { commands.Edit().ButtonType(GridButtonType.BareImage).HtmlAttributes(new { @class = "grid-edit-button" })