User (Old forums)MemberJune 6, 2005 at 4:53 pmPost count: 23064
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?
Imported from legacy forums. Posted by samnet (had 5741 views)User (Old forums)MemberJune 7, 2005 at 3:22 amPost count: 23064
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)User (Old forums)MemberJune 7, 2005 at 9:29 amPost count: 23064
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)User (Old forums)MemberJune 7, 2005 at 10:24 amPost count: 23064
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)User (Old forums)MemberJune 7, 2005 at 10:30 amPost count: 23064
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)User (Old forums)MemberJune 8, 2005 at 2:32 amPost count: 23064
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)
- You must be logged in to reply to this topic.