View previous topic :: View next topic |
Author |
Message |
StrifeSD
Joined: 30 Nov 2006 Posts: 24
|
Posted: Tue Mar 13, 2007 4:07 am Post subject: New row not showing up |
|
|
I've got a virtual tree(v3.2.1) that will show a new row only the first row I add, but not any after that. I've looked at the samples and I'm not doing anything different. The virtual tree is databound to a typed dataset. Have you seen this before? |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Tue Mar 13, 2007 5:05 am Post subject: |
|
|
No we haven't had any reports of this issue. I'd be checking that you haven't got an exception occurring that is causing the problem. Make sure you have exception handling set to break on exception (under the VS Debug->Exceptions menu)
If you can put together a sample program that exhibits the problem and email a zipped copy to us we will take a look. _________________ Infralution Support |
|
Back to top |
|
|
StrifeSD
Joined: 30 Nov 2006 Posts: 24
|
Posted: Fri Mar 16, 2007 3:42 am Post subject: |
|
|
The virtual tree is throwing this error to the output window. I'm not sure where it is coming from. Any ideas? Thanks
VirtualTree: Error while getting field () of table (tblContact).
Error: 'name' argument cannot be null.
Parameter name: name |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Fri Mar 16, 2007 3:47 am Post subject: |
|
|
Check your cell bindings for the tblContact RowBinding. It looks like you have set a blank field for one of the cell bindings. _________________ Infralution Support |
|
Back to top |
|
|
StrifeSD
Joined: 30 Nov 2006 Posts: 24
|
Posted: Tue Mar 20, 2007 3:32 am Post subject: |
|
|
I did figure out the"Error while getting field ()" error, but that didn't fix the new rows not showing up on the second add. I can't figure it out, I can see the new row in the typed DataSet, but it doesn't show up! This is driving me crazy. Any ideas? |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Tue Mar 20, 2007 6:49 am Post subject: |
|
|
Can you replicate it in a simple project that you could email to us?
You could call VirtualTree.UpdateRows(true) after you add the row. You should not need to do this - but it may give us a hint as to what is happening. _________________ Infralution Support |
|
Back to top |
|
|
StrifeSD
Joined: 30 Nov 2006 Posts: 24
|
Posted: Mon Apr 02, 2007 2:05 am Post subject: |
|
|
I've narrowed the problem down to the virtualTree.SelectedItem. If I take that out the second row shows up right away. Any idea what would cause this? Do I need to clear the selected item? |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Mon Apr 02, 2007 2:08 am Post subject: |
|
|
Can you post some code to show what you mean. Where are you calling virtualTree.SelectedItem? Are you getting or setting the property? _________________ Infralution Support |
|
Back to top |
|
|
StrifeSD
Joined: 30 Nov 2006 Posts: 24
|
Posted: Tue Apr 03, 2007 2:37 pm Post subject: |
|
|
here is how I'm selecting the row
using (AddContactForm addContact = new AddContactForm(_dataSet))
{
addContact.ShowDialog(this);
if (addContact.DialogResult == DialogResult.OK)
{
vtContacts.SelectedItem = addContact.NewContactRow;
}
} |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Tue Apr 03, 2007 11:35 pm Post subject: |
|
|
That's exactly the same code that the DataSetBrowser sample uses to add a new customer - but I can't see the problem in this sample code (can you?). There must be something else going on. Is there any chance you could email a zipped copy of your project to support@infralution.com? I think it is going to be difficult to diagnose otherwise. _________________ Infralution Support |
|
Back to top |
|
|
StrifeSD
Joined: 30 Nov 2006 Posts: 24
|
Posted: Wed Apr 11, 2007 4:24 am Post subject: |
|
|
I sent you the control I'm using. The entire project is too big to zip and send. |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Fri Apr 20, 2007 12:27 am Post subject: |
|
|
This issue has now been resolved.
For the record, the problem turned out to be that there was a call to VirtualTree.SuspendDataUpdate (called from the SelectionChanged event handler) without a corresponding ResumeDataUpdate method. This basically meant that the tree would not update its data representation. Because the code was called in the SelectionChanged event handler the problem only surfaced when the SelectedItem was set.
It is important to ensure that SuspendDataUpdate/ResumeDataUpdate calls are always matched if you want your application to function normally. It is also good practice to put the ResumeDataUpdate method in a try {} finally block to ensure it is always called - even in the presence of exceptions. _________________ Infralution Support |
|
Back to top |
|
|
|