Click here to Skip to main content
15,917,862 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: newbie question on updating Access mdb tables Pin
AnnieMacD17-Jun-10 11:26
AnnieMacD17-Jun-10 11:26 
QuestionAdd Combobox to Datagridview at runtime. Pin
Nielvh17-Jun-10 4:35
Nielvh17-Jun-10 4:35 
Hi All,
I am trying to add a dropdown to a column in a datagridview. Below is the code I use to populate the Datagridview.
Can I just add something to this to make 2nd and 3rd column have a dropdown or do I need to take a completely different aproach to achieve this.
The data for the dropdown will be the same for each row and will be extracted from an existing table.

Any help would be greatly appreciated.

I am using VS2005.

Private Sub FillBinDataGrid()
        Dim SqlBin As String = _
                    "SELECT zz_ST_Binsheets.iStockLink, zz_ST_Binsheets.iBinSheetLine, " _
                    & "StkItem.Code, StkItem.Description_1, " _
                    & "zz_ST_Binsheets.iPacksize, zz_ST_Binsheets.fQuantity " _
                    & "FROM zz_ST_Binsheets LEFT JOIN " _
                    & "StkItem ON zz_ST_Binsheets.iStockLink = StkItem.StockLink " _
                    & "WHERE zz_ST_Binsheets.iBinSheetNr = @binnr "
        Dim Sqlparam As SqlClient.SqlParameter
        Sqlparam = New SqlClient.SqlParameter("@binnr", SqlDbType.Int)
        Sqlparam.Value = BsBinNrTextbox.Text

        Dim Conn As New SqlConnection(CntString)
        Conn.Open()
        Dim MyCommand As New SqlCommand(SqlBin, Conn)
        MyCommand.Parameters.Add(Sqlparam)
        Dim adapter As New SqlDataAdapter(MyCommand)
        Dim dtset As New DataSet
        adapter.Fill(dtset)
        adapter.Dispose()
        Conn.Close()
        Dim table As DataTable = dtset.Tables(0)
        With Me.BsDataGridView
            .DataSource = table
            .AutoResizeColumns()
            .Columns(0).Visible = False
        End With
    
    End Sub

AnswerRe: Add Combobox to Datagridview at runtime. Pin
dan!sh 17-Jun-10 5:43
professional dan!sh 17-Jun-10 5:43 
GeneralRe: Add Combobox to Datagridview at runtime. Pin
Nielvh18-Jun-10 11:18
Nielvh18-Jun-10 11:18 
QuestionPassing Events Pin
Sonhospa17-Jun-10 3:11
Sonhospa17-Jun-10 3:11 
AnswerRe: Passing Events Pin
EliottA17-Jun-10 3:49
EliottA17-Jun-10 3:49 
NewsRe: Passing Events Pin
Sonhospa17-Jun-10 5:03
Sonhospa17-Jun-10 5:03 
QuestionRe: Passing Events Pin
DaveAuld17-Jun-10 3:58
professionalDaveAuld17-Jun-10 3:58 
NewsRe: Passing Events Pin
Sonhospa17-Jun-10 5:17
Sonhospa17-Jun-10 5:17 
GeneralRe: Passing Events Pin
DaveAuld17-Jun-10 5:53
professionalDaveAuld17-Jun-10 5:53 
GeneralRe: Passing Events Pin
Sonhospa17-Jun-10 6:17
Sonhospa17-Jun-10 6:17 
NewsResolved: Passing Events Pin
Sonhospa17-Jun-10 7:33
Sonhospa17-Jun-10 7:33 
GeneralRe: Resolved: Passing Events Pin
DaveAuld17-Jun-10 7:43
professionalDaveAuld17-Jun-10 7:43 
QuestionVisStudio 2005 (VB) to VS 2008/2010 migration errors exit function without message Pin
QuickBooksDev17-Jun-10 1:56
QuickBooksDev17-Jun-10 1:56 
AnswerRe: VisStudio 2005 (VB) to VS 2008/2010 migration errors exit function without message Pin
Luc Pattyn17-Jun-10 2:19
sitebuilderLuc Pattyn17-Jun-10 2:19 
GeneralRe: VisStudio 2005 (VB) to VS 2008/2010 migration errors exit function without message Pin
QuickBooksDev19-Jun-10 2:14
QuickBooksDev19-Jun-10 2:14 
AnswerRe: VisStudio 2005 (VB) to VS 2008/2010 migration errors exit function without message Pin
AnnieMacD17-Jun-10 2:46
AnnieMacD17-Jun-10 2:46 
GeneralRe: VisStudio 2005 (VB) to VS 2008/2010 migration errors exit function without message Pin
QuickBooksDev19-Jun-10 2:11
QuickBooksDev19-Jun-10 2:11 
GeneralRe: VisStudio 2005 (VB) to VS 2008/2010 migration errors exit function without message Pin
AnnieMacD19-Jun-10 2:35
AnnieMacD19-Jun-10 2:35 
GeneralRe: VisStudio 2005 (VB) to VS 2008/2010 migration errors exit function without message Pin
QuickBooksDev21-Jun-10 6:47
QuickBooksDev21-Jun-10 6:47 
GeneralRe: HELP!!! There must be a setting or something. VisStudio 2005 (VB) to VS 2008/2010 migration errors exit function without message Pin
QuickBooksDev23-Jun-10 5:19
QuickBooksDev23-Jun-10 5:19 
Questionchanging monitor screen resolution Pin
phowarso16-Jun-10 21:08
phowarso16-Jun-10 21:08 
AnswerRe: changing monitor screen resolution Pin
Dave Kreskowiak17-Jun-10 1:38
mveDave Kreskowiak17-Jun-10 1:38 
QuestionHow do I connect vb 2005 and Access 2007 in published application [modified] Pin
cyberexel16-Jun-10 12:14
cyberexel16-Jun-10 12:14 
AnswerRe: How do I connect vb 2005 and Access 2007 in published application Pin
Dave Kreskowiak17-Jun-10 1:36
mveDave Kreskowiak17-Jun-10 1:36 

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.