Telerik Forums
UI for ASP.NET MVC Forum
1 answer
326 views
I am using a Kendo grid in Batch Edit Mode.  When I add rows to the grid and click Save Changes, the added rows correctly get passed to the Create method that I have hooked up, and I am able to add the rows to the database.  The problem I have is that when I then edit one of those newly-added rows and click Save Changes, these rows get passed to the Create method (again) instead of being passed to the Update method.
Please advise asap as to what I am doing wrong.  Here is my Create Method that is hooked up to the grid.
[HttpPost]
public ActionResult Create( [DataSourceRequest]DataSourceRequest request, [Bind(Prefix = "models")]FormCollection addedRoles) {
        try { // code here to update the database from the addedRoles FormCollection. This part works fine. ModelState.Clear() // I added this in to see if it makes a difference...it does not. }
	catch (Exception ex) {
                ModelState.AddModelError("", ex.Message);
            }
        return Json(ModelState.ToDataSourceResult());
}
Shawn
Top achievements
Rank 2
 answered on 01 Aug 2012
0 answers
244 views
Using MVC and Entity Framework I have a model that looks like this:

 public class AddressType
    {
        [ScaffoldColumn(false)]
        public int AddressTypeId { get; set; }
        [Display(Name = "Address Type", Prompt = "Select an Address Type")]
        [Required(ErrorMessage = "Please Select an Address Type.")]
        public string AddressTypeName { get; set; }
        [Display(Name = "Order", Prompt = "Select a display order")]
        [Required(ErrorMessage = "Please Select a display order.")]
        [Range(0, 10000)]
        public int DisplayOrder { get; set; }
        public DateTime? DateCreated { get; set; }
        public string CreatedBy { get; set; }
        public DateTime? DateModified { get; set; }
        public string ModifiedBy { get; set; }
        public byte[] RowVersion { get; set; }
        [Display(Name = "Address")]
        public virtual ICollection<Address> Addresses { get; set; }
    }

Normally in MVC I can do the following
<td>
@(item.Addresses == null ? "None" : item.Addresses.Count.ToString())
</td>


Currently my Grid code looks like this, so far I am having no luck getting the count to display for Addresses

@(Html.Kendo().Grid(Model)    
    .Name("Grid")
    .Columns(columns => {
        columns.Bound(p => p.AddressTypeName);
        columns.Bound(p => p.DisplayOrder);
        columns.Bound(p => p.Addresses);
        columns.Command(command => { command.Edit(); command.Destroy(); });
    })
    .ToolBar(toolbar => toolbar.Create())
    .Editable(editable => editable.Mode(GridEditMode.PopUp))
    .Pageable()
    .Sortable()
    .Scrollable()
    .DataSource(dataSource => dataSource
        .Server()
        .PageSize(5)
        .Model(model => {
            model.Id(p => p.AddressTypeId);
            model.Field(p => p.Addresses).Editable(false);
        })
        .Aggregates(aggregates =>
    {
        aggregates.Add(p => p.Addresses).Count().ToString();
    })
        .Read("Index", "AddressType")
        .Update("Edit", "AddressType")
        .Create("Create", "AddressType")
        .Destroy("Delete", "AddressType")
    )
)
Chad England
Top achievements
Rank 1
 asked on 01 Aug 2012
1 answer
163 views
With my current code, whenever I click "Add" on the grid, the model's ID fields still show up! I can get the functionality I want if I use just the plain old Kendo Web, but I'd really like to get this working using the MVC wrapper. I've spent hours trying to! Could somebody please tell me what I'm doing wrong here? 
Chad England
Top achievements
Rank 1
 answered on 01 Aug 2012
1 answer
108 views
Hello,

We have a Telerik InCell editable grid with FileUpload in use. Now we want to convert it to KendoUI. During this process we found a few bugs / misunderstandings? Hopefully, someone can help us.

For better understanding I added a sample project in which we have an InCell grid with an included FileUpload.

1. The Fileupload-Column doesn't fire the Save-Event of the Grid. With a normal TextBox the event works fine and also using the Telerik Extensions everything worked fine. What can we do? We need an event that gets fired as soon as the user leaves the edit-mode of the cell.

2. The date-column is in a completely different format than it was in the Telerik extensions. What can we do to just get Date + Time, based on the language the user uses... --> 31.07.2012 12:04

3. Problem: http://www.kendoui.com/forums/mvc/grid/ajax-binding-clienttemplate-issue-with-create-action.aspx
--> To see what this problem causes: In the attached sample project --> index.cshtml --> add the ClientTemplate (which is commented out) to the CreatedDate-row --> Start project --> Add a new row --> Error

I hope someone can help us with these three problems.

Another tipp:
4. Problem: Be aware of ClientTemplate where you use a sharp --> ClientTemplate("<a href='#'>...") --> isn't possible anymore
Solution: ClientTemplate("<a href='javascript:void(0)'>...")
--> If someone has a better solution for that - let me know :)
Mathias
Top achievements
Rank 1
 answered on 01 Aug 2012
