Detect dropdown select event in c# in IP 2003? - InfoPath Dev
in

InfoPath Dev

Detect dropdown select event in c# in IP 2003?

Last post 02-15-2007 11:36 AM by Matt Faus. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 02-13-2007 10:48 AM

    Detect dropdown select event in c# in IP 2003?

    Greetings,

    Can a dropdown list control on Selected event (or any InfopathEventType that applies as a dropdown event) be detected and coded against in c# managed code for IP 2003? And, if so, any examples?

    Many thanks for any help!!
  • 02-13-2007 05:20 PM In reply to

    Re: Detect dropdown select event in c# in IP 2003?

    Hi JackInTheGreen,
    Not easily. Certainly you could write some code to get the window handle for the dropdown and get handle events from that. The code would have to use the HTML object model. It would be tricky and error prone since the drop down control may change if you change the InfoPath view and it might be difficult to get it in the first place. In short, I think this is hard if not impossible.
    Patrick Halstead
    Project Manager at Qdabra
  • 02-14-2007 05:56 AM In reply to

    Re: Detect dropdown select event in c# in IP 2003?

    Thanks Patrick.

    I suspected as much. I'm trying to populate A textbox from a dropdown on select. Both are main datsource bound, but the dropdown's values and associated values slated for the textbox come from a secondary datasource. I tried to adapt Matt's fine dopdown tutorial, but using dropdown control rules with managed code only pops "unspecified" errors if you don't get the xpath exactly right; not terribly useful for debugging :( Oh well back at it..

  • 02-14-2007 08:53 AM In reply to

    Re: Detect dropdown select event in c# in IP 2003?

    Patrick, it would seem that this can be done in vb.net per this thread you contributed to back in 2005:

    http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=695

    Is it just c# that won't play well here? Thanks!
  • 02-15-2007 11:36 AM In reply to

    Re: Detect dropdown select event in c# in IP 2003?

    Hey Jack,

    I think you are just getting a syntax error here, can you post the code an errors you are seeing? Patrick was saying that you cannot access the values of a drop-down if you hardcode them in the designer, but if they are populated from a secondary data source it is trivial to retrieve the values and we do it all the time.
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.