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
Sach
NA
5
13.4k
How to NOT select a cell?
Oct 28 2008 1:03 AM
In my C# Application program, I have two DataGridViews which are not bound to any data source. I have coded them so that the user is allowed to drag and drop data between the two DGVs as well as within them.
So, when a data item in a cell is dragged and dropped on another cell, the data on the original is deleted - that is set to null.
The problem is, when I do that, after dropping, it automatically select the last cell (the one in which I just set the value to null).
How do I get that cell to be NOT selected?
Here is my code:
dgvSchedule.DoDragDrop(text, DragDropEffects.Copy);
if (bDataDrop == true)
{
dgvSchedule.Rows[info.RowIndex].Cells[info.ColumnIndex].Value = null; //setting the value to null
dgvSchedule.Rows[info.RowIndex].Cells[info.ColumnIndex].Selected = false; //setting that cell to not selected
bDataDrop = false;
}
There, right after I set the value to null, I set the 'selected' property to false, but despite that it still selects that.
Please HELP!
Reply
Answers (
1
)
c# help Simple switch statement question--probably simple for you guys
store procedure