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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Painting on a GridControl

Thread ID:

Created:

Updated:

Platform:

Replies:

41012 Feb 20,2006 02:14 PM UTC Feb 22,2006 03:03 PM UTC WinForms 6
loading
Tags: GridControl
Pierre-Luc
Asked On February 20, 2006 02:14 PM UTC

Hi there! I''ve been having some problems with painting on my grid... what I want to do is paint some strings on it, but I want to do it on my own. Not using Events to do it. I would like to know if there''s a way to get a graphics tool to paint on a GridControl, and use it in a handmade method or function. Thank you! Pierre-Luc

Pierre-Luc
Replied On February 20, 2006 03:33 PM UTC

Well, in the end I found out I can''t do what I want without an event..... but still when I use this : Private Sub PlanifGrid_DrawCell(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridDrawCellEventArgs) Handles PlanifGrid.DrawCell Dim Name As String e.Graphics.DrawString(Name, Me.drawFont, Me.drawBrush, 40, 40) End If End Sub it paints at the correct place, but if I click or double-click on the cell where it was drawn,.... it disapear. is there some kind of onfocus event that redraws an empty cell? or something I could do to fix this thanks!

Administrator [Syncfusion]
Replied On February 21, 2006 05:34 AM UTC

Hi Pierre, You can avoid this problem, by setting the e.Cancel property to true in the draw_cell event handler. Here is the code snippet Private Sub PlanifGrid_DrawCell(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridDrawCellEventArgs) Handles PlanifGrid.DrawCell Dim Name As String e.Graphics.DrawString(Name, Me.drawFont, Me.drawBrush, 40, 40) e.Cancel = True; End If End Sub Regards, Madhan.

Pierre-Luc
Replied On February 21, 2006 06:15 PM UTC

It worked... but now the grid headers are not drawing... I attached an example of the graphic output, the THIS is while using e.cancel = true and the THAT is while not using it (and having the problem I had at first) I hope it can be fixed Pierre-Luc

Pierre-Luc
Replied On February 21, 2006 06:16 PM UTC

heh... forgot to attache the picture

Example3.zip

Administrator [Syncfusion]
Replied On February 22, 2006 02:04 PM UTC

Hi Pierre, The attached sample is working fine, uses the same code. Can you post a sample showing the mentioned problem. And also kindly mention the grid version that you are using. Here is a sample project. Best regards, Madhan.

Pierre-Luc
Replied On February 22, 2006 03:03 PM UTC

You are just awesome ! all that was needed is an If e.RowIndex > 1 And e.ColIndex > 1 Then [my code] e.cancel = true end if to prevent canceling the drawcell on the headers Thanks a lot, your example made me realize that best regards and thanks, Pierre-Luc

CONFIRMATION

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

;