Home › Forums › WinForms controls › Xceed Grid for WinForms › quick edit options for GridComboBox/GridDateTimePicker/etc.
-
AuthorPosts
-
#13668 |
Hi all-
Not sure if this is workable in the Xceed model, but I’m looking for a way to speed up data entry in a GridControl. Here’s the idea: I have a databound grid with columns of various data types, a combobox or two and maybe a datetimepicker.Everything works fine, but as a user it is impossible to directly (via keyboard) enter a value in a combobox or datetime column. If you tab into one of those columns you have to click in the cell to open up the associated control and select a value. I’m trying to set things up so I tab into a column and can just directly enter the value if I want or use the control to specify a value.
So I have a two-fold question. First: Is there an easy way to do this? If not, how do I subscribe to whatever event fires when you enter a cell?
Thanks,
SamImported from legacy forums. Posted by samnet (had 5741 views)
Pressing the F2-key on a cell should activate the editor.
There is also an option to activate the editor when a cell gets focus: just set the <b>SingleClickEdit</b>-property of the GridControl to true.Imported from legacy forums. Posted by Tommy (had 247 views)
Thanks for the response. The tip about F2 worked great. Unfortunatley I can’t get the SingleClickEdit to work. With SingleClickEdit true I am able to click on a cell and instantly access the celleditor, but if I get focus with tab the only way to access the editor is via F2. My goal is to allow the user to tab into a combobox cell, start typing a value and automatically get the matching responses.
Here is my code to add the editor/viewer right now:
Note: colNames[i] just holds the database field name for the value
———–
GridComboBox comboEditor = new Xceed.Grid.Editors.GridComboBox();
this.Columns[ colNames[i]].CellEditor = comboEditor;
this.Columns[ colNames[i]].CellViewer = comboEditor;SqlCommand comm = new SqlCommand(“Get”+colNames[i]+”List”);
//appConn.GetData will return a filled dataset containing the display/value items for the combobox
DataSet ds2 = appConn.GetData(comm, colNames[i]+”DS”, colNames[i]+”Tbl”);comboEditor.DataSource = ds2.Tables[colNames[i]+”Tbl”];
comboEditor.DisplayMember = “DisplayValue”;
comboEditor.ValueMember = colNames[i];
Imported from legacy forums. Posted by samnet (had 396 views)
Well, I’ve never used SingleClickEdit myself. It probably only works with the mouse, hence the name.
Imported from legacy forums. Posted by Tommy (had 216 views)
sadly it seems that is only for mouse clicks. Any thoughts on what event fires when a cell gains focus? I’d like to code up a workaround for this, some way to force the cell into editing mode.
Imported from legacy forums. Posted by samnet (had 414 views)
The Cell-class doesn’t have such an event, but the GridControl has a <b>CurrentCellChanged</b>-event.
Imported from legacy forums. Posted by Tommy (had 237 views)
I am facing the same problem, did you find any solution for that, is so, I request you to share it.
ThanksImported from legacy forums. Posted by Moniruzzaman (had 6454 views)
-
AuthorPosts
- You must be logged in to reply to this topic.