Telerik Forums
UI for ASP.NET MVC Forum
1 answer
179 views
Can i have a control over how it looks and where to show it the popup template generated by default?
i noticed that without any cshtml file,automatically show a view with all the fields from the viewModel somewhere at the bottom,and maybe i want to show in the center of the screen,and the controls be with some width and some color.
Also,In case of a custom template(view) how do i use it with the grid in the popup mode ?
Thanks in advance,
Vladimir Iliev
Telerik team
 answered on 11 Jan 2013
3 answers
1.8K+ views
Hi Telerik Team,

I've a grid with column "sequence" and it needs to be auto incremented. 

if you see the picture, when I click on Add new item, the value in sequence column needs to be 40 and not 5.

Can you please let me know how to create an increment column which takes the latest added data (sequence) and increments it?

Thank you
Vladimir Iliev
Telerik team
 answered on 11 Jan 2013
1 answer
261 views
Hi!
(see edit - base questions fixed)

After implementing the grid for some of our core object listings using a combination of server-side and ajax databindings we have realized we would like to speed up the grid sorting/filtering/searching as well as implementing some more advanced scenarios.

After some reasoning we came up with the idea to use a local datasource and to manipulate evering in memory. However we couldnt find a straight-forward way of doing this. We expected something like:

@(Html.Kendo().Grid(Model.GridRows)
   //...
       .DataSource(dataSource =>
                        {
                            dataSource.Local()
                                .Model(model => model.Id(s => s.Id))
                                .Sort(sort => sort.Add(s => s.Name));
                        })
)

However we realize it would be problematic to do CRUD operations using this approach - for that we would prefer to be able to use Ajax.

So - hopefully I have explained the idea reasonably well. Basically:
  • Is there any good way to use a local datasource (custom js-driven supporting filtering etc)? 
  • Is there any good way to take direct control of the datasource (like @Html.DataSource().... and use that is some way)?

Edit: We realized we could use dataSource.Ajax().ServerOperation(false) to achieve the base behaviour. We can probably figure out how to do some advanced filtering using the Web demos. The second point we still wonder about though - is it possible to use the datasource more directly? For example using a shared datasource or doing some more custom refreshing scenarios without resorting to an all-javascript approach?

Thanks
/Victor
Atanas Korchev
Telerik team
 answered on 10 Jan 2013
3 answers
275 views
Is it possible to get the vsdoc file for just the kendo.web js ? Or, can I use the kendo.all file and just rename it to kendo.web-vsdoc.js?

BOb
Atanas Korchev
Telerik team
 answered on 10 Jan 2013
1 answer
181 views

I am using the MVC Helpers and would like to customize the generated Javascript - in particular, the js class name that is used.

For example, if I do something like this:

                @(Html.Kendo().Grid<ResourceViewModel>()
                    .Name("Grid")
                    .BindTo(Model.Resources)
                    .YadaYadaYada(...)
                )

