Forms Data Controls :: Make Editable Gridview - Add - Update - Delete
Feb 24, 2010
I've got my data in the gridview via:
[Code]....
Now I need to make all the data editable (add, update, delete). Why isn't the Gridview the same as DataGridView? With the DGV, the data showed EXACTLY as it did in the database and one could add a record, edit a record, or delete a record.
I want to make an editable gridview with 4 boundfield. When a row is selected, I want to edit the value of the 2 boundfield. Can I use edit, update commandfield?. Because when I tested it, all the columns of the selected row becomes editable.
I have a gridview with bound fields and a templateField that receives data from a submit button which, depending upon the selected object, i.e. dropdown 1, 2, or 3, return a result set. The gridview also has a checkbox column which is used as a marker to determinie the rows to be added to and existing table. If a user selects multiple row, those rows are written to the database. Everything works.
Now, I need to add additional functionality to the gridview:
Upon selecting the checkbox, programmatically the accompanying row must become editable; for each row presented.
Deselected the checkbox, return the gridview row to a read-only state.
There are 14 columns, one of which is a dropdown which needs to maintain its default value.
I have two pages; one page similar to a 'dashboard' displaying an incoming correspondence gridview and the other page 'incoming' displaying the same gridview of incoming correspondence. So my dashboard page is just a snap shot of what some pages have. So there are main pages that are being summarized in the dashboard. What I want to do with the Incoming gridview in the 'Dashboard' Page is once a user clicks a row in that gridview it obtains the correspondence id and redirects to the Incoming page and make that row in that gridview(same view or query as the gridview in the dashboard) editable.
What I have right now is I am obtaining the correspondence id for the row selected and redirecting to the Incoming page but have noo idea how to make that row editable in the gridview in the Incoming page.
In my project i am binding a gridview from session and i want to make it editable. i handled the rowediting,rowupdating and cancelediting event as suppose to and at run time i bound my data to the grid cells in the rowdatebound like this
if (e.Row.RowType == DataControlRowType.DataRow) { RequiredPaper paper = (RequiredPaper)e.Row.DataItem; e.Row.Cells[0].Text = paper.PaperDesc; }
and every time i click on the edit link in the grid view the cell never turns in the edit mode so i can not edit it!
I have a Gridview with 12 columns, Jan, Feb...Dec.
I have a textbox value that could be 1, 2,...12
I want if textbox value is 7, then column Aug-Dec in Gridview is editable when in update mode and the column in Jan-Jul is not updatable (eg make it label instead of textbox).
I want to do one thing that when i edit the gridview then it will not go back to main form for editing.it will remain there in the form for the row editable.
i-e when i edit any row then it will be editable on the gridview.
I have 3 gridview,4 lables having the information, i have a button(Report), when i click this i want make this as Non-editable format single report. i have seen converting Webform to PDF but we should fall back to 3rd party tool to produce the report.
I have an editable GridView and I would like to add dropdownlistbox for editable columns. Is there a way to do it? I want to bind the data also so the dropdownlistbox comes with values.
Im a newbie, hoping any experts can lend a hand. I have a gridview table connected to an SQL database. I have auto generated the update and delete methods to allow me to edit the gridview.
However, I would like the editable data in the gridview to be replaced by a selectable drop-down box. The drop down box is referencing an sql table for selection.
how would i do my Gridview delete command like a update command?
im using a datasource... and my delete command is like my update command... so i can change the status into "INACTIVE"...
DeleteCommand="UPDATE ACCOUNT_MAINTENANCE SET am_status = 'INACTIVE' WHERE (accmain_no = @accmain_no)"
UpdateCommand="UPDATE [ACCOUNT_MAINTENANCE] SET [account_type] = UPPER(@account_type), [min_deposit] = @min_deposit, [min_capital] = @min_capital WHERE [accmain_no] = @accmain_no"
when i press my delete command at gridview... the status changed into "INACTIVE" but when i refresh or press f5... it automatically update the status into "INACTIVE" also...
I have 3 gridviews in one of my web page, each of which will display different data based on the typeid. I have simplified the system structure in the image below(further description will be stated below the image):
As shown in the image above, the web site(presentation layer) will work closely with the Business Logic layer(BLL) and Data Access Layer(DLL). ObjectDataSource control will be the middle man to select, update, insert and delete the data in the gridviews.
During Select, returned data from the database at DAL will be stored in a datatable and return to BLL and then the website itself.
[code]....
However, the Update(command button) and Delete(template field) doesn't work,the RowUpdating and RowDeleting event wasn't trigger when I click on the button, but it works if I set the gridviews' datasourceid to the objectdatasource.
I have a gridview that pulls data from two tables, CLIENT and PAYMENT. I want to add the edit, delete functions to the gridview for the payment portion of the table, that is to edit or delete the payments but not the client. I've manually enabled the edit, delete functions and input the queries. I've also deleted the textboxes from the templates which draw from the CLIENT table so they cannot be edited. Everything looks good on the surface until I actually go to edit or delete anything, and it has no effect.Here's the structure of the two tables:
UPDATE [PAYMENT] SET [PaymentDate] = @PaymentDate, [PaymentAmount] = @PaymentAmount, [PaymentDetails] = @PaymentDetails WHERE [PaymentNumber] = @original_PaymentNumber AND [CLIENT$ClientID] = @original_CLIENT$ClientID AND [PaymentDate] = @original_PaymentDate AND [PaymentAmount] = @original_PaymentAmount AND (([PaymentDetails] = @original_PaymentDetails) OR ([PaymentDetails] IS NULL AND @original_PaymentDetails IS NULL))
Finally, here's the delete query:
DELETE FROM [PAYMENT] WHERE [PaymentNumber] = @original_PaymentNumber AND [CLIENT$ClientID] = @original_CLIENT$ClientID AND [PaymentDate] = @original_PaymentDate AND [PaymentAmount] = @original_PaymentAmount AND (([PaymentDetails] = @original_PaymentDetails) OR ([PaymentDetails] IS NULL AND @original_PaymentDetails IS NULL))
I'm having a gridview in my aspx page with checkbox, User can select one or more than one record(s) at a time and clicks on delete button, Then i'm constructing an object of my DTO and adding all the checked row's Primary Key (DataKeyNames - GUID's in my case) to a serializable class and generating an XML and sending it as parameter to the Stored Procedure.
My Doubt is, can i bulk delete all the rows from database table those are present in my XML document??
If it works, I can do bulk update with XML only, i already did bulk insertion by generating an XML..
My Another Question is, Will it affect the performance? Each time when i construct an DTO object and adding it to the Generic List?
Which one is better, I mean ObjectDataSource or SQLDataSource or my XML method?
I have a gridview with edit,update and delete options..Using a radiobutton,how it is possible to select a particular row of gridview and update or delete that particular row?
[Code].... all of a sudden my GridView has stopped firing the row update event. Friday I was working on it and was working flawlessly. Now I haven't made any changes to the code and all of a suddent has stopped working (yes rediculously bizarre and have been banging my head all day thinking what the something is wrong with it, excuse my french).
Everyone of those events fire except the update. I click the update button and nothing happens.
I have column in the database it's type is bit ,so I bind it to checkbox the problem is I want to make this checkbox update this column in the database I tried to insert command field in the gridview(update one) and convert it to tepelete and delete the button and insert checkbox insted but it not fire the gridview_rowUPdating function so how can I do it.