Click here to Skip to main content
15,907,687 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionCannot Drag and drop reportviewer control in visual studio 2010 Pin
waner michaud26-Jun-13 9:25
waner michaud26-Jun-13 9:25 
QuestionRe: Cannot Drag and drop reportviewer control in visual studio 2010 Pin
TnTinMn26-Jun-13 15:44
TnTinMn26-Jun-13 15:44 
AnswerRe: Cannot Drag and drop reportviewer control in visual studio 2010 Pin
waner michaud27-Jun-13 5:06
waner michaud27-Jun-13 5:06 
GeneralRe: Cannot Drag and drop reportviewer control in visual studio 2010 Pin
TnTinMn27-Jun-13 10:33
TnTinMn27-Jun-13 10:33 
GeneralRe: Cannot Drag and drop reportviewer control in visual studio 2010 Pin
waner michaud28-Jun-13 2:50
waner michaud28-Jun-13 2:50 
GeneralRe: Cannot Drag and drop reportviewer control in visual studio 2010 Pin
waner michaud1-Jul-13 6:11
waner michaud1-Jul-13 6:11 
QuestionFile Downloader Help Pin
Bradley Sweeten26-Jun-13 4:04
Bradley Sweeten26-Jun-13 4:04 
QuestionCompare two datagridviews Pin
goku9925-Jun-13 11:03
goku9925-Jun-13 11:03 
Hi! I want to compare two datagridviews, in order to have a list of items that are common in both datagridviews, and a List of non matched itens, based on the values of an specific column - column(1) - which is found in both dgv. Also, these lists would be consolidated by the values from a column - column(2) - from the second datagridview.

An example to illustrate:

Datagridview1 Datagridview2

idProduct Item IdProduct Item IdSupplier
1 Item A 1 Item A 1
1 Item B 1 Item B 1
2 Item C 2 Item C 1
1 Item A 2
1 Item B 2

So, my desired results for the matched items would be:
IdSupplier 1 () = {Item A, Item B, Item C}; non-mathced items () = {""};
IdSupplier 2() = {Item A, Item B}; non-mathed items () = {Item C};

What I've made is a loop that filters the second datagridview, through the values from the third column, and added items that are corresponding to the first datagridview column(1) by another loop through datagridviews (Cells or Rows) and using IF statements. However, I end with a "big" list that adds all the elements, because I still do not know how to consolidate this list for each element of the third column of datagridview2.

So, from the example above, my results would be:
{Item A, Item B, Item C, Item A, Item B}

I also have tried LinQ by the following code:

VB
For Each row As DataGridViewRow In dgv1.Rows
If Not row.IsNewRow Then
Dim row1 = row
Dim myTableSummary = (From myRow As DataGridViewRow In dgv2.Rows.Cast(Of DataGridViewRow)() Where Not myRow.IsNewRow AndAlso myRow.Cells(1).Value.ToString.Equals(row1.Cells(1).Value.ToString) Select ID1 = myRow.Cells(3).Value, _
ItemValue = myRow.Cells(1).Value Group By ID1 Into G = Group, match = Count())
Dim myArrayOfAnonymousTypes() = myTableSummary.ToArray
'Array.Sort(myArrayOfAnonymousTypes)

For Each myElement In myArrayOfAnonymousTypes
MsgBox(myElement.ID1.ToString & " - " & myElement.match.ToString)

Next

End If
Next 


modified 26-Jun-13 0:37am.

QuestionOpen CVS file in text Pin
Ashok Kumar997824-Jun-13 22:09
Ashok Kumar997824-Jun-13 22:09 
AnswerRe: Open CVS file in text Pin
Richard MacCutchan24-Jun-13 22:38
mveRichard MacCutchan24-Jun-13 22:38 
AnswerRe: Open CVS file in text Pin
MaulikDusara26-Jun-13 8:55
MaulikDusara26-Jun-13 8:55 
QuestionClick a main thread button from a background thread Pin
treddie24-Jun-13 20:41
treddie24-Jun-13 20:41 
AnswerRe: Click a main thread button from a background thread Pin
Bernhard Hiller24-Jun-13 22:21
Bernhard Hiller24-Jun-13 22:21 
GeneralRe: Click a main thread button from a background thread Pin
treddie24-Jun-13 23:24
treddie24-Jun-13 23:24 
AnswerRe: Click a main thread button from a background thread Pin
GuyThiebaut24-Jun-13 22:43
professionalGuyThiebaut24-Jun-13 22:43 
GeneralRe: Click a main thread button from a background thread Pin
treddie24-Jun-13 23:47
treddie24-Jun-13 23:47 
GeneralRe: Click a main thread button from a background thread Pin
treddie25-Jun-13 19:40
treddie25-Jun-13 19:40 
QuestionVB6 DataGrid Bookmark Error Pin
Member 981947024-Jun-13 10:27
Member 981947024-Jun-13 10:27 
AnswerRe: VB6 DataGrid Bookmark Error Pin
Eddy Vluggen25-Jun-13 9:59
professionalEddy Vluggen25-Jun-13 9:59 
AnswerHow to detect UTF-8-based encoded strings Pin
diegosendra24-Jun-13 9:33
diegosendra24-Jun-13 9:33 
SuggestionRe: How to detect UTF-8-based encoded strings Pin
Richard Deeming24-Jun-13 9:51
mveRichard Deeming24-Jun-13 9:51 
GeneralRe: How to detect UTF-8-based encoded strings Pin
diegosendra24-Jun-13 10:30
diegosendra24-Jun-13 10:30 
GeneralRe: How to detect UTF-8-based encoded strings Pin
Roy Heil24-Jun-13 11:08
professionalRoy Heil24-Jun-13 11:08 
GeneralRe: How to detect UTF-8-based encoded strings Pin
diegosendra24-Jun-13 11:15
diegosendra24-Jun-13 11:15 
GeneralRe: How to detect UTF-8-based encoded strings Pin
Richard MacCutchan24-Jun-13 20:33
mveRichard MacCutchan24-Jun-13 20:33 

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.