How to add a blank row into GridView Control, for editing and inserting data into database.

Dear all:
      I show my data in browser with ObjectDataSource and GridView .The GridView have Edit,Select,Update functions.However ,I have an idea that: if I click some button, the GridView Control can add one blank row in its bottom where I can Edit data and Insert these data into database.I don't know whether the GridView Control  have these function.
      Please give me some advise.
      Thanks a lot!
0
StarOfStar
11/15/2005 8:09:55 AM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

2 Replies
1123 Views

Similar Articles

[PageSpeed] 57

The GridView don't support Insert. Take a look at this post for a solution.
/Fredrik Normén - fredrikn @ twitter

Microsoft MVP, MCSD, MCAD, MCT

ASPInsiders
My Blog
0
Fredrik
11/15/2005 9:59:53 AM
 Thank you very much! 
I have solved my problem after your method.Your blog is very useful to me.
Thanks a lot !

0
StarOfStar
11/16/2005 5:13:54 AM
Reply:

Similar Artilces:

Add new controls to a gridview row; when editing that row using the edit row feature in the gridview control.
Hi all  I have a questions that looks hard / complex to me, and i know you can help me in this. Q {  I have row in a Gridview and i have an edit option to it. I press the edit button, to edit the values in that row and update data all the way back to the database. Now when i press the edit button, i want a drop down list to be displayed that contain values for a particular field in my grid view. (for now only plain text boxes appear.) } I hope you understand my question, all i need to do is replace the text box controls with a dropdown list when i am editing a row in ...

Data Controls insert rows into gridview then insert rows from gridview into SQL Table
Hello there, I'm still new at performing miracles with code . Currently I am having trouble with my latest coding adventure I have a web application which records jobs and labour assigned to jobs. The issue in particular I'm having is the way in which labour is to be assigned. I want to use standard controls (Textbox, Dropdownlist) to record the values into a gridview (ie,put multiple rows into the gridview using the controls). Then, when all the inserting is complete, the user clicks a submit button to insert all the rows from the gridview into a database table. The reason for...

How to add the data present in the controls to a table control without any database involvement.
Hi All,i am four controls where i will write the text and once i click the add button those should get added to the table .i want 6 columns fixed in the table and rows as many as required.i tried doing that taking a table server control and able to load the table.but the problem is whenver i am adding a new row the old one is gfetting overwritten by this and at the end i am getting only one row.  System.Web.UI.WebControls.Table t1 = new System.Web.UI.WebControls.Table();  i have declared the below one global TableRow tr; TableCell tc1; TableCell tc2; TableCell tc...

Data presentation control in another Data presentation control
 Hello,I want to make a menu with datalist or gridview control.Basically,the menu will be like this,Categories     Sub Categories.For example, for COMPUTING category there will be NOTEBOOKS DESKTOPS etc.There will be a image for CATEGORIES and linkbuttons with Subcategories.If I put a datalist inside a datalist and a link button inside the second datalist visually it satisfies my need.However,CommandArguments come from database to linkbutton.Andwhen one of these command buttons is cliked it must go to proper page.I dont know how to wrie an event_handler ,specifically, for...

Modify default (1 database field per row) rendering for DetailsView Control in Details, Edit, Insert Pages in a Dynamic Data WebSite
Hi, DetailsView control on Edit, Insert, Details pages render the data as a HTML table with only 2 columns (1 column for the column name and the other for its database value). I would like to modify this default behaviour of the DetailsView control to render atleast 2 database fields per row to capture some of the real estate on the right side of the page. Any suggestions are higly appreciated.  -Mahipal     You could use custome pages or have a look at this articles of mine here: Custom PageTemplates Part 1 - Custom PageTemplates with Ajax Control Toolkit Tabs ...

Edit data with GridView Control ? or another control ? help
I use GrivView in ASP.Net 2.0 to show data from DataTable. And i want to edit some fields in some rows. How can I do it? If i touch EDIT button - all columns, which have ReadOnly=false, switch into EDIT mode. But I want, that in first raw I can edit 2,3 column and in second row only 3 column. How can I do it ? ...

After a user has entered his registration info I want to add him to my database. Is there a specific control which can handle the update/insert of data from a form into a database?
After a user has entered his registration info I want to add him to my database and also validate whether his name/e-mail is already registered. Is there a specific control which can handle the update/insert of data from a form into a database?If not, how can I add someone? Basically what im asking is how can I add a new user using the best method (best functionality) of the .NET framework. So validate duplicates AND add this user. ;)please mark answers as 'Answered' and post back solutions when you figure stuff out that isnt in the post already. Hi, you could use this sample as a...

Bind Data to an Image Control not in a Data Presentation Control
I've been searching for two days but I don't really know what to search for.I'm making a site for a photographer.  The Default.aspx page displays Albums by showing a title, image and description from the database table Albums. Click an album to view the contents and it passes the QueryString which is AlbumName.  The ViewAlbum.aspx page uses the QueryString to display an UpdatePanel holding a Large Image and a Repeater full of dynamically filled ImageButtons for thumbs.  Both are from the database table Photos and are retrieved using an ObjectDataSource. Click the ...