0 answers
173 views
Need to import external data to SharePoint list and export Sharepoint list to SQL, Orcale, or MySQL?
there are three methods that one can use to import external data sources to SharePoint lists:
1. The first method provided by Microsoft.But it is aware that there is no OLEDB provider for SharePoint, or at least there was no easy way prior to SharePoint 2007. But if you use SharePoint 2010 or higher you have an option to use PowerPivot for SharePoint.Another restriction is that data sources are limited.
2. The second is to develope code. This method requires IT departments to write programs or code that is then utilized in SharePoint to import external date. Surely, it need take time to develop and test the code.if the code is too long or complicated it can quickly become unusable, unstable, full of bugs, etc;
3. The third one: using Data Connector by SharePoint Boost. This sharepoint web part provides provides a convenient and secure way to access external data completely within SharePoint such as sharepoint list to sql. Including sharepoint sql server connection, SharePoint Data Connector also support data connection among sharepoint and other systems, such as, Oracle Database and My SQL, etc. Additionally, this solution allows you to export SharePoint list and library in SharePoint as a set of normalized tables to any external database or you can use SharePoint as the default user interface to update or add to your external data.
Angela
Top achievements
Rank 1
 asked on 01 Aug 2012
2 answers
248 views
I would like to load different content into the window depending on what button was click by the user.

I was trying something like this:

var desk = $("#window");
 
        $("#openEmail").click(function (e) {
            desk.contents() = "test";
            desk.data("kendoWindow").open();           
        });
and that does not work of course.

Any ideas how this could be done?
Andrew
Top achievements
Rank 1
 answered on 01 Aug 2012
0 answers
180 views
How do I create dynamic hierarchy grids in KendoUI.
Something like this -
http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/autogeneratedhierarchy/defaultcs.aspx 

Thanks.
Ashwin
Top achievements
Rank 1
 asked on 01 Aug 2012
4 answers
237 views
I'm using Ajax binding, and my Destroy method looks like this:
[HttpPost]
public ActionResult AjaxDelete([DataSourceRequest]DataSourceRequest request, tbl_app_Customer customerToDelete) {
if (customerToDelete != null) {
db.tbl_app_Customer.Attach(customerToDelete);
                db.ObjectStateManager.ChangeObjectState(customerToDelete, EntityState.Deleted);
                db.SaveChanges();
        }
        return Json(ModelState.ToDataSourceResult());
}
However this code fails with the error:
An object with a temporary EntityKey value cannot be attached to an object context

Any idea why this is? What am I doing wrong?
Victor
Top achievements
Rank 1
 answered on 31 Jul 2012
2 answers
189 views
I need to implement a solution for a master row that has few details "views" for it.
There should be two buttons in the master row - One button should display the details of history and another button that should display another details view.
How can I do it? It seems that I have to override the built-in details opening mechanism...
Yaron
Top achievements
Rank 1
 answered on 31 Jul 2012
1 answer
129 views
I have a remote attribute on my mvc model class being used as my edit template. However my remote controller function is never hit. Is this feature supported?
Adam
Top achievements
Rank 1
 answered on 31 Jul 2012
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
Dialog
MultiColumnComboBox
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
Security
ColorPicker
DateRangePicker
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
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?