locked
Problem with widths of the DropDown in Infopath RRS feed

  • Question

  • I have many dropdown lists in the infopath form. I have set fixed width to them . When the form is printed it looks very weird i.e if the selected item is a smaller one than the width set there is lot of space between the next object and this dropdown. It would be nice if it would adjust the width based on the item selected. Please help me in achieving this .

     

     

    Tuesday, July 6, 2010 8:55 PM

Answers

  • Hi Phani,

    I was able to reproduce the behavior you described, based on the steps you provided.  The reason this happens is because when you print, InfoPath will leave the width you had set for the dropdown control between objects in your template.  It assumes you want this width since it was set to a static amount.

    Unfortunately, there is no way to dynamically set the width of the dropdown based on the selected item.  However, I was able to bypass the issue you described by not using a set width, but instead clearing the value for the width, which causes it to default to "Auto".  What this does is set the width of the control to the longest element in the dropdown.  When you print, you will notice it will shrink down to the size of the selected item, not the width it was in the template.

    I hope this will work out for you!

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Regards,
    Ian Kavanagh
    Microsoft Online Community Support

    • Marked as answer by Phani Balusu Thursday, July 15, 2010 12:42 PM
    Wednesday, July 14, 2010 7:52 PM

All replies

  • Hi Phani,
    If I understand correctly, you have several dropdowns in an InfoPath client form.  When you select an option in one of these dropdowns, you are looking for a way to have the width of the dropdown match the width of the selected item?

    Also, you are having a problem when printing where you have drop downs that have a static width, yet if the selected item in that dropdown is smaller than the width of the dropdown, you will see a gap between that control and the controls below it?

    What version of InfoPath are you using?  What Service Pack?
    What Operating System do you see this problem on?  What Service Pack?
    Do you have some example steps I can run through to reproduce the bahavior?  I have been unsuccessful so far.

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Regards,
    Ian Kavanagh
    Microsoft Online Community Support

    Tuesday, July 13, 2010 8:26 PM
  • Hi Ian ,

    I am using InfoPath 2010 Version 14.0.4760.1000 64bit . I am using Windows 7 Enterprise.

    I will tell u an example .

    I have "county" dropdown in which there is a list of counties to be selected on the form . So  it looks like

     

    ----------- County, 

     

    where ---------- is the dropdown.

    Scenario 1:

    If i select 'Montogromery' as County Name then there is a little space between Montogromery and County so it looks

    like 'Montogromery  County'  which is acceptable. 

    Scenario 2:

    I i select 'adair' as County Name then there is a lot of space between adair and County so it looks like 'adair                   County' which is weird .

    I dont have option to attach a screen shot here .. I hope this makes some sense.

    Thnx

    phani

     

     

     

    Wednesday, July 14, 2010 1:54 AM
  • Hi Phani,

    I was able to reproduce the behavior you described, based on the steps you provided.  The reason this happens is because when you print, InfoPath will leave the width you had set for the dropdown control between objects in your template.  It assumes you want this width since it was set to a static amount.

    Unfortunately, there is no way to dynamically set the width of the dropdown based on the selected item.  However, I was able to bypass the issue you described by not using a set width, but instead clearing the value for the width, which causes it to default to "Auto".  What this does is set the width of the control to the longest element in the dropdown.  When you print, you will notice it will shrink down to the size of the selected item, not the width it was in the template.

    I hope this will work out for you!

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Regards,
    Ian Kavanagh
    Microsoft Online Community Support

    • Marked as answer by Phani Balusu Thursday, July 15, 2010 12:42 PM
    Wednesday, July 14, 2010 7:52 PM
  • Hey Ian  !!

    That Solved my Problem :) .

    Thanks a lot for your support .

    Thursday, July 15, 2010 12:42 PM