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
rzendler
NA
3
0
ListControl - DataBinding (Update)
Feb 18 2004 1:41 PM
I am having an issue with a web form list control that I have bound to a DataTable that I create within in my code. Everything works fine when I add a new record to the datatable. My issues happen when I go an update a column in the table. I end up losing a row in the list control. The table still maintains the correct data but the list control is incorrect in all aspects. Questions: Is this a known bug ? Is there a way to force the update (refresh, invalidate don't work). Table: Has a primary Key and one column that is set to be unique. ListControl. Single column DataSournce = equals the table neam Display = The primary key name "Name". Here is my update code UserDataTbl.Rows[i].BeginEdit(); UserDataTbl.Rows[i]["DisplayName"]= txtName.Text; UserDataTbl.Rows[i]["GID"] = txtGroupID.Text; UserDataTbl.Rows[i]["Note"] = txtNote.Text; UserDataTbl.Rows[i]["UserIni"] = txtIniFile.Text; UserDataTbl.Rows[i]["UID"] = txtUserId.Text; UserDataTbl.Rows[i]["LoginDir"] = txtHomeDir.Text; UserDataTbl.Rows[i]["UserIdeFile"] = txtDefaultDoc.Text; try { UserDataTbl.Rows[i].EndEdit(); } catch(Exception e) { MessageBox.Show(e.Message.ToString()); UserList.SelectedIndex = i; UserDataTbl.Rows[i].CancelEdit(); if(e.Message.ToString().IndexOf("UID") != -1) txtUserId.BackColor = System.Drawing.Color.Red; return; } if (iTemp > iHUID) iHUID = iTemp; bUpdateOnExit = true;
Reply
Answers (
0
)
Hashtable, ArrayList etc.
.NET Programmer for hire!!