Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

editor question

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support
View previous topic :: View next topic  
Author Message
jwat
Guest





PostPosted: Thu Nov 10, 2005 9:31 pm    Post subject: editor question Reply with quote

I have one editor that is used by 2 columns and whenever I change a value all the values in all the rows of those two columns get changed to the same thing. Please tell me what I am doing wrong. The editor uses the Infralution.Controls.VirtualDropDownList control and has UpdateValueEvent set to SelectedItemChanged and the ValueProperty set to SelectedItem. Embarassed
Back to top
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Thu Nov 10, 2005 9:37 pm    Post subject: Reply with quote

Are you setting the editor up at design time (using the Virtual Tree designer)? What is the DisplayMode for the editor (Always or OnEdit)? We may need a sample project just to see what you have done - you can email one to support@infralution.com
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Fri Nov 11, 2005 10:29 pm    Post subject: Reply with quote

Thanks for the sample project. It took a little while to see what was going on. The problem was occurring because you have two DropDownList controls both bound to the same DataSource. The .NET databinding design includes a mechanism to keep the selected items of databound controls (bound to the same datasource) on a form in sync via the BindingContext/CurrencyManager. In this case this means that selecting an item in one dropdown will cause it to be selected in the other. There are two possible solutions:

a. Use two separate controls bound to two separate datasources
b. Inhibit the currency manager mechanism for this datasource. You do this by placing the line of code:

Code:
this.BindingContext[styles].SuspendBinding();


following creation of your styles datasource
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Guest






PostPosted: Sun Nov 13, 2005 1:11 am    Post subject: one final question Reply with quote

one final question unrelated to the initial problem but in the same project

The first column header has extra space to the left where the text doesn't go. How can get rid of that? To reproduce just add a row enter data in all the fields and look at the alighnment of the first column compared to all the rest. I guess this is where an icon can go but as I am not using an icon how can I purge this extra space?
Back to top
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Sun Nov 13, 2005 9:53 pm    Post subject: Reply with quote

The extra space is to display the expansion indicator and tree lines. If you are using Virtual Tree as a simple grid you can set IndentWidth to zero to remove this space.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Nov 15, 2005 11:44 am    Post subject: Reply with quote

Actually the SuspendBinding solution above does not always work. For some mysterious reason the .NET framework reenables binding for the datasource in some circumstances. The proper solution is to ensure that each of the editor controls has its own BindingContext and so is not connected to any other. To do this you will need to add a handler for the CellEditor.InitializeControl event as follows:

Code:
private void cellEditor2_InitializeControl(object sender, CellEditorInitializeEventArgs e)
{
    if (e.NewControl)
    {
        e.Control.BindingContext = new BindingContext();
    }
}

_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group