Click here to Skip to main content
16,017,151 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am Using Dropdown in Template Field(Gridview) there is another Template Field Using Label COntrol

Please Help me

When User Change Drop Down value (or item)the other template fields
value (Label )should get changed

for example
drop down values
1
2
3

When User Select 1 the label Template Fields value should be "yes" and on
no value of label should be "0"
Like this
Posted

You need to do event bubbling for this as child controls do not raise any events on its own & need to be bubbled to GridView their parent.To accomplish this, we need to create an event handler for the RowCommand event of GridView. In this event handler we first check the incoming CommandName value to determine which control's event is raised and then take appropriate custom action.This article will give more idea on raising rowcommand event

Trick/Tip: Raise a GridView RowCommand event from a child DropDownList control using a Submit button[^]
 
Share this answer
 
Comments
Sandeep Mewara 10-Jan-11 2:07am    
Good answer.
Anupama Roy 10-Jan-11 2:08am    
Thank you Sandeep !
1)Just fire a DropDown_SelectedIndexChanged event
2)Get a row no of Dropdown
3)Find a Required lable to change in a row
4)Set Lable value as per requirement.

THIS[^] will little help you in AutoPostback Of Dropdown.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900