New Posts New Posts RSS Feed: Update DataGridView cell values based on text input into other grid cells
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Update DataGridView cell values based on text input into other grid cells

 Post Reply Post Reply
Author
Miszou View Drop Down
Newbie
Newbie
Avatar

Joined: 14-Jun-2007
Location: United States
Posts: 19
Post Options Post Options   Quote Miszou Quote  Post ReplyReply Direct Link To This Post Topic: Update DataGridView cell values based on text input into other grid cells
    Posted: 06-Sep-2007 at 9:09am
I have a datagridview with the following columns on it: FirstName, LastName, UserName.
 
When the user adds a new row to the datagrid, to create a new user, I automatically begin editing in the FirstName cell. However, I want the UserName to be updated as the user types into the FirstName and LastName fields in order to provide a default user name. (This only occurs for new users - existing users do not automatically update the UserName)
 
The default UserName should be the FirstName + the first character of LastName.
 
Is there any way to get the UserName cell to automatically update as the user is typing in the FirstName or LastName fields? This is a databound datagridview, with appropriate DevForce Binding Source and DGVBM.
 
I have attached to the TextChanged event of the edit control that appears for in-cell editing, and I can read cell value as it changes, but whenever I try to set the value of the UserName field (either through the grid or through the binding source), the editing cell and the UserName cell get blanked out, I recieve extra TextChanged events that and the edit control is blanked out as well.
 
I'm sure I'm pretty close, but there's just some piece of the puzzle that I'm missing!
 
 
 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down