Misc. features

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


3 Replies

AD Administrator Syncfusion Team August 20, 2008 02:57 PM UTC

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





JY Jeff Yang August 20, 2008 06:14 PM UTC

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.



AD Administrator Syncfusion Team August 20, 2008 06:41 PM UTC

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


Loader.
Up arrow icon