See Also       Example Send us your Feedback
GetDefinition Method
Returns XML representation of the specified object.
Syntax

object.GetDefinition

Return Value A String value containing the object's definition.
Arguments None

Remarks

Typically, you use this method to save condition settings to the hard disk or to the database.

The following code saves the styles definition using the xmldom object.


   Dim xmlDoc As Object
   Dim sStyleDefinition As String
   
   Set xmlDoc = CreateObject("microsoft.xmldom")
   
   sStyleDefinition = SGGrid1.Styles.GetDefinition
   xmlDoc.loadXML sStyleDefinition
   
   xmlDoc.Save sFileName
   
   Set xmlDoc = Nothing
 Show Example
 Copy Code     Show Me

The following example saves the style definition using generic SaveDefinition function.

Private Sub SGGrid1_OnInit()
	SaveDefinition SGGrid1.Styles("Normal"),"Sty_Normal.xml"
End Sub

Private Sub SaveDefinition( _
   oGridObject As Object, sFileName As String)
   Dim iFreeFile As Integer
   Dim sDefinition As String
   
   sDefinition = oGridObject.GetDefinition
   
   iFreeFile = FreeFile
   
   Open sFileName For _
      Binary Access Write As iFreeFile
   
   Put #iFreeFile, , sDefinition
   Close #iFreeFile
End Sub


Back to topic

See Also

SetDefinition