StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      


12»»

DevExpress grid, new row, misses first letter...Expand / Collapse
Author
Message
Posted 01/14/2008 10:50:20 AM


StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 05/30/2008 10:52:28 AM
Posts: 72, Visits: 251
Hi

This is another thing I came on today.

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.

My SetDefaultValues handler is:

private void ContactBO_SetDefaultValues()
{
  
this.ContactID = Guid.NewGuid();
  this.ContactType = 3;
}

But, when I make a BeginEdit in the current row:

private void ContactBO_SetDefaultValues()
{
  this.CurrentRow.BeginEdit();
  this.ContactID = Guid.NewGuid();
  this.ContactType = 3;
}

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.

I have tried to set default values, on the OnAfterAddNew, OnBeforeAddNew, OnEditingStateChanged events, nut still the same thing happens.

Has anyone seen that before?

Post #13426
Posted 01/14/2008 5:22:04 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 4:58:13 AM
Posts: 4,379, Visits: 4,421
Yes.  This is generally due to how the binding is being updated.  This is most common when the binding property is set to update the source on the Validated versus the PropertyChanged event.  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.

One other thing to look at may be the BusinessBindingSource sample that comes with the framework.  You might "compare notes" to see if there is something missing.  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.

Post #13431
Posted 01/15/2008 3:13:18 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 2 days ago @ 2:26:32 AM
Posts: 413, Visits: 1,565
Hi,
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.

I have posted this to SF team but haven't get any reply.

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.
Post #13438
Posted 01/15/2008 5:59:29 AM


StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 05/30/2008 10:52:28 AM
Posts: 72, Visits: 251
Thank you Chan.

Do you remember what the workaround was?

Post #13441
Posted 01/15/2008 7:11:53 AM


StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 05/30/2008 10:52:28 AM
Posts: 72, Visits: 251
Trend,

The PropertyChanged, etc. options are in the DataBinding collection of controls. The grid does not work with DataBindings collection, so I can't use it.

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 need DevExpress...

Have you tried a BusinessBindingSource sample using DevExpress grid?

Post #13443
Posted 01/15/2008 8:55:25 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 2 days ago @ 2:26:32 AM
Posts: 413, Visits: 1,565
Hi,
Hope this help

http://www.devexpress.com/Support/Center/p/CQ57816.aspx

Unbound column and new item row
Post #13448
Posted 01/15/2008 8:57:05 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 4:58:13 AM
Posts: 4,379, Visits: 4,421
But then again if DataGridView was enough nobody whould need DevExpress...

I was not suggesting that you use this control...I was trying to identify where your problem was.  Also, this control does far more than you may give it credit for.  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.

Have you tried a BusinessBindingSource sample using DevExpress grid?

Yes, and it works without issue.  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.

Post #13449
Posted 01/16/2008 3:37:20 AM


StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 05/30/2008 10:52:28 AM
Posts: 72, Visits: 251
Trent

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.

The minute I have some time I will send you a sample.

Post #13483
Posted 01/16/2008 7:09:23 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 4:58:13 AM
Posts: 4,379, Visits: 4,421
George, if I offended you that was not my intention.  I can tell through our interation thus far that you are a solid developer and I know that you attempted to work the problem.  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.  Hope this helps your understand where I was coming from
Post #13486