Datagrid\FlexGrid ADO Data Source
Datagrid\FlexGrid ADO Data Source
Datagrid\FlexGrid ADO Data Source
Datagrid\FlexGrid ADO Data Source
Datagrid\FlexGrid ADO Data Source
Datagrid\FlexGrid ADO Data Source Datagrid\FlexGrid ADO Data Source Datagrid\FlexGrid ADO Data Source Datagrid\FlexGrid ADO Data Source Datagrid\FlexGrid ADO Data Source Datagrid\FlexGrid ADO Data Source Datagrid\FlexGrid ADO Data Source Datagrid\FlexGrid ADO Data Source
Datagrid\FlexGrid ADO Data Source Datagrid\FlexGrid ADO Data Source
Datagrid\FlexGrid ADO Data Source
Go Back  Xtreme Visual Basic Talk > > > Datagrid\FlexGrid ADO Data Source


Closed Thread
 
Thread Tools Display Modes
  #21  
Old 04-01-2004, 06:41 PM
Medic Medic is offline
Junior Contributor
 
Join Date: Dec 1999
Location: California, USA
Posts: 220
Cool


Quote:
Originally Posted by MKoslof
As important as speed is, it is not the only factor in development. I can develop a "lightning" quick application, but IF it also provides the user with no flexibility or options...it is a give and take situation.
Well stated. The solution I have gone with, for the future reference of those who may later search for this thread attempting what I am attempting, is to use the msHflexgird with my ADO data source. It is the epitome of exactly what you are saying... a balance between speed and functionality. Binding this to an ADO recordset costs me about 5 seconds in a 7,000 record table, but gives me lightning quick and accurate soft-seek functionality. It is simply not worth it to try to have my cake and eat it too (not to mention likely impossible)...

To load the recordset (also called for cboSortby_Click Event)
Code:
  
Private Sub tmrRunOnOpen_Timer()
	tmrRunOnOpen.Enabled = False
	Dim strOrderField As String
	strOrderField = DetermineOrderField(cboSortBy.Text)
	If strOrderField <> "" Then 
		strSQLOrderBy = " ORDER BY " & strOrderField & ";"
		Screen.MousePointer = vbHourglass
		DoEvents
		AdsRecordset.Open strSQL & strSQLOrderBy, AdsConnection, adOpenDynamic, _
		adLockPessimistic, adCmdText
		' Display the results
		Set flxGrid.DataSource = AdsRecordset
		Screen.MousePointer = vbDefault
	End If
	'set the focus to the flexGrid
	flxGrid.SetFocus
End Sub
To soft-seek (search down the recordset as people are typing for the closest match)
Code:
  
Private Sub txtSearchFor_Change()
	Dim r As Long
	Dim varBookmark As Variant
	Dim intSearchLen As Integer
	Screen.MousePointer = vbHourglass
	DoEvents
	intSearchLen = Len(txtSearchFor.Text)
	'Determine which of the fields we will be searching
	For r = 1 To flxGrid.Rows - 1
		'intSearchByIndex is changed every time someone clicks on cboSortBy, so we are always sorting by the same field (column) we are searching
		If Len(flxGrid.TextMatrix(r, intSearchByIndex)) >= intSearchLen Then
			If UCase(Left(flxGrid.TextMatrix(r, intSearchByIndex), intSearchLen)) = UCase(txtSearchFor.Text) Then
				flxGrid.TopRow = r
				Exit For
			End If
		End If
	Next r
	Screen.MousePointer = vbDefault
	
End Sub
__________________
A computer program will always do what you tell it to do, but rarely what you want it to do.
  #22  
Old 04-01-2004, 08:34 PM
MKoslof's Avatar
MKoslofDatagrid\FlexGrid ADO Data Source MKoslof is offline
Cum Grano Salis

Retired Moderator
* Guru *
 
Join Date: Jul 2002
Location: Baltimore, Maryland
Posts: 14,636
Default

Looks good . Basically, a perfect balance is a developer's goal. The DataGrid has its benefits, but it also has drawbacks. Considering your current project needs, this was your best decision.
__________________
"Artificial Intelligence is no match for natural stupidity." ~unknown
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Inno setup script giannicotina Installation / Documentation 3 02-06-2004 11:18 PM
Help, ADO Data control not working!!! (Urgent) Süsser Tod Database and Reporting 6 08-22-2003 02:11 PM
Files to copy on Setup wendy General 5 03-25-2002 01:19 PM
Data Environment - ADO claude General 2 03-15-2001 11:53 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Datagrid\FlexGrid ADO Data Source
Datagrid\FlexGrid ADO Data Source
Datagrid\FlexGrid ADO Data Source Datagrid\FlexGrid ADO Data Source
Datagrid\FlexGrid ADO Data Source
Datagrid\FlexGrid ADO Data Source
Datagrid\FlexGrid ADO Data Source Datagrid\FlexGrid ADO Data Source Datagrid\FlexGrid ADO Data Source Datagrid\FlexGrid ADO Data Source Datagrid\FlexGrid ADO Data Source Datagrid\FlexGrid ADO Data Source Datagrid\FlexGrid ADO Data Source
Datagrid\FlexGrid ADO Data Source
Datagrid\FlexGrid ADO Data Source
 
Datagrid\FlexGrid ADO Data Source
Datagrid\FlexGrid ADO Data Source
 
-->