Hi,
I have been working with the ultraGrid, trying to make a grid very similiar to the Properties toolbar found in Visual Studio, with the property name in the first column and the value in the second. I have been fairly successful so far, adding different kinds of editors in each cell of the second column depending on what the property is in the first column. There are a few properties that I am having trouble finding to make it look identical to the Visual Studio toolbar and they are as follows:
1. Completely removing the header's for the column's and the grid itself. I do not want any headers at all. Logically this should be under Columns->Header in the designer but there is no Visible property (only for bands not for columns or the grid itself).
2. Making the grid lines a lighter colour (just like the Properties toolbar in VS)
3. Hiding the little column on the far left hand side that either displays an arrow or an edit symbol
4. Centering an editor inside a cell. I am using the following code to display the editor:
ultraGrid1.Rows[5].Cells[1].EditorControl = ultraColorPicker5;
But it is by default on the left hand side of the cell.
Any help would be appreciated!
componentsTest said: 1. Completely removing the header's for the column's and the grid itself. I do not want any headers at all. Logically this should be under Columns->Header in the designer but there is no Visible property (only for bands not for columns or the grid itself).
The property you are looking for is ColHeadersVisible on the band.
componentsTest said:2. Making the grid lines a lighter colour (just like the Properties toolbar in VS)
You can change the style of the borders using the BorderStyleCell and/or BorderStyleRow properties. For the color, you would use the CellAppearance.BorderColor on the band's Override.
componentsTest said:3. Hiding the little column on the far left hand side that either displays an arrow or an edit symbol
This is called the RowSelector and is controlled by the RowSelectors property on the Override.
componentsTest said:4. Centering an editor inside a cell. I am using the following code to display the editor: ultraGrid1.Rows[5].Cells[1].EditorControl = ultraColorPicker5; But it is by default on the left hand side of the cell.
I'm not sure what you mean. The editor is not on either side of the cell, the editor fills the entire cell. The ColorPicker control does not support displaying a color box centered with no text if that's what you are looking for. You might be able to acheive something like this with a CreationFilter, but it would not be a trivial task.
By the way... there is a sample included with NetAdvantage that demonstrates how to use the UltraWinTree control as a property grid. You might want to check it out.
Samples\WinTree\CS\PROPERTYGRID CS
componentsTest said:1. Your solution worked for removing the column headers, but I also need to know how to remove the main header from the grid.
I think there's a CaptionVisible property on the DisplayLayout. Or you could just set clear grid.Text.
componentsTest said:2. I have the editors working for each cell, but the user can still manually edit the values. So for example with the colour editor, they could enter an obscure value and it would be accepted. Is there any way to make the cell non editable by the user, only by using the designated control (eg. using the color picker)?
No, I don't think there is any way to do this.
Thanks, that has helped a lot so far! Two more questions I have:
1. Your solution worked for removing the column headers, but I also need to know how to remove the main header from the grid.
2. I have the editors working for each cell, but the user can still manually edit the values. So for example with the colour editor, they could enter an obscure value and it would be accepted. Is there any way to make the cell non editable by the user, only by using the designated control (eg. using the color picker)?