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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Image over another

Thread ID:





16319 Jul 12,2004 06:30 PM UTC Jul 13,2004 11:35 AM UTC WinForms 3
Tags: GridControl
Christian Martel
Asked On July 12, 2004 06:30 PM UTC

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.

Administrator [Syncfusion]
Replied On July 12, 2004 06:46 PM UTC

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.

Christian Martel
Replied On July 13, 2004 09:42 AM UTC

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

Administrator [Syncfusion]
Replied On July 13, 2004 11:35 AM UTC

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)
            End If
End Sub


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon