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

Border preservation of MaskedEditBox when inside of a GridControl

Thread ID:

Created:

Updated:

Platform:

Replies:

26588 Mar 28,2005 03:12 PM UTC Mar 29,2005 03:52 PM UTC WinForms 13
loading
Tags: GridControl
Ross Micheals
Asked On March 28, 2005 03:12 PM UTC

I''ve noticed that the GridControl does not seem to respect the BorderStyle of a MaskedEditBox when that box is in a user control. I''ve attached an example where I''ve defined my own control that is used in a grid. Notice that the BorderStyle is set to ''Single,'' but when the control is placed within a GridControl, and that cell is not the active cell, the border reverts to the 3d look, and not what I have specified. If anyone at SyncFusion can use the attached project and reproduce this error, please let me know. Syncfusion GridControl Problems_1549.zip

Administrator [Syncfusion]
Replied On March 28, 2005 04:03 PM UTC

With a Control celltype, the nonactive cells are actually drawn as bitmaps of the cell. The way this works is that a WM_PAINT message is sent to the control being located off the screen causing the output to go to a bitmap, and then this bitmap is drawn for the non-active control. In this case the MaskEditCOntrol WM_PAINT seems not to be triggerring the drawing of the specified border. We will look into this, but the solution may not be simple and is likely specific to the MaskEditControl. As a work-around, you could put a Panel on the UserCOntrol where you want the maskedit, then drop the maskedit into the panel, setting its dockstyle=fill and its border = none. Then you can set the border you want on the panel. With the panel, the WM_PAINT messages seems to be drawing the requested border properly.

Ross Micheals
Replied On March 28, 2005 05:20 PM UTC

Thank you for responding so quicky. However, at this time, I''m not prepared to implement said workaround, as it would likely require significant changes to many parts of my code. Fortunately, this is not an earthshattering bug, that hopefully will be resolved in the future.

Ross Micheals
Replied On March 28, 2005 05:24 PM UTC

As an aside, the problem also seems to exist with TextBoxAdv as well.

Ross Micheals
Replied On March 28, 2005 07:46 PM UTC

This problem is more serious than I thought. Try adding an error handler to your (cell) control, and activating it. It doesn''t appear until you click back onto the cell. Once you click away from the cell, the error handler hides again. Please advise. Syncfusion GridControl Problems_9437.zip

Administrator [Syncfusion]
Replied On March 28, 2005 08:58 PM UTC

Making sure the control is parented to the grid and is set invisible seems to avoid the problem for me in your code. Dim cell As New GridCell cell.Visible = False ''added GridControl1.Controls.Add(cell) ''added

Ross Micheals
Replied On March 28, 2005 09:27 PM UTC

That doesn''t seem to work for me. I''m using v 3.0.1.0. >Making sure the control is parented to the grid and is set invisible seems to avoid the problem for me in your code. > > > Dim cell As New GridCell > cell.Visible = False ''added > GridControl1.Controls.Add(cell) ''added >

Ross Micheals
Replied On March 28, 2005 09:31 PM UTC

Code attached. > >That doesn''t seem to work for me. I''m using v 3.0.1.0. >>Making sure the control is parented to the grid and is set invisible seems to avoid the problem for me in your code. >> >> >> Dim cell As New GridCell >> cell.Visible = False ''added >> GridControl1.Controls.Add(cell) ''added >> Syncfusion GridControl Problems_2233.zip

Administrator [Syncfusion]
Replied On March 28, 2005 11:35 PM UTC

The two statemenst take care of teh corrupted drawing. As far as using a Windows Forms error provider, I do not think you will be able to get this to work using a simple Control celltype. The reason is that when the cell is not active there is not control. In fact, the control gets hidden, and as soon as it is hidden the Windows Forms ErrorProvider is hidden as well. You can get this functionality by drawing the bitmap yourself. Here is a rough sample. http://www.syncfusion.com/Support/user/uploads/Syncfusion GridControl Problems_72d4110b.zip

Ross Micheals
Replied On March 29, 2005 01:51 AM UTC

