Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #16901 |

    How can we apply vistastyle to a detail table(child table) .I have applied it for the mastertable(parent table).So anyone please let me know how to apply vistastyle

    Thanks

    Imported from legacy forums. Posted by yeswanth (had 2809 views)

    User (Old forums)
    Member
    Post count: 23064

    Is this a question for the .NET grid or for the WPF DataGrid?  You have posted in both forums, and this thread is for the .NET grid.

    With the .NET grid, it you set the UIStyle property of the GridControl to System, and your are on Vista, it will set the whole grid to Vista style including the detail grids.

    If this not what you observe, provide more details so we can better understand the issue.

     

    Imported from legacy forums. Posted by André (had 2565 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi Andre,

    Iam working this method for .Net grid only .Iam getting vistastyle for mastergrid but unable to get for the detailgrid I tried by setting UIStyle to system but I couldnt get it .and the code is below

    Public Sub VistaStyle() 

    Dim activeSelectionGradientMap As New GradientMap()

    Dim inactiveSelectionGradientMap As New GradientMap()

    Dim columnManagerCellHotVisualStyle As New StatelessVisualGridElementStyle()

    Dim columnManagerCellHotGradientMap As New GradientMap()

    Dim columnManagerCellGradientMap As New GradientMap()

    ‘dim

    Dim rowSelectorGradientMap As GradientMap = CType(columnManagerCellGradientMap.Clone(), GradientMap)

    Dim rowSelectorHotVisualStyle As New StatelessVisualGridElementStyle()

    Dim rowSelectorHotGradientMap As GradientMap = CType(columnManagerCellHotGradientMap.Clone(), GradientMap)

    Dim hotGradientMap As New GradientMap()

    Dim hotVisualStyle As New StatelessVisualGridElementStyle()

    Imported from legacy forums. Posted by yeswanth (had 216 views)

    User (Old forums)
    Member
    Post count: 23064

    What are you doing with these GradientMaps then?  Can you provide more code?

    Imported from legacy forums. Posted by André (had 2520 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi Andre,

    here’s the code

    Public

    Sub VistaStyle()

    Dim activeSelectionGradientMap As New GradientMap()

    Dim inactiveSelectionGradientMap As New GradientMap()

    Dim columnManagerCellHotVisualStyle As New StatelessVisualGridElementStyle()

    Dim columnManagerCellHotGradientMap As New GradientMap()

    Dim columnManagerCellGradientMap As New GradientMap()

    ‘dim

    Dim rowSelectorGradientMap As GradientMap = CType(columnManagerCellGradientMap.Clone(), GradientMap)

    Dim rowSelectorHotVisualStyle As New StatelessVisualGridElementStyle()

    Dim rowSelectorHotGradientMap As GradientMap = CType(columnManagerCellHotGradientMap.Clone(), GradientMap)

    Dim hotGradientMap As New GradientMap()

    Dim hotVisualStyle As New StatelessVisualGridElementStyle()

    ‘ Dim detailGridTemplate_Type As New DetailGrid

    Try

    Me.GridControl1.OverrideUIStyle = True

     

    activeSelectionGradientMap.GradientStops.Add(

    New GradientStop(0, Color.FromArgb(241, 248, 253)))

    activeSelectionGradientMap.GradientStops.Add(

    New GradientStop(1, Color.FromArgb(213, 239, 252)))

    inactiveSelectionGradientMap.GradientStops.Add(

    New GradientStop(0, Color.FromArgb(248, 248, 248)))

    inactiveSelectionGradientMap.GradientStops.Add(

    New GradientStop(1, Color.FromArgb(229, 229, 229)))

    columnManagerCellHotGradientMap.GradientStops.Add(

    New GradientStop(0, Color.FromArgb(170, 227, 247, 255)))

    columnManagerCellHotGradientMap.GradientStops.Add(

    New GradientStop(0.4375, Color.FromArgb(170, 227, 247, 255)))

    columnManagerCellHotGradientMap.GradientStops.Add(

    New GradientStop(0.4375, Color.FromArgb(170, 187, 235, 254)))

    columnManagerCellHotGradientMap.GradientStops.Add(

    New GradientStop(1, Color.FromArgb(170, 187, 235, 254)))

    columnManagerCellHotVisualStyle.GradientMap = columnManagerCellHotGradientMap

    columnManagerCellHotVisualStyle.OverrideUIStyle =

    True

    columnManagerCellGradientMap.GradientStops.Add(

    New GradientStop(0, Color.White))

    columnManagerCellGradientMap.GradientStops.Add(

    New GradientStop(0.4375, Color.White))

    columnManagerCellGradientMap.GradientStops.Add(

    New GradientStop(0.4375, Color.FromArgb(255, 245, 246, 248)))

    columnManagerCellGradientMap.GradientStops.Add(

    New GradientStop(1, Color.FromArgb(255, 245, 246, 248)))

    rowSelectorGradientMap.GradientMode = Xceed.UI.GradientMode.Horizontal

    rowSelectorHotGradientMap.GradientMode = Xceed.UI.GradientMode.Horizontal

    rowSelectorHotVisualStyle.GradientMap = rowSelectorHotGradientMap

    rowSelectorHotVisualStyle.OverrideUIStyle =

    True

    hotGradientMap.GradientStops.Add(

    New GradientStop(0, Color.FromArgb(120, Color.Orange)))

    hotGradientMap.GradientStops.Add(

    New GradientStop(1, Color.FromArgb(220, Color.White)))

    hotVisualStyle.BackColor = Color.Transparent

    hotVisualStyle.GradientMap = hotGradientMap

    dataRowTemplate1.HotVisualStyle = hotVisualStyle

    dataRowTemplate1.RowSelector.GradientMap = rowSelectorGradientMap

    dataRowTemplate1.RowSelector.HotVisualStyle = rowSelectorHotVisualStyle

    Catch ex As Exception

    End Try

    End Sub

    Imported from legacy forums. Posted by yeswanth (had 227 views)

    User (Old forums)
    Member
    Post count: 23064

    The detail grid has its own ColumnManagerRow and DataRowTemplate, so you also need to set the style on them.  If you have simply added a detail grid in the designer, it will be called columnManagerRow2 and dataRowTemplate2.

    e.g.:

    dataRowTemplate1.HotVisualStyle = hotVisualStyle
    dataRowTemplate1.RowSelector.GradientMap = rowSelectorGradientMap
    dataRowTemplate1.RowSelector.HotVisualStyle = rowSelectorHotVisualStyle

    dataRowTemplate2.HotVisualStyle = hotVisualStyle
    dataRowTemplate2.RowSelector.GradientMap = rowSelectorGradientMap
    dataRowTemplate2.RowSelector.HotVisualStyle = rowSelectorHotVisualStyle
     

     

    Imported from legacy forums. Posted by André (had 3039 views)

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.