New Posts New Posts RSS Feed: How to set DataSourceUpdateMode on ViewDescriptor
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

How to set DataSourceUpdateMode on ViewDescriptor

 Post Reply Post Reply
Author
Customer View Drop Down
Senior Member
Senior Member
Avatar
User Submitted Questions to Support

Joined: 30-May-2007
Location: United States
Posts: 260
Post Options Post Options   Quote Customer Quote  Post ReplyReply Direct Link To This Post Topic: How to set DataSourceUpdateMode on ViewDescriptor
    Posted: 12-Jul-2007 at 10:36am
How would I go about changing the DataSourceUpdateMode when I use AddGroup with a ViewDescriptor.  I want the DataSourceUpdateMode to be
OnPropertyChanged.

I have a panel control housing two radio buttons  I am binding a value to see if a Patient has done agricultralwork (for government reporting)
With a ControlBindingDescriptor I would just set the UpdateMode in the CBD's definition.  Here's my code below.  Any thoughts?

        rbAgriWorkNo.Tag = False
        rbAgriWorkYes.Tag = True
        Dim AgriWorkVD As ViewDescriptor = New ViewDescriptor(EntityPropertyDescriptors.Patient.UDSAgriWork)
        PatientCBM.Descriptors.AddGroup(Me.pnlAgriWork, AgriWorkVD)
Back to Top
IdeaBlade View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 30-May-2007
Location: United States
Posts: 353
Post Options Post Options   Quote IdeaBlade Quote  Post ReplyReply Direct Link To This Post Posted: 12-Jul-2007 at 10:37am

Since Descriptors.AddGroup() doesn't return the descriptors you have to get a little creative.  You can do a Get for each radio button, and then set the DataSourceUpdateMode.  Something like this:

PatientCBM.Descriptors.Get(rbAgriWorkNo).DataSourceUpdateMode = DataSourceUpdateMode.OnPropertyChanged;
PatientCBM.Descriptors.Get(rbAgriWorkYes).DataSourceUpdateMode = DataSourceUpdateMode.OnPropertyChanged;

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down