C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » ASP.NET »

Datagrid template column


Posted Date: 28 Aug 2008      Posted By: Rahul V Nair      Member Level: Bronze     Points: 1   Responses: 3



Hi,
Im using ASP.NET2.0, C# 2005, SQL Server 2005

I have a datagrid and one template column for DropDown List.
I want to update my database at the time of changing the drop down list item.
How can i code and under which event i write the UPDATE codes?

Please help me.

Rahul Nair V
Bangalore





Responses

Author: vipul    28 Aug 2008Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

hi,
for that you refer this article they give with example
http://www.odetocode.com/Articles/231.aspx

vipul,
http://dongavipul.blogspot.com

Please Rate This Answer If They Helpful

Thanks & Regards
Patel Vipul



Author: Happy Coder    28 Aug 2008Member Level: GoldRating: 2 out of 52 out of 5     Points: 4

In GridView RowCreated event,
Get the instance of DropDown using the findControl method and add the SelectedIndexChangedevent to the dropdown

DropDownList ddList = e.Row.FindControl("ddlId")
ddlList.SelectedIndexChanged += new EventHandler(ddlList_SelectedIndexChanged)


Inside ddlList_SelectedIndexChanged define the operation to upddate the database.

Geek is back.
____Happy_Coder____
If you feel this is helpful, RATE IT.



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : .NET urgent
Previous : how to get column index of gridview in asp.net
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use