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
chandu gummadi
NA
67
73.4k
c#.net datagridviewcontrol
Oct 4 2012 2:33 AM
hi friends iam using datagridviewcombobox column in c#.net.
iam using below code
DataGridViewComboBoxColumn clnStatus = new DataGridViewComboBoxColumn();
clnStatus.DataPropertyName = "Status";
clnStatus.Name = "Absent - Leave - Present";
clnStatus.DataSource = new string[] { "Absent", "Leave", "Present" };
DgvTeacherAttendance.Columns.Add(clnStatus);
but at runtime combobox column doest show any value it shows empty value.
for this problem your are sending the below code
private void DgvTeacherAttendance_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
if (e.ColumnIndex == 0) //set your index of dropdown here
{
e.Value = "Absent";
}
}
but if iam using this code at runtime datagridviewcombobox column shows Absent,Present,Leave it's ok now. but the problem is if iam selecting "present" from combobox
next iam moving to another combobox and select "leave" now the first combobox does't show present it acceptes Absent every time why should i get this problem please help me..
Reply
Answers (
0
)
c#.net datagridview combobox column and textbox column
XML - SQL