Click here to Skip to main content
15,902,447 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionWHAT IS THE EQUIVALENT OF THIS CODE IN VB.NET Pin
klaydze22-Apr-07 19:54
klaydze22-Apr-07 19:54 
AnswerRe: WHAT IS THE EQUIVALENT OF THIS CODE IN VB.NET Pin
MatrixCoder22-Apr-07 20:11
MatrixCoder22-Apr-07 20:11 
QuestionHelp with service and logged in user Pin
dBrong22-Apr-07 18:35
dBrong22-Apr-07 18:35 
AnswerRe: Help with service and logged in user Pin
coolestCoder22-Apr-07 19:17
coolestCoder22-Apr-07 19:17 
AnswerRe: Help with service and logged in user Pin
Dave Kreskowiak23-Apr-07 4:13
mveDave Kreskowiak23-Apr-07 4:13 
QuestionDATAGRID OF VB.NET 2003 AND 2005 Pin
klaydze22-Apr-07 16:04
klaydze22-Apr-07 16:04 
AnswerRe: DATAGRID OF VB.NET 2003 AND 2005 Pin
Dave Kreskowiak23-Apr-07 7:35
mveDave Kreskowiak23-Apr-07 7:35 
GeneralRe: DATAGRID OF VB.NET 2003 AND 2005 Pin
Hansduncan23-Apr-07 10:18
Hansduncan23-Apr-07 10:18 
Along those lines, could you help me out with this code that isn't working the way I want it to.

I am trying to insert new row(s) into a datagridview called "CustSalesOpportunityLineDataGridView" (that is databound to a table called "custsalesopportunityline" in a master-detail form that contains includes the header info as well).

I have also created a generic product selection form that contains a datagridview called "ArticleDataGridView" that displays all the info and contains the filters that users need to efficiently search and filter out products. The dataset for the "ArticleDataGridView" is based on a view that I have created in the database.

On the "ArticleDataGridView" I have created a column called "Select_Article" that is a DataGridViewCheckBoxColumn. (false value = 0, indeterminate = 0, true =1). If the users want to add a particular product to the SalesOpportunityLine datagridview they should be able to check the checkbox for each desired row and then click the AddAndContinueButton. The Select_Article checkbox column is the leftmost column of the datagridview.

For each product that they have selected in the articledatagridview a new row in the "CustSalesOpportunityLineDataGridView" should be created and displayed as well as the articleID, name and Salesopportunityheaderid.

Where am I going wrong with the code below? Based on the error messages I am getting I don't think it is reading from the correct column.

Private Sub AddAndContinueButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddAndContinueButton.Click<br />
<br />
        For Each dgvRow As DataGridViewRow In Me.ArticleDataGridView.SelectedRows<br />
            If Me.ArticleDataGridView.Item(ArticleDataGridView.CurrentRow.Index, 1).Value = 1 Then<br />
                Dim dt As DataTable = Me.SalesOpportunity.Tables("custsalesopportunityline")<br />
                Dim dtRow As DataRow = dt.NewRow()<br />
                dtRow("Salesopportunityheaderid") = NewSalesOpportunity.SalesoppHeaderID<br />
                dtRow("articleid") = dgvRow.Cells("ArticleIdDataGridViewTextBoxColumn").Value<br />
                dtRow("work_articlename") = dgvRow.Cells("ProduktnavnDataGridViewTextBoxColumn").Value<br />
                dt.Rows.Add(dtRow)<br />
<br />
            End If<br />
        Next<br />
<br />
    End Sub

GeneralRe: DATAGRID OF VB.NET 2003 AND 2005 Pin
klaydze23-Apr-07 18:53
klaydze23-Apr-07 18:53 
Questionusercontrol move messages Pin
lee2322-Apr-07 16:04
lee2322-Apr-07 16:04 
AnswerRe: usercontrol move messages Pin
Dave Kreskowiak23-Apr-07 4:01
mveDave Kreskowiak23-Apr-07 4:01 
QuestionCalendar control dates Pin
Spontrel22-Apr-07 14:43
Spontrel22-Apr-07 14:43 
AnswerRe: Calendar control dates Pin
kubben22-Apr-07 15:02
kubben22-Apr-07 15:02 
GeneralRe: Calendar control dates Pin
Spontrel22-Apr-07 15:34
Spontrel22-Apr-07 15:34 
QuestionNeeds to show database information in listbox via SELECT statement over more tables Pin
keninfo22-Apr-07 9:55
keninfo22-Apr-07 9:55 
AnswerRe: Needs to show database information in listbox via SELECT statement over more tables Pin
Dave Kreskowiak23-Apr-07 7:27
mveDave Kreskowiak23-Apr-07 7:27 
QuestionRead MS Access Table to Text file Pin
IvanIT22-Apr-07 7:19
IvanIT22-Apr-07 7:19 
AnswerRe: Read MS Access Table to Text file Pin
_mubashir22-Apr-07 9:16
_mubashir22-Apr-07 9:16 
GeneralRe: Read MS Access Table to Text file Pin
IvanIT23-Apr-07 6:35
IvanIT23-Apr-07 6:35 
GeneralRe: Read MS Access Table to Text file Pin
Dave Kreskowiak23-Apr-07 6:55
mveDave Kreskowiak23-Apr-07 6:55 
GeneralRe: Read MS Access Table to Text file Pin
IvanIT23-Apr-07 14:56
IvanIT23-Apr-07 14:56 
QuestionMinimize form Pin
eagertolearn22-Apr-07 7:17
eagertolearn22-Apr-07 7:17 
AnswerRe: Minimize form Pin
kubben22-Apr-07 9:06
kubben22-Apr-07 9:06 
GeneralRe: Minimize form Pin
eagertolearn23-Apr-07 6:03
eagertolearn23-Apr-07 6:03 
QuestionHow To compare data in array A and array B Pin
somchoto22-Apr-07 2:43
somchoto22-Apr-07 2:43 

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.