TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Peter Dzuya
NA
313
40.8k
Obtaining value an Enum from a gridview (Entity Framework)
Nov 30 2016 5:02 AM
Hi All,
I am trying to get an enum value from a selected list in a grid. Could some one assist me please. My Code is displayed below.
private void barButtonAddNewRole_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) {
try{
var selectedRole = UserRolegridView.GetFocusedValue();
if (selectedRole == null){
MessageBox.Show("Please select a Role", "Stock 2017", MessageBoxButtons.OK, MessageBoxIcon.Stop);
return;
}
var selectedUser = UsergridView.GetFocusedRow() as User;
if(selectedUser == null) {
MessageBox.Show("Please select a User", "Stock 2017", MessageBoxButtons.OK, MessageBoxIcon.Stop);
return;
}
_userRole = new UserRole(){
LastEditedDate = DateTime.Now,
LastEditorUserId = CurrentUserInfo.User.UserId,
UserRoleName = ?
UserId = selectedUser.UserId,
CompanyBranchId = CurrentUserInfo.User.CompanyBranchId,
DeletedStatus = false
};
userRoleBindingSource.EndEdit();
_userRoleService.Insert(_userRole);
} catch(Exception ex) {
MessageBox.Show(ex.GetBaseException().Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
Thanks.
Reply
Answers (
1
)
Select only one checkbox from multiple checkbox in a row
Split and sum array like below