views:

185

answers:

1

Hi

I am currently busy with a WPF application that uses a "GridView".

There are several template columns one of which is a ComboBox in column 3 named cmbInputControlType. What I would like to do using my Converter class, which I have already created, is binding the visibility of the TextBox(txtFrom) in column 4 to the selected value of the ComboBox(Column 3). Basically if you select a value from the the ComboBox(cmbInputControlType - column 3), it must update teh visibility of the TextBox(txtFrom - column 4)

<ListView Height="150" ScrollViewer.HorizontalScrollBarVisibility="Auto" 
             ScrollViewer.VerticalScrollBarVisibility="Auto" Width="435"
             HorizontalAlignment="Center" Margin="5,0,5,5" 
             Name="lstInput" VerticalAlignment="Top" 
          SelectionMode="Single" HorizontalContentAlignment="Left">
                <ListView.Resources>
                    <local:InputControlTypeConverter x:Key="InputConType" />
                </ListView.Resources>
                <ListView.View>
                <GridView>
                        <!--Column 1-->
                        <GridViewColumn Header="ParameterName"  x:Name="lblParameterName" DisplayMemberBinding="{Binding ParameterName}" Width="100" />

                        <!--Column 2-->
                        <GridViewColumn Header="DisplayName">
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBox x:Name="txtDisplayName" Width="150" />
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                         </GridViewColumn>

                        <!--Column 3-->
                        <GridViewColumn Header="ControlType">
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <ComboBox x:Name="cmbInputControlType" Width="100" SelectionChanged="cmbInputControlType_SelectionChanged" >
                                        <ComboBoxItem Content="TextBox" />
                                        <ComboBoxItem Content="Copy" />
                                    </ComboBox>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>

                        <!--Column 4-->
                        <GridViewColumn Header="From">
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                        <TextBox x:Name="txtCopyFrom" Width="150" Visibility="{Binding ElementName=cmbInputControlType,Path=SelectedItem, Converter={StaticResource InputConType}}"  />
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>

                        <!--Column 5-->
                        <GridViewColumn Header="To">
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBox  x:Name="txtCopyTo" Width="150" />
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>

                </GridView>
            </ListView.View>

        </ListView>
A: 

There is no answer to the question you are asking. you are destined to FAIL!

Toasty
Thanks bro....Much appreciated...If everyone thought like you..the world would be a better place
i2nfo
eish im telling you. Also Fail blog would be even bigger than facebook could ever dream to be
Toasty
Failbook??......
i2nfo