Multistep Insert/Edit for Dynamic Data Controls [Wizard or Tab Control functionality]
Hi, Do DDCs have support for multistep insert/edit of table/view data? By this I mean a kind of wizard or tab control functionality.   Thanks  AhmadUK Hi Ahmad- Currently the Dynamic Data Controls don't support a wizard or tab interface for table data manipulation.  Dynamic Data Controls currently support GridViews for delete and edit, and DetailsView for delete, edit and insert.  This is an interesting feature though and one we will consider for the future.  Thanks for your suggestion.Polita PaulusThis posting is provided "AS IS" with no war...

Update other controls after a Postback has fired from another control - eg insert data
Hi This is a slight modification to the personalweb asp.net template which shipped with VS2005 I have a web form - linked to a master with two content placeholders left and right: #1 In the left i have a formview containing a textbox + button - and a datasrouce object with an insertmethod - this calls a method to insert the textbox data into table albums: #2 In the right  i have a gridview which has a datasource this has a selectmethod which calls a select method from table albums. Because i am using a maser template with two content placeholders i cannot use the same ObjectD...

Trying to use the FAQ " Sorting and paging in the GridView control when not using data source controls "Sorting and paging in the GridView control when not using..."
and I am not getting the results I had hoped for.  I keep getting a "Compiler Error Message: CS0123: No overload for 'AdhocJobGridView_PageIndexChanged' matches delegate 'System.EventHandler'".   Here is my event handling... protected void AdhocJobGridView_PageIndexChanged(object sender, GridViewPageEventArgs e){ try { AdhocJobGridView.DataSource = wsBaseInfoArray; AdhocJobGridView.PageIndex = e.NewPageIndex; AdhocJobGridView.DataBind(); }catch (Exception ex) {throw ex; }   Here is my aspx... <asp:GridView ID="AdhocJobGridView...

Insert data from a dropdownlist and textbox control into a database ( vb.net)
Hi everyone, I am creating an application for my students.  I teach piano.  There are three levels for them: Beginner, Intermediate, Advanced. After they have logged in, they are given the opportunity to select various pieces of sheet music to learn according to their level from a dropdown list control.  I have created the database which lists the sheet music and bound it to the dropdownlist control.  I have also added a textbox control where I want them to type in the reason why they selected the particular piece of music to learn (I know, kids hate writing essays, but ...

using javascript getting value from textbox when edit button is clicked and both controls are present in gridview control
Hi All using javascript I want to get value  from textbox when edit button is clicked and both controls that is texbox and button are present in gridview control .Alok Hi aloksinha83, Please see this post: http://forums.asp.net/t/1069245.aspx Thanks,Qin Dian TangMicrosoft Online Community SupportPlease remember to mark the replies as answers if they help and unmark them if they provide no help....

How to add a Web server or HTML server controls (such as CheckBox) to the template in GridView and bind the controls to a data source.
How to add a Web server or HTML server controls (such as CheckBox) to the template in GridView and bind the controls to a data source. Normally, We can add a Web server or HTML server controls to the template in GridView control,just like the Code 1I hope to do the same thing by programming (just like the Code 2), but I can ony add the BoundField,I don't know how to add a CheckBox control to the template in GridView , could you help me? //--------------------------------------------Code 1------------------------------------------------------------<asp:GridView AutoGenerateColumns="False...

Web resources about - How to add a blank row into GridView Control, for editing and inserting data into database. - asp.net.presentation-controls

Inserting Kate
jurvetson posted a photo: the speaking GPS avatar that we came to love.. more prep photos below... You can hear her voice in the video compilation ...

Inserting the Galaxy Note 5’s S Pen backwards can permanently damage the device
One of the features Samsung highlighted when it unveiled the Galaxy Note 5 was the device's new S Pen slot design. The Note 5 features a spring-loaded ...


Inserting Slavery Into The Climate Debate
Chris Hayes compares the fight against fossil fuels to the abolitionist movement. He states plainly that “there is absolutely no conceivable ...

Samsung smart TVs inserting ads into third-party apps
... playback have pissed off a number of consumers. People with smart TVs from Samsung have been complaining that the electronics maker is inserting ...

Inserting images into Gmail could be so much better
When Google first launched the new compact compose window in Gmail, many of you might have noticed something annoying about inserting images. ...

Gawker tells Steven Crowder to "stop whining, take your licks, and accept that getting hit in the face ...
"... in the middle of an argument between billionaire-funded know-nothing ideologues and people whose livelihoods and stability are being threatened ...

Gmail's Shortcut for Inserting Hyperlinks
... but that doesn't mean Google shouldn't improve them. Many people complained that Gmail's rich text editor doesn't have a shortcut for inserting ...

Why Hollywood Is Inserting These Two Huge Chinese Actresses Into Its Summer Blockbusters
... It shows the enormous potential in China for distributors. We've previously discussed how Hollywood is starting to cater to China by inserting ...

Samsung SmartTVs are inserting ads into movies - Business Insider
Random Pepsi pop-up ads have been appearing when SmartTV users watch content through the device's third-party apps.

Resources last updated: 1/18/2016 8:22:07 AM