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
Memento
NA
111
133.3k
c# winforms DataGridView - how to repeat content of selected cell or cells ?
Jun 2 2012 11:25 AM
How can I copy (repeat) selectedCellsValue - till end of row.
Number of cells (i.e. Columns) in a row - varies (about 30).
Excel have that option named - autoFill - Copy.
Here is my try:
int x = dgv.SelectedCells.Count;
foreach (DataGridViewCell c in dgv.CurrentRow.Cells)
{
if (c.Selected == true)
{
string a = c.Value.ToString();
x = x+1;
dgv.CurrentRow.Cells[x].Value = a;
But it copies selectedeCells only once.
Reply
Answers (
6
)
Service Oriented Architecture Project Demo
C# 2010 working with strings