Click here to Skip to main content
15,908,445 members
Home / Discussions / C#
   

C#

 
Questionsort datagridview Pin
jashimu2-Feb-10 5:45
jashimu2-Feb-10 5:45 
Hi all, I have two questions .
1. How do I copy one datagridview to another.
2. how do I sort a specefic column. for example I have
col A, colB, colC. I want to sort colB only when data is loaded.
for copying or loading from one grid to another I have done something like this
and it is working but not sure it is a right thing to do or not.
for (int j = 0; j < dataGridView1.Rows.Count; j++)<br />
                {<br />
                        dataGridView2.Rows.Add();// adding row before inserting data in it<br />
                        for (int i = 0; i < 5; i++)<br />
                        {<br />
                          dataGridView2.Rows[j].Cells[i].Value = dataGridView1.Rows[j].Cells[i].Value;<br />
                         }<br />
                }<br />


thanks in advance
QuestionRemove all characters in a string up to and including a specified pattern Pin
MarkB1232-Feb-10 5:27
MarkB1232-Feb-10 5:27 
AnswerRe: Remove all characters in a string up to and including a specified pattern Pin
PIEBALDconsult2-Feb-10 5:31
mvePIEBALDconsult2-Feb-10 5:31 
AnswerRe: Remove all characters in a string up to and including a specified pattern Pin
sanforjackass2-Feb-10 5:33
sanforjackass2-Feb-10 5:33 
GeneralRe: Remove all characters in a string up to and including a specified pattern Pin
OriginalGriff2-Feb-10 5:42
mveOriginalGriff2-Feb-10 5:42 
AnswerRe: Remove all characters in a string up to and including a specified pattern Pin
OkkiePepernoot2-Feb-10 6:01
OkkiePepernoot2-Feb-10 6:01 
GeneralRe: Remove all characters in a string up to and including a specified pattern Pin
MarkB1232-Feb-10 8:28
MarkB1232-Feb-10 8:28 
AnswerRe: Remove all characters in a string up to and including a specified pattern Pin
Ramkithepower3-Feb-10 1:38
Ramkithepower3-Feb-10 1:38 
GeneralRe: Remove all characters in a string up to and including a specified pattern Pin
MarkB1233-Feb-10 11:37
MarkB1233-Feb-10 11:37 
Questionzooming/panning Pin
sarai002-Feb-10 5:24
sarai002-Feb-10 5:24 
QuestionC# Create Excelfile Pin
Mschauder2-Feb-10 3:26
Mschauder2-Feb-10 3:26 
AnswerRe: C# Create Excelfile Pin
The Man from U.N.C.L.E.2-Feb-10 3:40
The Man from U.N.C.L.E.2-Feb-10 3:40 
QuestionGmail Samples Pin
Anil Kumar.Arvapalli2-Feb-10 3:17
Anil Kumar.Arvapalli2-Feb-10 3:17 
AnswerRe: Gmail Samples Pin
WoutL2-Feb-10 3:23
WoutL2-Feb-10 3:23 
AnswerRe: Gmail Samples Pin
Abhinav S2-Feb-10 3:44
Abhinav S2-Feb-10 3:44 
QuestionTrouble with drawing on winfrom in new thread Pin
Frozzeg2-Feb-10 2:45
Frozzeg2-Feb-10 2:45 
AnswerRe: Trouble with drawing on winfrom in new thread Pin
Luc Pattyn2-Feb-10 3:29
sitebuilderLuc Pattyn2-Feb-10 3:29 
AnswerRe: Trouble with drawing on winfrom in new thread Pin
The Man from U.N.C.L.E.2-Feb-10 3:52
The Man from U.N.C.L.E.2-Feb-10 3:52 
GeneralRe: Trouble with drawing on winfrom in new thread Pin
Frozzeg2-Feb-10 8:00
Frozzeg2-Feb-10 8:00 
GeneralRe: Trouble with drawing on winfrom in new thread Pin
Dave Kreskowiak2-Feb-10 8:53
mveDave Kreskowiak2-Feb-10 8:53 
QuestionComboBox index Databind Pin
Kaikus2-Feb-10 2:22
Kaikus2-Feb-10 2:22 
AnswerRe: ComboBox index Databind Pin
The Man from U.N.C.L.E.2-Feb-10 4:01
The Man from U.N.C.L.E.2-Feb-10 4:01 
Question.NET applications? Pin
ppayal2-Feb-10 0:12
ppayal2-Feb-10 0:12 
AnswerRe: .NET applications? Pin
OriginalGriff2-Feb-10 0:19
mveOriginalGriff2-Feb-10 0:19 
AnswerRe: .NET applications? Pin
Keith Barrow2-Feb-10 0:19
professionalKeith Barrow2-Feb-10 0:19 

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.