gridControl-The BindingSource.AddingNew event does not fire until I begin typing into the new row
The BindingSource.AddingNew event does not fire until I begin typing into the new row
Tags:
Dan Tallent10 years ago
-
-
I have setup the form as follows:
The GridView.OptionsView.NewItemRowPosition = Bottom
The view has most of the columns from MyDataSource
The GridControl's datasource is set to MyBindingSource
When I click on any column of the new "empty" row at the bottom of the grid, I am allowed to edit. Unfortunately until I begin to type the BindingSource.AddingNew event is not fired.
This is preventing me from setting some of the values on the new row until the user types.
I tested this scenario with a standard System.Windows.Forms.DataGridView bound to the same bindingsource. As soon as I click on the new row of the DataGridView, the AddingNew event is triggered immediately. This is perfect because it allows me to setup default values and they are reflected to the user as soon as I click on the new row.
What do I need to change in my Gridview / GridControl to get this same effect.
Thanks
-
-
Svetlana (DevExpress Support)10 years ago
Hi Charles,
Thank you for the message.
To initialize new rows, handle the GridView.InitNewRow event. However, this event is raised after an end-user starts typing in a new item row.
So, to force the GridView.InitNewRow/BindingSource.AddingNew event to fire when an end-user clicks within the new item row, handle the GridView.ShownEditor event and set the GridView.ActiveEditor.IsModified property to true:[C#]
private void gridView1_ShownEditor(object sender, EventArgs e) { GridView view = sender as GridView; if(view.IsNewItemRow(view.FocusedRowHandle)) view.ActiveEditor.IsModified = true; }
Please try this approach, and let me know your results.
Thanks,
Svetlana
-
Dan Tallent10 years ago
Exactly what I was looking for. It worked perfectly. Your guys support rocks!
Thanks -
Svetlana (DevExpress Support)10 years ago
Hi Charles,
Please don't hesitate to contact us in case of any difficulty. We will be happy to help you resolve any problem!
Thanks,
Svetlana
相关文章
- 在系统下文件上传报错:The temporary upload location [/tmp/tomcat.xxx/work/Tomcat/localhost/ROOT] is not valid
- svn:could not open the requested svn f 解决
- Reporting Service 服务启动时报错The service did not respond to the start or control request in a timely fashion
- [D3] Animate with the General Update Pattern in D3 v4
- [HTTPS] MAN IN THE MIDDLE (MITM)
- 解决java compiler level does not match the version of the installed java project facet
- [SCSS] Reuse Styles with the SCSS @mixin Directive
- The type or namespace name '****' could not be found (are you missing a using directive or an assembly reference
- Shell openSomething - how is application component loaded in the runtime
- 如何处理Eclipse错误消息 The declared package does not match the expected package
- WCF The service cannot be activated because it does not support ASP.NET compatibility
- 解决The type or namespace name 'XXXX' does not exist in the namespace 'XXXXXXXXX' 的错误
- 【Codeforces 1083A】The Fair Nut and the Best Path
- 成功解决404 Not Found Not Found The requested URL was not found on the server. If yo
- 已解决The method is not allowed for the requested URL.
- 【K3s】第25篇 解决The connection to the server localhost:8080 was refused
- EnvironmentNotWritableError: The current user does not have write permissions to the targe...
- java - idea编译输出缺失导致 The output path is not specified for module XXX - 解决
- 全网多种方式解决The requested resource [/] is not available的错误
- The remote name could not be resolved: 'report.dalabs.cn'
- The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
- [TroubleShooting] The remote copy of database xx has not been rolled forward to a point in time
- Caused by: org.xml.sax.SAXParseException; systemId: file:/home/hadoop/hive-0.12.0/conf/hive-site.xml; lineNumber: 5; columnNumber: 2; The markup in the document following the root element must be well
- Ubuntu中使用sudo执行命令提示:ubuntu is not in the sudoers file. This incident will be reported.
- clang编译kernel4.9报错:the compat vDSO will not be built
- 解决办法:错误异常The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
- The value for the useBean class attribute is invalid.
- 【异常】FlinkException: The module flink-runtime-web could not be found in the class path