Unfortunately, this won''t do. I can''t write special behavior for every subcontrol I have in a cell. I just want a well-behaved scrollable, dynamic ''repeater''-like list hat will allow me to add and remove controls at runtime. I''ve already tried using the FlowLayout in combination with a scrollable panel, but this is very flaky, and requires that I write my own selection logic. Is there any simple solution that I''m missing here? >The two statemenst take care of teh corrupted drawing. > >As far as using a Windows Forms error provider, I do not think you will be able to get this to work using a simple Control celltype. The reason is that when the cell is not active there is not control. In fact, the control gets hidden, and as soon as it is hidden the Windows Forms ErrorProvider is hidden as well. > >You can get this functionality by drawing the bitmap yourself. Here is a rough sample. http://www.syncfusion.com/Support/user/uploads/Syncfusion GridControl Problems_72d4110b.zip > >

Administrator [Syncfusion]
Replied On March 29, 2005 09:20 AM UTC

Normally when you do a repeater control, you try to avoid creating individual instances of the control. If you have 5 controls you are doing, then it is not a problem. But if you have 5000 or 50000 of them, then it is. Trying to use a Control celltype for a repeater control does require you to create instances for each control you want to use. A better solution is to derive a dell control that uses control sharing, then 1 or 2 instances of the control can service 5 cells, 5000 cells or 50000 cells. We ship a sample showing a repeater control. It does require your UserControl to implement an interface so the control can ''fit'' into the control sharing architecture supported by our cell controls. \Syncfusion\Essential Suite\3.0.1.0\Windows\Grid.Windows\Samples\DataBound\RepeaterUserControlSample But, the sample we ship still will not support the Windows Forms error provider when being drawn in the inactive state. To get around this problem in the sample, you could extend the required interface on the user control in sample to draw icons when the usercontrol hosts a control in an error state. If you do not want to worry about control sharing, and create a new user control for every cell, then you can derive a custom cell control that always displays the control, and does not try to use static drawing of a bitmap to display it inactive (for efficiency reasons). Here is a try at this. I had to hide the column header row to avoid a painting glitch during vertical scrolling. We will look into this to see why it is happening. http://www.syncfusion.com/Support/user/uploads/Syncfusion GridControl Problems_4016c983.zip

Ross Micheals
Replied On March 29, 2005 01:36 PM UTC

Thanks for the reply --- I mentioned repeater-''like'' because I want separate controls, not reusing the same control. I''ll check out your demo code before trying to roll my own. :) Also, can the forums have an exceptionally small area to type in. I think I might be able to see a good three or four words a time here. :) >Normally when you do a repeater control, you try to avoid creating individual instances of the control. If you have 5 controls you are doing, then it is not a problem. But if you have 5000 or 50000 of them, then it is. Trying to use a Control celltype for a repeater control does require you to create instances for each control you want to use. > >A better solution is to derive a dell control that uses control sharing, then 1 or 2 instances of the control can service 5 cells, 5000 cells or 50000 cells. We ship a sample showing a repeater control. It does require your UserControl to implement an interface so the control can ''fit'' into the control sharing architecture supported by our cell controls. \Syncfusion\Essential Suite\3.0.1.0\Windows\Grid.Windows\Samples\DataBound\RepeaterUserControlSample > >But, the sample we ship still will not support the Windows Forms error provider when being drawn in the inactive state. To get around this problem in the sample, you could extend the required interface on the user control in sample to draw icons when the usercontrol hosts a control in an error state. > >If you do not want to worry about control sharing, and create a new user control for every cell, then you can derive a custom cell control that always displays the control, and does not try to use static drawing of a bitmap to display it inactive (for efficiency reasons). Here is a try at this. I had to hide the column header row to avoid a painting glitch during vertical scrolling. We will look into this to see why it is happening. > >http://www.syncfusion.com/Support/user/uploads/Syncfusion GridControl Problems_4016c983.zip >

Administrator [Syncfusion]
Replied On March 29, 2005 02:08 PM UTC

The little window is browser related. For the time being, you can type your responses in notepad or some other editor and copy and paste into the thread.

Administrator [Syncfusion]
Replied On March 29, 2005 03:52 PM UTC

I would not spend much time trying to get the sample working where you have active user controls in every cell. There are just too many problems with trying to scroll clipped controls. This is why the grid does a lot of work to have the concept of an active control in the cell and a static control in the cell that is used for all non-active drawing. Having only an active control in a cell is problematic. So, I think you can use arbitrary user controls as the basis of a celltype (as in our repeater sample), but to get such controls to work with a Windows Forms ErrorProvider will probably not work. Adding your own error provider that explicilty draws an icon on error situations will be easiler to implement.

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

;