Avatar billede brobaek Nybegynder
06. september 2002 - 12:49 Der er 3 kommentarer og
1 løsning

MS Hflexgrid : "How To" eller "Tutorial"

Jeg mangler en fyldig "how to" eller "tutorial" til ms hflexgrid controllen.

Nogen som har et link eller lign. ?

Mvh
Martin
Avatar billede torbenmelander Nybegynder
06. september 2002 - 12:52 #1
http://msdn.microsoft.com plejer at være et godt sted
Avatar billede martin_moth Mester
06. september 2002 - 13:22 #2
Eller søg på MSHFlexGrid control i hjælpen - det giver følgende, hvor der både er beskrivelse og en lille kodestump:

MSHFlexGrid Control
           

The Microsoft Hierarchical FlexGrid (MSHFlexGrid) control displays and operates on tabular data. It allows complete flexibility to sort, merge, and format tables containing strings and pictures. When bound to a data control, MSHFlexGrid displays read-only data.

Syntax

MSHFlexGrid

Remarks

You can place text, a picture, or both in any cell of an MSHFlexGrid. The Row and Col properties specify the current cell in an MSHFlexGrid. You can specify the current cell using code, or the user can change it atrun time using the mouse or the arrow keys. The Text property references the contents of the current cell.

If the text in a cell is too long to display in the cell, and the WordWrap property is set to True, the text wraps to the next line within the same cell. To display the wrapped text, you may need to increase the cell’s column width (ColWidth property) or row height (RowHeight property).

Use the Col and Row properties to determine the number of columns and rows in an MSHFlexGrid. Use the Band properties to determine the band styles in an MSHFlexGrid.

Displaying Hierarchical Recordsets
A major feature of the MSHFlexGrid control is its ability to display hierarchical recordsets—relational tables displayed in a hierarchical fashion. The easiest way to create a hierarchical recordset is to use the Data Environment designer and assign the DataSource property of the MSHFlexGrid control to the Data Environment. You can also create a hierarchical recordset in code using a Shape command as the RecordSource for an ADO Data Control, as shown in the example below:

' Create a ConnectionString.
Dim strCn As String
strCn = "Provider=MSDataShape.1;Data Source=Nwind;" & _
"Connect Timeout=15;Data Provider=MSDASQL"

' Create a Shape command.
Dim strSh As String
strSh = "SHAPE {SELECT * FROM `Customers`}  AS Customers " & _
"APPEND ({SELECT * FROM `Orders`}  AS Orders RELATE " & _
"CustomerID TO CustomerID) AS Orders"

' Assign the ConnectionString to an ADO Data Control's
' ConnectionString property, and the Shape command to the
' control's RecordSource property.
With Adodc1
  .ConnectionString = strCn
  .RecordSource = strSh
End With
' Set the HflexGrid control's DataSource property to the
' ADO Data control.
Set HFlexGrid1.DataSource = Adodc1

For More Information  To find out more about hierarchical recordsets, seeHierarchical Cursors and Data Shaping Summary. A description of Shape commands can also be found inShape Commands in General.

Note  Before you can use an MSHFlexGrid in your application, you must add the MSHFlxGd.ocx file to your project. To automatically include the file in your project, put it in the Autoload file. When distributing your application, you should install the MSHFlxGd.ocx file in the user’s Microsoft Windows System directory. For more information about adding an ActiveX control to a project, see "Standard ActiveX Controls" in the Visual Basic Programmer’s Guide.
Avatar billede brobaek Nybegynder
06. september 2002 - 13:41 #3
Det jeg mangler er en _fyldig_ beskrivelse. Jeg har fundet stumper både i MSDN Libaries og på microsoft.com, men jeg søger en 5+ siders tutorial, som beskriver componenten grundigt.
Avatar billede brobaek Nybegynder
04. oktober 2002 - 13:51 #4
Lukker Q
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester