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

Visual Basic

 
QuestionDatabinding slow [modified] Pin
Gr1mR33p3r18-Feb-08 19:44
Gr1mR33p3r18-Feb-08 19:44 
GeneralRe: Databinding slow Pin
Dave Kreskowiak19-Feb-08 3:45
mveDave Kreskowiak19-Feb-08 3:45 
Generalload controls in a tab control at runtime Pin
AAGTHosting18-Feb-08 11:39
AAGTHosting18-Feb-08 11:39 
GeneralRe: load controls in a tab control at runtime Pin
Christian Graus18-Feb-08 15:44
protectorChristian Graus18-Feb-08 15:44 
GeneralRe: load controls in a tab control at runtime Pin
AAGTHosting18-Feb-08 17:37
AAGTHosting18-Feb-08 17:37 
GeneralRe: load controls in a tab control at runtime Pin
Christian Graus18-Feb-08 17:38
protectorChristian Graus18-Feb-08 17:38 
GeneralTrouble with ChangeStartMode in InvokeMethod Pin
Matthew Calabresi18-Feb-08 9:24
Matthew Calabresi18-Feb-08 9:24 
GeneralNested DataGridView Problem Pin
ccotton33318-Feb-08 8:17
ccotton33318-Feb-08 8:17 
Hey Guys,

I found an article that helped me nest a datagridview within a datagridview; however, the nested datagridview doesn't scroll. I was wondering if someone could tell me what I'm missing. Here is my code, which works great when the datacolumn is frozen.

Dim dt As New DataTable
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim sql As String = "SELECT distinct upc,sku,style,class_id,department,vendor FROM items a"
Dim adapter As New Odbc.OdbcDataAdapter(sql, New Odbc.OdbcConnection("DSN=tdprod;uid=ccotton;pwd=ccotton"))
If Not dt.Columns.Contains("upc") Then dt.Columns.Add("upc")
If Not dt.Columns.Contains("sku") Then dt.Columns.Add("sku")
If Not dt.Columns.Contains("style") Then dt.Columns.Add("style")
If Not dt.Columns.Contains("class_id") Then dt.Columns.Add("class_id")
If Not dt.Columns.Contains("department") Then dt.Columns.Add("department")
If Not dt.Columns.Contains("vendor") Then dt.Columns.Add("vendor")
adapter.Fill(dt)
DataGridView1.DataSource = dt
DataGridView1.Columns("upc").Frozen = True
DataGridView1.Columns("sku").Frozen = True
DataGridView1.Columns("style").Frozen = True
DataGridView1.ReadOnly = True
End Sub
Private Sub DataGridView1_CellPainting(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellPaintingEventArgs) Handles DataGridView1.CellPainting
If e.RowIndex >= 0 Then
If e.ColumnIndex >= 0 Then
If e.ColumnIndex = 2 Then
Dim list As New DataGridView
list.ReadOnly = True
Dim helpdt As New DataTable
helpdt.Columns.Add("Num")
For i As Integer = 0 To 8
Dim sub_row As DataRow = helpdt.NewRow
sub_row.Item("Num") = i + 1
helpdt.Rows.Add(sub_row)
Next
list.DataSource = helpdt
DataGridView1.Rows(e.RowIndex).Height = 100
DataGridView1.Columns(e.ColumnIndex).Width = 200
list.Width = 200
list.Height = 100
DataGridView1.Controls.Add(list)
Dim rect As Rectangle = DataGridView1.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, False)
list.Location = rect.Location
End If
End If
End If
End Sub

Any help would be greatly appreciated.

Thanks.
Questioncall DB2 stored procedure? Pin
jchigg200018-Feb-08 4:33
jchigg200018-Feb-08 4:33 
QuestionIntegrating flash 8 to VB.NET Pin
rcryptified18-Feb-08 4:29
rcryptified18-Feb-08 4:29 
GeneralRe: Integrating flash 8 to VB.NET Pin
Dave Kreskowiak19-Feb-08 3:29
mveDave Kreskowiak19-Feb-08 3:29 
Questionhow do you create a primary key through code in vb.net Pin
imonfiredammit18-Feb-08 4:26
imonfiredammit18-Feb-08 4:26 
AnswerRe: how do you create a primary key through code in vb.net Pin
cstrader23218-Feb-08 5:26
cstrader23218-Feb-08 5:26 
GeneralRe: how do you create a primary key through code in vb.net Pin
imonfiredammit18-Feb-08 7:33
imonfiredammit18-Feb-08 7:33 
AnswerRe: how do you create a primary key through code in vb.net Pin
Dave Kreskowiak19-Feb-08 3:24
mveDave Kreskowiak19-Feb-08 3:24 
QuestionHow to extract the list of exe paths of all installed programs(WIN XP) Pin
Gjm18-Feb-08 3:27
Gjm18-Feb-08 3:27 
GeneralRe: How to extract the list of exe paths of all installed programs(WIN XP) Pin
Dave Kreskowiak19-Feb-08 3:19
mveDave Kreskowiak19-Feb-08 3:19 
Generalrandom numbers Pin
bapu288918-Feb-08 3:19
bapu288918-Feb-08 3:19 
GeneralRe: random numbers Pin
CKnig18-Feb-08 3:58
CKnig18-Feb-08 3:58 
GeneralRe: random numbers Pin
bapu288918-Feb-08 4:53
bapu288918-Feb-08 4:53 
GeneralRe: random numbers Pin
Guffa18-Feb-08 9:41
Guffa18-Feb-08 9:41 
GeneralRe: random numbers Pin
bapu288919-Feb-08 7:08
bapu288919-Feb-08 7:08 
GeneralRe: random numbers Pin
Guffa19-Feb-08 9:52
Guffa19-Feb-08 9:52 
GeneralRe: random numbers Pin
bapu288920-Feb-08 8:26
bapu288920-Feb-08 8:26 
GeneralUpgrade issue : Constructor call is valid only as the first statement Pin
sarat18-Feb-08 2:45
sarat18-Feb-08 2:45 

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.