Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have Hyperlink button in the DataGrid, and binding with index in it. When I click on Hyperlink in DataGrid it has to select ComboBox item; Based on the selected item in Combo Box I have to load the remaining controls in the page.

When I normally changing selection in Combo Box, the selection changed event is firing but when I coming from Hyperlink, selection changed event is not firing;

cbgrpsList.SelectedIndex = i; --> "i" is from the DataGrid Hyperlink Button.
cbgrpsList.SelectionChanged += new SelectionChangedEventHandler(cbgrpsList_SelectionChanged);

Can somebody help in this...

Thanks in advance,

Regards,
Murali.
Posted
Comments
Savalia Manoj M 28-Jun-13 3:05am    
Can you write your some code here?
Murali Krishna Babu 28-Jun-13 3:30am    
Hi,

I am getting the ComboBoxIndex from DataGrid Hyperlink Button.

if(i !=null)
{
cbgrpsList.SelectedIndex = i; --> "i" is from the DataGrid Hyperlink Button.
cbgrpsList.SelectionChanged += new SelectionChangedEventHandler(cbgrpsList_SelectionChanged);
}
else
{
cbgrpsList.SelectedIndex = 0;
cbgrpsList.SelectionChanged += new SelectionChangedEventHandler(cbgrpsList_SelectionChanged);
}

This is how I wrote the code. If I am getting the Index from DataGrid Hyperlink I am using "if" condition otherwise I just selecting the index 0.

When I normally changing the selection from Combo Box the selection changed event is firing normally. But when I getting the selected index from Data Grid Hyperlink Button that Selection changed event is not firing.

How can I do this... Plz help

Regards,
Murali.

1 solution

you must set

cbgrpsList.SelectionChanged += new SelectionChangedEventHandler(cbgrpsList_SelectionChanged);

out of hyperlink click action, for example you can set it in your Constractor.
 
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