Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
//the project i am working on is a dnn project and the error is related to telerik radcombobox at GetDates() the value for cboRoles.SelectedItem is null which is causing error while adding role to user


private void cboRoles_SelectedIndexChanged(object sender, EventArgs e)
{
GetDates(UserId, Int32.Parse(cboRoles.SelectedItem.Value));
BindGrid();
}
Posted
Comments
Kornfeld Eliyahu Peter 28-Jul-15 4:51am    
How do you fill the combo?
Michael_Davies 28-Jul-15 5:04am    
You should always verify that there is a selected value, selecting nothing is a SelectedIndexChanged, assuming that the event fired because there is a value is not safe.
Aravindba 28-Jul-15 5:53am    
First check this line before passing in GeDates()function
integer strvalue = Int32.Parse(cboRoles.SelectedItem.Value); and check value got or not ?
Jitesh Hirani 4-Aug-15 4:26am    
Try using SelectedValue property instead.Make sure you have assigned DisplayMemberPath and ValueMemberPath.

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