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.

Misc. features

Thread ID:

Created:

Updated:

Platform:

Replies:

76036 Aug 20,2008 08:46 AM Aug 20,2008 02:41 PM WPF 3
loading
Tags: GridControl
Jeff Yang
Asked On August 20, 2008 08:46 AM

I've tried to look in the documentation but can't seem to find these features:
1. grid selection mode (columns only, rows only, none, cells, etc.)
2. turning off cell editing
3. borders (colors and disabling)
4. cell text color
5. turn off resizing of rows/cols
6. having the last column stretch to fill the grid width

thanks in advance


Administrator [Syncfusion]
Replied On August 20, 2008 10:57 AM

1) Selection support was added between version 6.3.0.6 and 6.3.0.30. You can see a sample at
Syncfusion\EssentialStudio\6.3.0.30\WPF\Grid.WPF\Samples\3.5\WindowsSamples\GridSamples\GridControlSelections\CS

2) One way to do this is to set the style.CellType = "Static"

grid.Model.[4, 5].CellType = "Static";


Another way to do this is set style.ReadOnly = true. You can do it grid-wide with code like:

grid.Model.TableStyle.ReadOnly = true;


3) You control the borders by setting the style.Borders properties.

grid.Model[3, 3].Borders.Right = new Pen(Brushes.Red, 1.5);
grid.Model[3, 3].Borders.Bottom = new Pen(Brushes.Red, 1.5);

If you want a border to be empty, set the style.Borders.XXXXX property to be null.

4) With the release of 6.3.1.x (out sometime this week), there are style.Font properties that let you control the text color. In earlier versions, you would have to use a DataTemplate (we ship a sample showing how you can use a DataTemplate).

5) We will make this easier in future releases, but right now, the best way to handle this is to remove the default mousecontrollers that manage the sizing. This will prevent the resizing of any row or column.

Here is code the removes the exisiting controllers.

//remove the sizing mouse controllers
IMouseController mc;
while ((mc = grid.MouseControllerDispatcher.Find("ResizeRowsMouseController")) != null)
grid.MouseControllerDispatcher.Remove(mc);
while ((mc = grid.MouseControllerDispatcher.Find("ResizeColumnsMouseController")) != null)
grid.MouseControllerDispatcher.Remove(mc);


6) There is no property setting to support this currently. But you could do it by monitoring the windows width and setting the last column width accordingly. Here is a minimal sample.

http://www.syncfusion.com/support/user/uploads/WpfFillRightColumn_54ee6ada.zip




Jeff Yang
Replied On August 20, 2008 02:14 PM

Thanks.
Regarding, it seems that there might be a bug in that both the column resize and row resize controllers share the same name. therefore the code:
IMouseController mc;
while ((mc = grid.MouseControllerDispatcher.Find("ResizeRowsMouseController")) != null)
grid.MouseControllerDispatcher.Remove(mc);

removes both column and row resizing functionality.


Administrator [Syncfusion]
Replied On August 20, 2008 02:41 PM

This has been corrected in the 6.3.1.x build that should be available for download sometime this week.


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.

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.

;