See Also       Example Send us your Feedback
SetDefinition Method
Initializes specified object with XML string.
Syntax

object.SetDefinition(XMLDefinition As String)

Return Value None
Arguments
object  An object expression that evaluates to the SGCondition object.
XMLDefinition A String expression that containing the XML definition.

Remarks

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

The following example uses the XMLDOMDocument Object to loads the column definition from the file.


   Dim xmlDoc As Object
   
   Set xmlDoc = CreateObject("microsoft.xmldom")
      
   xmlDoc.Load sFileName
   SGGrid1.Columns(sColKey).SetDefinition xmlDoc.xml
   
   Set xmlDoc = Nothing
 Show Example
 Copy Code     Show Me

The following example loads the style definition using generic LoadDefinition function.

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

Private Sub LoadDefinition( _
   oGridObject As Object, sFileName As String)
   Dim iFreeFile As Integer
   Dim sDefinition As String
   
   sDefinition = String(FileLen(sFileName), " ")
   
   iFreeFile = FreeFile
   
   Open sFileName For _
      Binary Access Read As iFreeFile
   
   Get #iFreeFile, , sDefinition
   Close #iFreeFile
   
   oGridObject.SetDefinition sDefinition
End Sub


Back to topic

See Also

GetDefinition