﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Issues  » DevExpress grid, new row, misses first letter on edit</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Fri, 22 May 2026 04:00:06 GMT</lastBuildDate><ttl>20</ttl><item><title>DevExpress grid, new row, misses first letter on edit</title><link>http://forum.strataframe.net/FindPost13426.aspx</link><description>Hi&lt;/P&gt;&lt;P&gt;This is another thing I came on today. &lt;/P&gt;&lt;P&gt;I use DevExpres grid and BusinessBindingSource to edit a BO. DevExpress grid has an empty row, that is used for inserting new rows in the grid. When trying to insert a new row, I click on the grid's empty row and type something in. The first character I type is always lost. Then the cell leaves edit mode, and then I type again and everything works fine. But the first character is always lost. For instance if I try to type "George" the actuall thing that the cell will contain is "eorge". And this only happens when I set default values on the BO_SetDefaultValues event handler. If the handler is empty, all work fine.&lt;/P&gt;&lt;P&gt;My SetDefaultValues handler is:&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;private void ContactBO_SetDefaultValues()&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;this.ContactID = Guid.NewGuid();&lt;BR&gt;&amp;nbsp;&amp;nbsp;this.ContactType = 3;&lt;BR&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;But, when I make a BeginEdit in the current row:&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;private void ContactBO_SetDefaultValues()&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;this.CurrentRow.BeginEdit();&lt;BR&gt;&amp;nbsp;&amp;nbsp;this.ContactID = Guid.NewGuid();&lt;BR&gt;&amp;nbsp;&amp;nbsp;this.ContactType = 3;&lt;BR&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;then all work fine when inserting new row in a grid which has some rows already. When I try to insert a new row in a grid with no rows at all, the same thing still happens. The first character I type is lost.&lt;/P&gt;&lt;P&gt;I have tried to set default values, on the OnAfterAddNew, OnBeforeAddNew, OnEditingStateChanged events, nut still the same thing happens. &lt;/P&gt;&lt;P&gt;Has&amp;nbsp;anyone seen that before?</description><pubDate>Fri, 18 Jan 2008 09:38:01 GMT</pubDate><dc:creator>George Nentidis</dc:creator></item><item><title>RE: DevExpress grid, new row, misses first letter on edit</title><link>http://forum.strataframe.net/FindPost13563.aspx</link><description>OK...this ended up being an issue with how the DevExpress XtraGrid refreshes itself.&amp;nbsp; I know that we have a large number of users using an XtraGrid and I would have to go back to previous versions to see if this issue manifested itself in those versions, but here is the problem and how to fix it.&lt;P&gt;DevExpress is handling the Changed event of each individual strong-typed property, so when the Changed event is raised it is refreshing the grid...but it is NOT updating the property value before it refreshes...so it is a "catch 22" type of situation.&amp;nbsp; To work around this, we have added two methods PauseChangedEvents and ResumeChangedEvents on the Business Objects (BusinessLayer class).&amp;nbsp; In the top of the SetDefaultValues method, call this.PauseChangedEvents and once the properties have been set, call this.ResumeChangedEvents.&amp;nbsp; This will prevent the grid from stripping the text.&lt;/P&gt;&lt;P&gt;Copy the attached assembly into your GAC (c:\windows\assembly) and copy both the DLL and XML to the c:\program files\Common Files\MicroFour\StrataFrame folder.&lt;/P&gt;&lt;P&gt;This should get you going :)&lt;/P&gt;&lt;P&gt;Obviously this will be included in the next update ;)</description><pubDate>Fri, 18 Jan 2008 09:38:01 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: DevExpress grid, new row, misses first letter on edit</title><link>http://forum.strataframe.net/FindPost13560.aspx</link><description>Trent, &lt;/P&gt;&lt;P&gt;Here's the sample I promised you. &lt;/P&gt;&lt;P&gt;I have taken the BusinessBindingSource sample and added a DevExpress grid on the form. The only thing I changed on the grid is the NewItemRowPosition.&lt;/P&gt;&lt;P&gt;Now try to add a new row by typing directly to grid's NewRow added at the bottom of the grid. You will see that the first character you type will be lost. This happen when I set default values in CustomersBO in the CustomersBO_SetDefaultValues event. Remove or comment the line&lt;FONT face="Courier New"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;this.cust_Email = "&lt;A href="mailto:someone@somewhere.com"&gt;someone@somewhere.com&lt;/A&gt;";&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;and all will work fine.&lt;/P&gt;&lt;P&gt;Also placing the CurrentRow.BeginEdit just before the assigment seem to fix the problem, but not when you add the first row in an empty BO.&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;this.CurrentRow.BeginEdit();&lt;BR&gt;this.cust_Email = "&lt;/FONT&gt;&lt;A href="mailto:someone@somewhere.com"&gt;&lt;FONT face="Courier New"&gt;someone@somewhere.com&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face="Courier New"&gt;";&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;I hope all these can help you fix it&amp;nbsp;quickly (next build for instance :D).&lt;/P&gt;&lt;P&gt;Thank you</description><pubDate>Fri, 18 Jan 2008 07:23:36 GMT</pubDate><dc:creator>George Nentidis</dc:creator></item><item><title>RE: DevExpress grid, new row, misses first letter on edit</title><link>http://forum.strataframe.net/FindPost13486.aspx</link><description>George, if I offended you that was not my intention.&amp;nbsp; I can tell through our interation thus far that you are a solid developer and I know that you attempted to work the problem.&amp;nbsp; The reason I suggested a quick sample is because this is a control that a lot of our developers use out there and I would be curious to see why it might be failing.&amp;nbsp; Hope this helps your understand where I was coming from :)</description><pubDate>Wed, 16 Jan 2008 07:09:23 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: DevExpress grid, new row, misses first letter on edit</title><link>http://forum.strataframe.net/FindPost13483.aspx</link><description>Trent &lt;/P&gt;&lt;P&gt;I had no intention of affending anyone. But I want you to be sure that before I post anything in the forum, I try a lot to make it work. I know that your time (as everyone's) is valuable.&lt;/P&gt;&lt;P&gt;The minute I have some time I will send you a sample.</description><pubDate>Wed, 16 Jan 2008 03:37:20 GMT</pubDate><dc:creator>George Nentidis</dc:creator></item><item><title>RE: DevExpress grid, new row, misses first letter on edit</title><link>http://forum.strataframe.net/FindPost13449.aspx</link><description>[quote]But then again if DataGridView was enough nobody whould&amp;nbsp;need DevExpress...[/quote]&lt;/P&gt;&lt;P&gt;I was not suggesting that you use this control...I was trying to identify where your problem was.&amp;nbsp; Also, this control does far more than you may give it credit for.&amp;nbsp; Infragistics UltraGrid actually inherits off of this control and then implements all of their logic...so if you have the time and patience, you can do a lot with the DataGridView.&lt;/P&gt;&lt;P&gt;[quote]Have you tried a BusinessBindingSource sample using DevExpress grid? [/quote]&lt;/P&gt;&lt;P&gt;Yes, and it works without issue.&amp;nbsp; I suggest that you create a small sample that reproduces your problem and post it here on the forum so I can take a look.</description><pubDate>Tue, 15 Jan 2008 08:57:05 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: DevExpress grid, new row, misses first letter on edit</title><link>http://forum.strataframe.net/FindPost13448.aspx</link><description>Hi,&lt;br&gt;
Hope this help&lt;br&gt;
&lt;br&gt;
http://www.devexpress.com/Support/Center/p/CQ57816.aspx&lt;br&gt;
&lt;br&gt;
Unbound column and new item row</description><pubDate>Tue, 15 Jan 2008 08:55:25 GMT</pubDate><dc:creator>Chan</dc:creator></item><item><title>RE: DevExpress grid, new row, misses first letter on edit</title><link>http://forum.strataframe.net/FindPost13443.aspx</link><description>Trend,&lt;/P&gt;&lt;P&gt;The PropertyChanged, etc.&amp;nbsp;options&amp;nbsp;are in the DataBinding collection of controls. The grid does not work with DataBindings collection, so I can't use it. &lt;/P&gt;&lt;P&gt;Also the BusinessBindingSource does nothing different than my code. The DataGridView works fine. The problem only happens with DevExpress grid. But then again if DataGridView was enough nobody whould&amp;nbsp;need DevExpress...&lt;/P&gt;&lt;P&gt;Have you tried a BusinessBindingSource sample using DevExpress grid?</description><pubDate>Tue, 15 Jan 2008 07:11:53 GMT</pubDate><dc:creator>George Nentidis</dc:creator></item><item><title>RE: DevExpress grid, new row, misses first letter on edit</title><link>http://forum.strataframe.net/FindPost13441.aspx</link><description>Thank you Chan.&lt;/P&gt;&lt;P&gt;Do you remember what the workaround was?</description><pubDate>Tue, 15 Jan 2008 05:59:29 GMT</pubDate><dc:creator>George Nentidis</dc:creator></item><item><title>RE: DevExpress grid, new row, misses first letter on edit</title><link>http://forum.strataframe.net/FindPost13438.aspx</link><description>Hi,&lt;br&gt;
I was facing the same problem. After long time investigation from DevExpress and SF team, I give up to use new row in XtraGrid with SF BBS.&lt;br&gt;
&lt;br&gt;
I have posted this to SF team but haven't get any reply.&lt;br&gt;
&lt;br&gt;
However, according to DevExpress team (I sent them sample project, and they tried using SF trial version) the way of SF BBS binding is a bit weird for them which is not compatible with xtragrid. They provided some workaround but cause another problem. At last, they recommend me to not use new row.</description><pubDate>Tue, 15 Jan 2008 03:13:18 GMT</pubDate><dc:creator>Chan</dc:creator></item><item><title>RE: DevExpress grid, new row, misses first letter on edit</title><link>http://forum.strataframe.net/FindPost13431.aspx</link><description>Yes.&amp;nbsp; This is generally due to how the binding is being updated.&amp;nbsp; This is most common when the binding property is set to update the source on&amp;nbsp;the Validated versus the PropertyChanged event.&amp;nbsp; You might check your bindings and set this to update your bound property on the PropertyChanged event to see if you have a different result.&lt;/P&gt;&lt;P&gt;One other thing to look at may be the BusinessBindingSource sample that comes with the framework.&amp;nbsp; You might "compare notes" to see if there is something missing.&amp;nbsp; Finally, you might see if you have the same problem with a DataGridView instead of the DevExpress grid so that you know you are having the same behavior accross the board and this is not related specifically to the DevExpress grid.</description><pubDate>Mon, 14 Jan 2008 17:22:04 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>