|
-
Jan 6th, 2008, 02:59 AM
#1
Thread Starter
Member
mshflexgrid1 row to mshflexgrid2 row or listview row
first i will populate mshflexgrid1 , what im trying to do is when i click a row in mshflexgrid1 , the same row will be highlighed in flexgrid2 and listview . thx
-
Jan 6th, 2008, 04:25 AM
#2
Re: mshflexgrid1 row to mshflexgrid2 row or listview row
Use the RowSel property of the flexgrid.
Code:
Option Explicit
Private Sub MSFlexGrid1_SelChange()
If MSFlexGrid1.RowSel > 0 Then
'Select your corresponding row in your other control using the .RowSel value
End If
End Sub
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 6th, 2008, 05:10 AM
#3
Thread Starter
Member
Re: mshflexgrid1 row to mshflexgrid2 row or listview row
when will the MSFlexGrid1_SelChange occur? do u have sample program,? thx
Last edited by mamba; Jan 6th, 2008 at 05:30 AM.
-
Jan 6th, 2008, 06:05 AM
#4
Re: mshflexgrid1 row to mshflexgrid2 row or listview row
It will fire when something that has been selected changes.
-
Jan 6th, 2008, 02:37 PM
#5
Re: mshflexgrid1 row to mshflexgrid2 row or listview row
I posted "sample code" for you. When you make a selection the "MSFlexGrid1_SelChange" event will fire which is where you can write your code to programmatically select your corresponding row in your listview or ???
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 6th, 2008, 08:18 PM
#6
Thread Starter
Member
Re: mshflexgrid1 row to mshflexgrid2 row or listview row
what is did was..
Code:
Private Sub MSHFlexGrid1_Click()
MSHFlexGrid2.RowSel = MSHFlexGrid1.RowSel
End Sub
but the flexgrid2 has a highlighting problem,highlighting multiple rows and never really highligting the selected row in flexgrid1
-
Jan 6th, 2008, 08:53 PM
#7
Re: mshflexgrid1 row to mshflexgrid2 row or listview row
Set the row/col positions on the second grid first before changing the selection.
Code:
MSFlexGrid2.Col = MSFlexGrid1.Col
MSFlexGrid2.Row = MSFlexGrid1.Row
MSFlexGrid2.RowSel = MSFlexGrid1.RowSel
MSFlexGrid2.ColSel = MSFlexGrid1.ColSel
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 6th, 2008, 09:17 PM
#8
Thread Starter
Member
Re: mshflexgrid1 row to mshflexgrid2 row or listview row
thx its works but i have another prob. when i scroll down flexgrid1 then select. the flexgrid2 doesn't scroll down/follow the item i selected
-
Jan 6th, 2008, 09:20 PM
#9
Re: mshflexgrid1 row to mshflexgrid2 row or listview row
Of course not, you have to code everything in programming. So tell the second grid to scroll down upon the first grids scroll event. 
Code:
Private Sub MSFlexGrid1_Scroll()
MSFlexGrid2.TopRow = MSFlexGrid1.TopRow
End Sub
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 6th, 2008, 10:03 PM
#10
Thread Starter
Member
Re: mshflexgrid1 row to mshflexgrid2 row or listview row
thx. is there a way to highlight the full row, because the first column is not highlighted
-
Jan 7th, 2008, 12:12 AM
#11
Re: mshflexgrid1 row to mshflexgrid2 row or listview row
Code:
Option Explicit
Private Sub MSFlexGrid1_Click()
'Select the starting column
MSFlexGrid1.Col = 0
'Select the end column
MSFlexGrid1.ColSel = MSFlexGrid1.Cols - 1
'Select the second grids row
MSFlexGrid2.Col = MSFlexGrid1.Col
MSFlexGrid2.Row = MSFlexGrid1.Row
MSFlexGrid2.RowSel = MSFlexGrid1.RowSel
MSFlexGrid2.ColSel = MSFlexGrid1.ColSel
End Sub
Private Sub MSFlexGrid1_Scroll()
MSFlexGrid2.TopRow = MSFlexGrid1.TopRow
End Sub
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|