Home › Forums › WinForms controls › Xceed Grid for WinForms › Color editor
-
AuthorPosts
-
#16877 |
In the documentation these editors are available?
CellEditorManagers Datatype Description CellEditorManager (none) Allows for any control to be used as an editor to edit the content of a cell. CheckBoxEditor Boolean Represents an editor that can be used to edit the content of cells which have a boolean datatype. ComboBoxEditor (none) Represents an editor that can be used to edit the content of cells which have an ID/value mapping. DateEditor DateTime Represents an editor that can be used to edit the content of cells which have a DateTime datatype. NumericEditor Numeric Represents an editor that can be used to edit the content of cells which have a numeric datatype. TextEditor String Represents an editor that can be used to edit the content of cells which have a string datatype. But how can i edit a color with a colorpicker or something in an xceed grid??
Thanks in advance.
Imported from legacy forums. Posted by Insider (had 3587 views)
The grid does not provide such a control, so you will need to wrap your own control (or a third party one) through the CellEditorManager class. Here is more information from the help documentation on how to do this :
http://doc.xceedsoft.com/products/XceedGrid/CellEditorManagers.html
Look at the “Wrapping a control in a CellEditorManager” section.
Imported from legacy forums. Posted by André (had 2867 views)
In an Xceed grid it is possible to use an own control for editting a value in a xceed grid cell.
http://doc.xceedsoft.com/products/Xc eedGrid/ Ce llEditorMa nagers.htm l I want to use an Color picker to select a color.
When i use the control Janus.Windows.EditControls.UIColorBu tton i get an red cross in the grid, see also the screenshot (UIColorButton.jpg) I have the same problem when use an DevComponents.DotNetBar.Co
lorPickerB utton control (see screenshot ColorPickerButton.jpg) For setting the color i use something like this, but this wont work because of the red cross.
//DevComponents.DotNetBar.
ColorPicke rButton cp = datarow.Cells[profileColum n].CellVie werManager .Control as DevComponents.DotNetBar.Co lorPickerB utton;
//if (cp != null)
//{
// cp.SelectedColor = (Color)value;
//}code for Janus.Windows.EditControls.UIColorButton pCell => Xceed.Grid.Cell > is the cell in the xceed grid Janus.Windows.EditControls.UIColorButton cb = new Janus.Windows.EditControls.UIColorButton(); pCell.CellEditorManager = new CellEditorManager(cb, “SelectedColor”, true, true); pCell.CellViewerManager = new CellViewerManager(cb, “SelectedColor”); code for DevComponents.DotNetBar.ColorPickerButton DevComponents.DotNetBar.ColorPickerButton cpButton = new DevComponents.DotNetBar.ColorPickerButton(); pCell.CellEditorManager = new CellEditorManager(cpButton, “SelectedColor”, true, true); pCell.CellViewerManager = new CellViewerManager(cpButton, “SelectedColor”);
Imported from legacy forums. Posted by Insider (had 713 views)
What is the DataType of the color column? If it is object or Color, it should work fine.
Imported from legacy forums. Posted by André (had 2809 views)
First i read a dataset, with retrieveStructure() everything is in string
Then for each row i change the type to the correct one, bool, color, string, int, ….
They are different types.
Imported from legacy forums. Posted by Insider (had 547 views)
The DataType cannot be changed at the cell level, so when using different CellEditorManager in the same column, the Column DataType must be compatible to the value needed by the editor.
In your case, you could use an object DataType for that column, and all editors should work fine. The other alternative is to handle the SettingControlValue and GettingControlValue on CellEditorManager and SettingControlValue on CellViewerManager to convert the value of the editor to a value supported by the cell, and vise versa (e.g. Color.Red.ToString() in case of a string column).
You can also derive from CellEditorManager and override the SetControlValueCore() and GetControlValueCore() methods to obtain the same result.
Imported from legacy forums. Posted by André (had 3855 views)
-
AuthorPosts
- You must be logged in to reply to this topic.