TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Amresh S
NA
437
17.2k
How to add a combobox dynamically
Oct 20 2016 8:55 AM
Hi All,
I'm trying to add a combobox dynamically in bettween the two combox box. Depending upon the boolean value, the visibility is set. But, the problem is it should'nt consume the hidden space in between the other two comboboxes. Further, I'm using the Grid layout, in which by row definition I place the comboboxes in it's respective cells.
Please refer to my below XAML code:
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="28"/>
<RowDefinition Height="28"/>
<RowDefinition Height="*"/>
<Grid.RowDefinitions/>
<Combobox Grid.Row="0" Name="cmBox_Main" ItemSource="{Binding myData}"/>
<Combobox Grid.Row="1" Name="cmbBox_Sub" Visibility="Collapsed"/>
<TextBox Grid.Row="2" FontSize=14 FontWeight="Normal"/>
<Grid/>
Note: By default, the 2nd combo box is collapsed/hidden from the view. Upon selection from the 1st combobox, it is validated in the code behind and the visibility is set. But, it should not consume space when no such selection is made from the 1st combo box.
Eventhough, I had collapsed it's visibility it occupies the space and appears as a blank area, which is not desireable.
Please share your ideas to achieve this requirement.
Thanks in advance.
Regards,
Amresh S.
Reply
Answers (
3
)
How to get each checkbox bind id in wpf c#?
setup and deployment