Click here to Skip to main content
15,892,059 members
Home / Discussions / C#
   

C#

 
GeneralRe: Web Browser With Tabs Pin
Pedram Behroozi1-Nov-08 22:11
Pedram Behroozi1-Nov-08 22:11 
GeneralRe: Web Browser With Tabs Pin
jas0n231-Nov-08 22:30
jas0n231-Nov-08 22:30 
GeneralRe: Web Browser With Tabs Pin
Pedram Behroozi1-Nov-08 23:04
Pedram Behroozi1-Nov-08 23:04 
GeneralRe: Web Browser With Tabs Pin
jas0n232-Nov-08 1:37
jas0n232-Nov-08 1:37 
GeneralRe: Web Browser With Tabs Pin
Pedram Behroozi2-Nov-08 2:19
Pedram Behroozi2-Nov-08 2:19 
GeneralRe: Web Browser With Tabs Pin
jas0n232-Nov-08 3:05
jas0n232-Nov-08 3:05 
GeneralRe: Web Browser With Tabs Pin
Pedram Behroozi2-Nov-08 5:16
Pedram Behroozi2-Nov-08 5:16 
QuestionHelp With dataGridView Copy and Paste Feature Pin
That Asian Guy1-Nov-08 9:02
That Asian Guy1-Nov-08 9:02 
I recently made a program for organizing marks and realized that it is slow and repetitive to type the same teacher's name 20 times for students in the same class.

I chose to add a little copy and paste feature when the user presses ctrl+v and the active cell becomes the contents of the clipboard.

Here is the snippet:
else if (e.Control && e.KeyCode == Keys.V)
            {
                if (Clipboard.ContainsText() & dataGridView1.CurrentCell.OwningColumn.Index == 4)
                {
                    dataGridView1.CurrentCell.Value = Clipboard.GetText();
                }

                // If its the last row, add another row
                if (dataGridView1.CurrentCell.OwningRow.Index == nUD_counter)
                {
                    dataGridView1.Rows.Add();
                }
            }


What I'm having problems with is the last part, where I add another row (Microsoft made it so it would automatically add a row if the cell is edited by the user, but not programatically. The problem is that when I add the new row, it places it above the row which I just pasted info into such that:

col1       col2
a          b
<-blank line where I press ctrl+v->

It becomes
col1       col2
a          b
<-blank line where I press ctrl+v->
hi


How can I fix this? Also feel free to make suggestions on my code.

Thanks in advance.

modified on Saturday, November 1, 2008 5:23 PM

GeneralRe: Help With dataGridView Copy and Paste Feature Pin
That Asian Guy1-Nov-08 14:47
That Asian Guy1-Nov-08 14:47 
QuestionGenerate ordered sequence of 11 numbers Pin
J-Cod3r1-Nov-08 7:57
J-Cod3r1-Nov-08 7:57 
GeneralRe: Generate ordered sequence of 11 numbers Pin
Luc Pattyn1-Nov-08 8:40
sitebuilderLuc Pattyn1-Nov-08 8:40 
Questiondatatable and datareader Pin
Zeyad Jalil1-Nov-08 6:58
professionalZeyad Jalil1-Nov-08 6:58 
QuestionHow can we create a plugin for IE with C# ? Pin
Mohammad Dayyan1-Nov-08 5:32
Mohammad Dayyan1-Nov-08 5:32 
AnswerRe: How can we create a plugin for IE with C# ? Pin
Pedram Behroozi1-Nov-08 6:21
Pedram Behroozi1-Nov-08 6:21 
QuestionSplitting a MP3 file ? Pin
Mohammad Dayyan1-Nov-08 4:53
Mohammad Dayyan1-Nov-08 4:53 
AnswerRe: Splitting a MP3 file ? Pin
DaveyM691-Nov-08 5:06
professionalDaveyM691-Nov-08 5:06 
AnswerRe: Splitting a MP3 file ? Pin
Guffa1-Nov-08 5:59
Guffa1-Nov-08 5:59 
GeneralRe: Splitting a MP3 file ? Pin
Mohammad Dayyan1-Nov-08 6:05
Mohammad Dayyan1-Nov-08 6:05 
GeneralRe: Splitting a MP3 file ? Pin
DavidNohejl1-Nov-08 13:03
DavidNohejl1-Nov-08 13:03 
QuestionHow i CReate Ajax Control Pin
IshtiaqueJ1-Nov-08 4:18
IshtiaqueJ1-Nov-08 4:18 
AnswerRe: How i CReate Ajax Control Pin
Pedram Behroozi1-Nov-08 6:56
Pedram Behroozi1-Nov-08 6:56 
QuestionHow to insert text in RichTextBox where the mouse pointer is? Pin
Mathias Hoppe1-Nov-08 4:12
Mathias Hoppe1-Nov-08 4:12 
AnswerRe: How to insert text in RichTextBox where the mouse pointer is? Pin
Dave Kreskowiak1-Nov-08 14:26
mveDave Kreskowiak1-Nov-08 14:26 
QuestionPeachtree And C# Pin
Syed Shahid Hussain1-Nov-08 3:11
Syed Shahid Hussain1-Nov-08 3:11 
AnswerRe: Peachtree And C# Pin
DaveyM691-Nov-08 3:28
professionalDaveyM691-Nov-08 3:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.