We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Image over another

I want to add an image on a grid over a row. I want to keep my background image appearance on the others rows following and preceding the selected row. The cells where the image has been added must stay editable. Some cells are comboboxes and others are textboxes. I''ve tried that without result: Dim style As GridStyleInfo Dim grid As GridControl = Me.grid style = grid(Me.grid.CurrentCell.RowIndex, 2) grid.BanneredRanges.Add(GridRangeInfo.FromTlhw(Me.grid.CurrentCell.RowIndex, 2, 1, 5)) style.BackgroundImage = GetImage("img.jpg") style.BackgroundImageMode = GridBackgroundImageMode.StretchImage style = grid(Me.grid.CurrentCell.RowIndex, 2) style = Nothing grid = Nothing AND this with the same result : grid.FloatCellsMode = GridFloatCellsMode.OnDemandCalculation grid.CoveredRanges.Add(GridRangeInfo.Cells(Me.grid.CurrentCell.RowIndex, 2, Me.grid.CurrentCell.RowIndex, 6)) grid(Me.grid.CurrentCell.RowIndex, 2).BackgroundImage = GetImage("img.jpg") grid(Me.grid.CurrentCell.RowIndex, 2).BackgroundImageMode = GridBackgroundImageMode.StretchImage I''m out of ideas. And I didn''t found something that could help me in the samples. Thank you.

3 Replies

AD Administrator Syncfusion Team July 12, 2004 02:46 PM

You want to set the background of a row to a particular bitmap, is that correct? Take a look at the Grid\Samples\Quick Start\BannerCells sample. It shows how you can set the background of a range of cells to a bitmap using BanneredRanges.


CM Christian Martel July 13, 2004 05:42 AM

Yeah, but I would like, for example, to put a gradiant bar (one row) in the middle of the essential grid box. Here is a picture attached of what I''m looking for. box_7101.zip


AD Administrator Syncfusion Team July 13, 2004 07:35 AM

You could try handling the grid''s paint event and do the drawing there yourself.
Private Sub gridControl1_Paint(ByVal sender As Object, ByVal e As PaintEventArgs) Handles gridControl1.Paint
            Dim range As GridRangeInfo = GridRangeInfo.Cells(11, 2, 11, 5)
            Dim rect As Rectangle = Me.gridControl1.RangeInfoToRectangle(range)
            If rect.IntersectsWith(e.ClipRectangle) Then
                Dim br As New System.Drawing.Drawing2D.LinearGradientBrush(rect, Color.FromArgb(200, Color.Black), Color.FromArgb(100, Color.White), Drawing2D.LinearGradientMode.Horizontal)
                e.Graphics.FillRectangle(br, rect)
                br.Dispose()
            End If
End Sub

Loader.
Live Chat Icon For mobile
Up arrow icon