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

Custom renderer - OnDraw method.

Thread ID:

Created:

Updated:

Platform:

Replies:

9701 Jan 7,2004 02:54 AM UTC Jan 15,2004 06:07 AM UTC WinForms 7
loading
Tags: GridControl
Stefan T
Asked On January 7, 2004 02:54 AM UTC

Hi, I try to display the window of my custom control on the current cell area. 1. With custom static renderer and in it''s OnDraw method I position my control with the clientRectangle parameter. It works ok, except the height. My control''s window exceeds the bottom position by some pixels. ? 2.Also it is resized fine with column''s resizing but not with row''s resizing. ? ( my control has been added to Grid.Controls collection). Regards Stefan

Administrator [Syncfusion]
Replied On January 7, 2004 09:05 AM UTC

Here is a sample that derives a Static cell control, and does not seem to have this problem. It sets a panel to the size of the clientrectangle. The size seems appropriate and you can size teh row heights as well. What are you doing differertly? Does your control accept all sizes as proper bounds. Some controls (like comboboxes) cannot be set to aribitary sizes.

Administrator [Syncfusion]
Replied On January 7, 2004 09:38 AM UTC

Clay, Really the problem isn''t the size. I do the same. Looking more carefully the problem is : Adding the control to GridControl.Controls collection it looses its settings and it displays a bold large font, instead the normal setting. This has as result to exceed the client area (my opinion). The same control if it belongs to Form Controls it is displayed correctly but ofcourse I can not show it into the client area, only in relative position. The control is syncfusion comboDown with a dropDown GridGontrol (Virtual). Regards Stefan

Administrator [Syncfusion]
Replied On January 7, 2004 09:58 AM UTC

I assign again the font in OnDraw Method and it works ( the font). T

Administrator [Syncfusion]
Replied On January 7, 2004 10:02 AM UTC

The size continues to exceed two pixels and the row resizing is not correct. What did you say about comboBoxes They don''t accept arbitrary sizes ? What to do ? How to change the size of the button ? (a minimum size les than my default row height)

Administrator [Syncfusion]
Replied On January 7, 2004 11:34 AM UTC

Does your control inherit properties (like its Font) from its parent? If so, you will have to reset these properties after the control is added to the grid''s Controls collection, as adding the control to the Controls collection parents the control to the grid (setting these inherited properties).

Syed Waseem Jaffer
Replied On January 15, 2004 06:06 AM UTC

Hi all, I also have follow the same problem. but i foud its solution in some differnet way. if u put ur .NET control in a panel and then put that panel in the Grid''s control collection then u will get rid of from this rendering problem. it will not exceed the size of the item and font will not get disturb. Try it >Does your control inherit properties (like its Font) from its parent? If so, you will have to reset these properties after the control is added to the grid''s Controls collection, as adding the control to the Controls collection parents the control to the grid (setting these inherited properties).

Syed Waseem Jaffer
Replied On January 15, 2004 06:07 AM UTC

Hi all, I also have faced the same problem. but i foud its solution in some differnet way. if u put ur .NET control in a panel and then put that panel in the Grid''s control collection then u will get rid of from this rendering problem. it will not exceed the size of the item and font will not get disturb. Try it >Does your control inherit properties (like its Font) from its parent? If so, you will have to reset these properties after the control is added to the grid''s Controls collection, as adding the control to the Controls collection parents the control to the grid (setting these inherited properties).

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

;