... then it generates JavaScript for me like this, which creates a kendoGrid in JS:

        jQuery(function(){jQuery("#Grid").kendoGrid({ ... yada yada yada ...

I would like to change the kendoGrid class above to my own custom Widget class. So instead of kendoGrid, I have created a kendoCustomGrid which I would like to have generated instead.

What's the best way to do this?

Atanas Korchev
Telerik team
 answered on 10 Jan 2013
2 answers
2.2K+ views
Hi,

I would like to add a new row to the grid programatically (with certain values, let's say "111", "Mike") everytime a button is clicked(or another event happens, the button clicked is just an example). Can I do that in javascript (hooking the update event on button.click)?
Zora
Top achievements
Rank 1
 answered on 10 Jan 2013
2 answers
441 views
I have a web application, built using MVC 3 and Kendo extensions for MVC version 2012.3.1210.

I'm using the format function to format dates shown in Grids, however they are displaying in the US format (i.e. month first, then day), instead of the UK format, even though I'm setting the kendo culture to en-GB.
e.g.:- The field definition
columns.Bound(p => p.attdate).Title("Att Date").Format("{0:d}");

and the culture reference in _Layout.cshtml :-
<script type="text/javascript">
        //set current to the "en-GB" culture script
        kendo.culture("en-GB");
</script>

The dates shown in date picker controls are fine, - just when displayed in grids.  How can I get UK dates to display?

AP
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 10 Jan 2013
5 answers
570 views
We are using the MVC4 minification (web greese) stuff. To me there is a bug where if I specify the .min.js files in the bundle and we run in debug mode the bundles don't work because it expects non-minified versions. 

I know I can just copy the minified versions with new names but I would like to have the non-minified script files so when debugging we can actually see what is happening. 

Is it possible for you guys to include those files in the releases? If not, is there some place I can get them?

BOb
Sebastian
Telerik team
 answered on 10 Jan 2013
1 answer
321 views
Hi,

Since we update to Kendo UI Complete v2012.3.1304 we start to have a problem on the data grids. The error message is always a empty string when the is a dropdownlist.

Inside the grid:

<select data-bind="value: GroupId" data-val="true"  data-val-required="Erro message." id="GroupId" name="GroupId" class="k-invalid valid" aria-invalid="true">
<option>[Selecione]</option><option value="13">item1</option><option value="47">item2</option>
</select>
<div class="k-widget k-tooltip k-tooltip-validation k-invalid-msg field-validation-error" 
style="margin: 0.5em;" data-for="GroupId" data-val-msg-for="GroupId" id="GroupId_validationMessage" role="alert"><span class="k-icon k-warning"> 
</span><div class="k-callout k-callout-n"></div>
</div>


function to get the list of erros:


var validator = $(this).kendoValidator().data("kendoValidator");
var val = validator.validate();
if (!val) {
var errors = validator.errors();
var errorList = [];
$.each(errors, function (key, value) {
errorList.push({ message: value });
return errorList;
});
}

function from kendo.web.min.js ->

_extractMessage: function (t, n) {
            var i = this,
                r = i.options.messages[n],
                o = t.attr(g);
            return r = e.isFunction(r) ? r(t) : r, a.format(t.attr(a.attr(n + "-msg")) || t.attr("validationMessage") || t.attr("title") || r || "", o, t.attr(n))
        },



We start to debug kendo to identify the problem. We find out that executing this function, _extractMessage: , it returns a empty string because it generates a 
attribute name like "data-val-number". To bybass the problem we change the attribute name from data-val-required" to "data-val-number" with jquery. 

Before call $(this).kendoValidator().data("kendoValidator"); we run this this code:

 $(this).find("select[data-val-required]").each(function (index) {

            var message = $(this).attr("data-val-required");

            $(this).removeAttr("data-val-required");

            $(this).attr("data-val-number", message);
});


Can you help to find a better solution?
Rosen
Telerik team
 answered on 10 Jan 2013
2 answers
251 views
I have a particular use case / pattern for a grid in mind. I would like some input on if it is even possible, the best way to go about it or alternative approaches that might work. I'm asking this even though I know the answer is probably going to be 'No, the grid is not designed for that and can't be adapted to do so'; I'm asking because our back end data service is already set up to provide data and accept inputs in this way.

I have a customer management system which allows multiple profiles per customer. The profiles control the type and amount of products they will recieve as said products come into supply. There are numerous collections of sub-objects managed at the profile level (one-profile to many sub-configurations). The profile management data services already have a lot of logic in place for updating and audit logging - that is to say, every modification to a profile actually copies the whole profile, archives the old one and sets the new one up. This is so that customers and account managers both have visibility on who made what changes and when. Also, not all aspects of the profile are under direct control of the customer: discounts, promotions, advanced settings etc. can only be controlled by our account managers (essentially administrator level users).

So what I would like the grid to do is this:

  1. Display a collection of sub-configurations (this part is trivial and already working)
  2. When adding/creating new additions to the list, do not allow free-form input, only allow the user to select from a pre-approved list of objects. The list also needs to only show options which haven't already been added to the profile. I would prefer this to be displayed in a modal dialog that allows multi-selection. Need some help here.
  3. When finished selecting new additions, display them in the grid without telling the server yet. (This is essentially batch editing and looks to be compatible with existing grid options.)
  4. Some, but not all, fields are editable here. (I think I have this configured correctly via datasource options.)
  5. Entire sub-configuration objects can be removed here. I know how to make this work, but it conflicts with the next requirement.
  6. When saving changes, the entire collection needs to be posted back to the server as a whole. There needs to be only one action for this and it needs to send the entire collection with the most up-to-date entries the user has typed in the UI each time. Need some help here.
Regarding 2:
I can make a Kendo UI pop-up, load its content from an ajax controller with the correct entries in it. I can enable multi-select with a ListView or a Grid, get the selected rows and data items back etc. but I can't make it add the selected items to the current grid listing. Attempts to do so conflict with the datasource only wanting to use data actually from the server. Is there a way to dynamically add items to a datasource without them being part of the server response?

I have also tried to use the built in pop-up editing to add the items to the grid. This bypasses the problems in the previous approach - items that are being edited are displayed in the grid, waiting to be added to the server collection; so they're part of the datasource object without being part of the service call. But there are two other problems with this approach:

1) I can't get the service editor to select a whole object. I can get it to select part of the objects from the approved list using a foreign key setup, but that essentially lets the user mix-and-match pieces from different items on the pre-approved list.

2) I can't get the popup editor to allow multi-selection.

Is there an example I perchance overlooked? Or should I fall back on a single-item editor template (so the user is essentially just selecting the 'ID' of the object they want to add)? Is there multi-add available anywhere?

Regarding 6:
I can get the grid to batch its updates no problem. But I need them done in one call. Currently there is a call to the 'Create' action with just the new items followed by a call to the 'Destroy' action with just the deleted items. Handling these separately would result in two audit log entries being created because there is no way for the server to tie them together. Also, since they are fired one after another asynchronously, handling the on the server would result in a race condition as follows:

Create receives the list of items to add. It has to retrieve the current list, add the new items to the collection, save the collection with the items included which are about to be removed in the destroy call.
Destroy receives the list of items to remove. It retrieves the current list, almost always before the save operation has completed, it removes the items needing removal, saves the collection almost always without the items that were added in the create call.

Is there anyway to put the grid in an all-together batch edit mode? I realize this is bandwidth inefficient, but we gladly trade that off for the auditing and accountability provided by our backend data service.

Any help at all is appreciated.
Alexander Valchev
Telerik team
 answered on 09 Jan 2013
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?