Difference between Edit Item Template and Item Template

Posted by Rcsp under ASP.NET on 8/1/2013 | Points: 10 | Views : 6975 | Status : [Member] | Replies : 4
Hi,

What is the difference between Edit Item Template and Item Template

thanks




Responses

Posted by: Allemahesh on: 8/1/2013 [Member] [MVP] Silver | Points: 25

Up
0
Down
Below is main different between Item Template and Edit Template.

Item Template:-
1. ItemTemplate is the default "normal"-mode which is used to show information for the user.
2. Use <%#Eval("myColumn")%> in itemTemplate.

Edit Item Template:-
1. EditItemTemplate is used when you want to update data.
2. Here you can decide if you want to use textboxes, dropdownlists, checkboxes etc to allow the user to change the data.
3. Use <%#Bind("myColumn")%> in EditItemTemplate

Mark as answer if it helps you.

Rcsp, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 8/1/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Item Template only populates the records...
Whereas EditTemplate have update and cancel buttons. we can update delete the records using EditTemplate and cancel the recent actions by using Cancel Button also

what we can do in itemtemplate not in edititemtemplate?
1. itemTemplate is the default "normal"-mode which is used to show information for the user..Use <%#Eval("myColumn")%> in itemTemplate
2. EditItemTemplate is used when you want to update data. Here you can decide if you want to use textboxes, dropdownlists, checkboxes etc to allow the user to change the data. Use <%#Bind("myColumn")%> in EditItemTemplate


you set the linkbutton(UpdateButton) CommandName property to Update is it because to make the complier understand that when the button will pressed the update command of sql should be fired?
Yes, when a formview/gridview/detailsview etc has a datasource, sush as an sqldatasource-control then its update-command will be fired when using commandName=update

what is the function of CauseValidation property?
If you use validationcontrols to protect lets say a textbox from beeing empty when the button is pressed, the validation will be done before the update/insert/any other server-code is done if CausesValidation-is set to true..

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Rcsp, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rcsp on: 8/1/2013 [Member] Starter | Points: 25

Up
0
Down
Hi friends,

when i retrieve data from database to gridview... if i use any dropdownlist in edit templete, when i click submit button, again i need to store the data in another table. Is it possible to add or insert those data into the databaSe table?

can you give any examples?



Rcsp, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 8/1/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Check the solution here...
http://go4answers.webhost4life.com/Example/save-button-gridview-to-save-another-148899.aspx

Refer the following section "Inserting into Grid view as well as into DB" in the link
http://www.dotnetspider.com/resources/44422-Grid-view-Binding-Data-insert-Update-Delete-into-DB-Code-In-Vb-.Net.aspx

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Rcsp, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response