Click here to Skip to main content
15,888,461 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionCreating zip files limited to size Pin
ctrl+s1-Jul-14 7:38
ctrl+s1-Jul-14 7:38 
AnswerRe: Creating zip files limited to size Pin
Dave Kreskowiak1-Jul-14 12:18
mveDave Kreskowiak1-Jul-14 12:18 
AnswerRe: Creating zip files limited to size Pin
Richard Deeming2-Jul-14 1:30
mveRichard Deeming2-Jul-14 1:30 
Questionform1 as background of form2 in vb.net Pin
khei-chan00729-Jun-14 21:03
khei-chan00729-Jun-14 21:03 
AnswerRe: form1 as background of form2 in vb.net Pin
Dave Kreskowiak30-Jun-14 1:54
mveDave Kreskowiak30-Jun-14 1:54 
QuestionReport Viewer in Code Behind Pin
jkirkerx29-Jun-14 10:19
professionaljkirkerx29-Jun-14 10:19 
GeneralI was able to populate the tablix with static data Pin
jkirkerx29-Jun-14 11:19
professionaljkirkerx29-Jun-14 11:19 
QuestionDATAGRIDVIEW ARRAY QUESTION VB.NET 2012 Pin
AntonyJackson26-Jun-14 0:04
AntonyJackson26-Jun-14 0:04 
Hi There, i created a calendar with 37 datagridviews on a form, i've put all my datagridviews in to an array collection

SQL
Public AllDatagrids As DataGridView() = {DGDays1, DGDays2, DGDays3, DGDays4, DGDays5, DGDays6, DGDays7, DGDays8, _
                                         DGDays9, DGDays10, DGDays11, DGDays12, DGDays13, DGDays14, DGDays15, DGDays16, _
                                         DGDays17, DGDays18, DGDays19, DGDays20, DGDays21, DGDays22, DGDays23, DGDays24, _
                                         DGDays25, DGDays26, DGDays27, DGDays28, DGDays29, DGDays30, DGDays31, DGDays32, _
                                         DGDays33, DGDays34, DGDays35, DGDays36, DGDays37}


which makes it easier to control which datagridviews are visible or not depending on the user selection on the month they select from a combo box.

Now when a user clicks on a row in any datagridview it opens up another form and displays additional information in a breakdown sort of way.

All my code is working fine except that it is way too long and i would like to shorten it, because i have now got duplicated code in my project.

Each datagridview has a double click event so i have 37 of these

XML
Private Sub DGDays1_CellContentDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DGDays1.CellContentDoubleClick
        With DGDays1
            If .SelectedRows.Count <> 0 Then
                Dim row As DataGridViewRow = .SelectedRows(0)
                GetdataAndFillDetailsForm(row.Cells(3).Value, row.Cells(5).Value)
            End If
        End With
End Sub


i have created an event handler to manage the double click event of all the datagridviews which resides in my main form load event

VB
For Each DataGridView In Modall.AllDatagrids
            AddHandler DataGridView.CellContentDoubleClick, AddressOf DGArrayClick
Next


Which in turn after the user double clicks a cell on any of the datagridview it runs this code

VB
Private Sub DGArrayClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs)

End Sub


so i've been trying to figure out how to get a value of the row selection from the double click event of the datagrid and i have a code block

i want to try and run something like this inside my DGArrayClick sub

VB
GetdataAndFillDetailsForm(row.Cells(3).Value, row.Cells(5).Value)


is it possible and if so, could anyone give me a direction on how to go about it please?
Questionvb.net drop down list insidelist view Pin
walsh2725-Jun-14 0:17
walsh2725-Jun-14 0:17 
Questionsybase ASE 15.7 with VB.Net framework 1.1 connection error Pin
ashishj01624-Jun-14 19:30
ashishj01624-Jun-14 19:30 
AnswerRe: sybase ASE 15.7 with VB.Net framework 1.1 connection error Pin
Dave Kreskowiak25-Jun-14 2:47
mveDave Kreskowiak25-Jun-14 2:47 
QuestionNeed to find html tags in strings Pin
Amir Tallap22-Jun-14 16:49
Amir Tallap22-Jun-14 16:49 
AnswerRe: Need to find html tags in strings Pin
thatraja22-Jun-14 22:10
professionalthatraja22-Jun-14 22:10 
QuestionError Trying to connect to a database after restoring Pin
dilkonika22-Jun-14 11:17
dilkonika22-Jun-14 11:17 
AnswerRe: Error Trying to connect to a database after restoring Pin
Eddy Vluggen23-Jun-14 7:12
professionalEddy Vluggen23-Jun-14 7:12 
GeneralRe: Error Trying to connect to a database after restoring Pin
dilkonika23-Jun-14 8:24
dilkonika23-Jun-14 8:24 
GeneralRe: Error Trying to connect to a database after restoring Pin
Eddy Vluggen25-Jun-14 8:15
professionalEddy Vluggen25-Jun-14 8:15 
QuestionWhy does this Array.FindIndex for case insensitive return 2 not 0 Pin
QuickBooksDev21-Jun-14 4:15
QuickBooksDev21-Jun-14 4:15 
AnswerRe: Why does this Array.FindIndex for case insensitive return 2 not 0 Pin
Dave Kreskowiak21-Jun-14 5:38
mveDave Kreskowiak21-Jun-14 5:38 
GeneralRe: Why does this Array.FindIndex for case insensitive return 2 not 0 Pin
QuickBooksDev22-Jun-14 1:14
QuickBooksDev22-Jun-14 1:14 
GeneralRe: Why does this Array.FindIndex for case insensitive return 2 not 0 Pin
Dave Kreskowiak22-Jun-14 5:18
mveDave Kreskowiak22-Jun-14 5:18 
SuggestionRe: Why does this Array.FindIndex for case insensitive return 2 not 0 Pin
Richard Deeming23-Jun-14 2:16
mveRichard Deeming23-Jun-14 2:16 
GeneralRe: Why does this Array.FindIndex for case insensitive return 2 not 0 Pin
Dave Kreskowiak23-Jun-14 2:42
mveDave Kreskowiak23-Jun-14 2:42 
GeneralRe: Why does this Array.FindIndex for case insensitive return 2 not 0 Pin
Richard Deeming23-Jun-14 11:09
mveRichard Deeming23-Jun-14 11:09 
GeneralRe: Why does this Array.FindIndex for case insensitive return 2 not 0 Pin
Dave Kreskowiak23-Jun-14 11:16
mveDave Kreskowiak23-Jun-14 11:16 

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.