I am learning ASP.NET MVC with "Professional ASP.NET MVC 2" but it seems that I am still far away from basic knowledge. My problem is that I have a page where I must subscribe users for a tournament. My url is something like "Tournaments/Subscriptions/1" and it will show all users with a editable checkbox indicating if the user is currently subscribed. I have created a new ViewModel object called SubscriptionViewModel which is something like this:
[Code]....
But the method can't be called, since it gives the following error: No parameterless constructor defined for this object. Obviously I am making a big error here, but I don't know where to start.
I have a datagrid which shows the search reasult(time entered by the user preveiously)on a button click event depending uppon the input name or date enter by the user,i want to show a drop down list for a field selection like depertment whenever user want to edit the data in datagridiew,i am using access database & asp3.5.
I have a category and a subcategory column in a Jqgrid. I have enabled inline editing, both category and subcategory are dropdownlists columns (edittype:'select'). I need to filter the subcategory list based on the selected category. I wonder how can I acheive this functionlity? I tried the below event but its not working for me
afterEditCell: function(rowid, celname, value, iRow, iCol) { //to do here }
the above event doesn't get fired. my all column are editable
I have loaded up a gridview object with data. I have turned on Edit on the grid. It lets me edit the data, but I also want to put some code to check for correct data in each field. I tried to assign a requiredfieldvalitor, comparevaliditor but they don't work. Is there an event I can capture to fire up some code before the grid sves my data?
I just finished making a change to an ASP.NET Ajax screen from a few years back. It was harder than expected to build and maintain. On this change, I estimated 12 hours and spent 4 days. Granted I also did extensive refactoring to simplify the code. This is actually some pretty fun code, but I wonder if there was a better route for the original implementation than the one I took. To start, here's a screenshot:
The Problem So obviously this is an editable tree of data. The data behaves very differently at each level -- very different sorting/collision rules and so on. My solution is actually performant and provides an adequate user experience, but it's nearly 2,000 lines of code spanning 11 classes, which is more than I envisioned going in. I'm curious if you've solved similiar problems and if you were able to find a simpler solution. It looks pretty straightforward at a glance, maybe that means I did something right. But there is some real complexity here -- obviously you can add and remove items at three different levels, and everything sorts similiar to a netflix queue, but with quirks. It also has to detect collisions on the various entities (in the image, if you changed day 5 to day 1, it would have to figure out which one is actually day one and move the other one).
The biggest problem was keeping track of the state, since users don't want to commit changes to the database as they work. I thought it might be possible to use the actual controls (nested repeaters in this case) to represent this interim state, but that ended up being a dead end due to complexities related to the underlying data. The Solution To solve this, I created a full blown XML representation of all the data, which was actually great in some ways since I was able to use LINQ to do a lot of heavy lifting around sorting and querying. Still, there is a lot of code in here related to syncing up the xml to the html and so on, and I had to make a pretty hefty abstraction on top of the xml to make it easy for me to work with it in code. In case you're interested, I am currently persisting the XML to session state so that it will survive across callbacks, but eventually that should go into the database.
One colleague told me it would be better to use Flex or maybe Silveright for something like this, and I think that might be true since those are both much more stateful, although Silverlight was not ready for prime time back when this started, and I don't know Flex. Maybe using a temp table instead of xml would have been superior in some way. I'm looking to learn and improve -- what have your experiences been with this type of problem?
I have a MySQL database, and I'm currently creating an ASP.NET website to update data in it. I'm currently having trouble changing the data with GridView. Reading through various posts on this site, i think I've got a problem with binding the data, but I'm not sure how to accomplish this with MySQL database. My c# code is as follows:
[Code]....
My asp code is as follows:
[Code]....
At the moment I'm getting an error about the "trash" data, it's an Int32 field, but I'm not sure how to handle that.
I have made an ASP.NET page with a ListView which binds to a Linq datasource which have inserting, updating and deleting enabled. All very trivial and well designed by MS. It all works very well so far.
Now I add a DropDown control to the page and binds the Linq datasource Where clause to the dropdown using the following code:
[Code]....
Now I can filter the listview based on the DropDown control. It works very well and I can still insert and delete rows in the ListView.
PROBLEM:
However when the DropDown control is used to filter the ListView rows I can no longer use the Editing functionality of the ListView. The row never goes into editing mode when the Edit button is clicked.
When the DropDown is not used for filtering - is in default state - editing works as expected.
ths is my html code here i am editing the gridview data on the edititemtemplate itself but it shows error when i am going to get the testiActive .And also the when i delete it shows the object Reference exception. i do no what the issue the same thing i used on the updating - there i got the id value - when i am going to delete it show error ther.
[Code].... and here is the updating code
[Code]....this is my Gridview_Deleting Code
string id = ((TextBox)GridView1.Rows[e.RowIndex].Cells[0].FindControl("testid_TextBox")).Text;
I have gridview which have 6 columns 3 columns are display from other table and 3 columns i want to enter i want when I press edit button all columns appear in edit mode and edit button change into update and when i press update all the data show which includes three auto display and 3 edit by me and all these 6 columns are also update in my database new table.
CREATE TABLE [dbo].[Time_Sheet]( [Name] [nchar](30) NOT NULL, [JobNumber] [varchar](30) NOT NULL, [Totaltime] [time](7) NOT NULL, [CostBySalary] [money] NOT NULL, [CostByOverhead] [money] NOT NULL, [Date] [datetime] NOT NULL
I have a .mdf database file with a keyid in the first column which has a missing sequential entry, How can I edit/add a key entry in a list? Using a gridview edit causes an error of cant edit datakey filed. Is there a way of inserting/editing it whilst in show data view in web developer 2010?
What is the best way to disallow editing of existing entries in ASP.NET Dynamic Data while it should still be possible to add new entries? If possible, I would prefer a solution without custom templates.
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e) { GridView1.EditIndex = e.NewEditIndex; BindData(); } in bindata i am doing this
The gridview lives in a formview, which lives in another formview.
Inside one column is an end date. This column has a textbox which gets it's value when I choose a date from a calendar control. However, when I choose a date from the calendar control, the program crashes instead of populating the text box.
Here is the page and the selectedIndexChanged sub for the piece of work I'm trying to accomplish...
[Code]....
Gridview2 is inside formview3 inside formview1I have included the whole page below, but the problem area is gridview2[Code]....
i am trying to edit aspnet_memberships table in detailsview but without using applicationid field. i dont want to be visible applicationid field and some other fields that cannot be null. when i take applicationid visible to false and try to edit some field i get message Cannot insert the value NULL intocolumn 'ApplicationId' because applicationid field dont have any value. this value should be its own value.
As the subject says, i display a gridview filtered from 3 dropdownlist, wich all the items are from a local Data base, once i display this gridview i want to select a row with a button then and add, modify or delete data from it and then this new info is saved on the data base, so when i display the grid again i will see the new info. Im working on visual studio 2010, i dont use code behind, all is in asp .net.
Could I have an example of reading a record from backend sql server, editing the information in a webform as needed and save it back to the same record in sql server?
I'm trying to update data with the EF I can't seem to get the EntityKey when I debug and hit this line befor I save changes _entities.ApplyPropertyChanges entityToEdit.EntityKey .EntitySetName, blogEntryToEdit); The EntityKey is null dose anyone have any idea how this key is set can't SaveChanges() without it _entities.ApplyPropertyChanges(entityToEdit.EntityKey .EntitySetName, blogEntryToEdit);
I have a DataGrid with a template where i have a counter. When i add items to the dataGrid and want to change the ammount for a specific item, all the rows in the datagrid changes. How can i only change one item in the datagrid?
how to focus on grid Row while editing , i mean preserve position after clicking editing or updating i have gridview of 5000 rows i don t want to scroll up or down after editing or updating, i want to return to the same row to make sure that this row is updating
I am designing a forums website and i have prepared the posts page for it by a listview. I want to add an edit button for the users to edit their posts. How can i show the edit button only on their posts.
I'm trying to edit the header row of my gridview to look like this.As you may have noticed, this is the Gmail layout and this was indeed what i intended for. I want to have on my header row some buttons that would then execute some actions to all the selected rows (very much like Gmail).