Click here to Skip to main content
15,881,139 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I'm a long-time C++ programmer transitioning to C#/XAML and am porting over a grid-based C++ application and am finding it extremely difficult to make the grid changeable. Does anyone know of an easy way to do this? Also, since the C++ grid I used had effortless 2-way editing what does that say about the overhead and complexity needed to accomplish the same task in XAML/WPF? Here's some sample code illustrating my dilema. Thank you.
HTML
<listview grid.row="5" grid.columnspan="6" itemssource="{Binding optionPositionCollection}" selecteditem="{Binding SelectedOptionPosition}"
                  Grid.Column="0"
                  VerticalAlignment="Stretch" HorizontalAlignment="Stretch" removed="LightCyan">
            <listview.itemcontainerstyle>
                <Style TargetType="{x:Type ListViewItem}"/>
           </listview.itemcontainerstyle>

            <listview.view>
                <gridview>
                    <gridview.columns>
                        <!--Call info-->
                        <gridviewcolumn header=" Strike " width="auto"
                                    DisplayMemberBinding="{Binding Path=Strike}"/>
                        <gridviewcolumn header=" Volatility " width="auto"
                                    DisplayMemberBinding="{Binding Path=SkewVolatility}"/>
                        <gridviewcolumn header=" Calls " width="auto"
                                    DisplayMemberBinding="{Binding Path=CallPosition}"/>
                        <gridviewcolumn header=" Call Settle " width="auto"
                                    DisplayMemberBinding="{Binding Path=CallSettle}"/>
                        <gridviewcolumn header=" Call Theo " width="auto"
                                    DisplayMemberBinding="{Binding Path=CallTheo}"/>
                        <gridviewcolumn header=" Excess " width="auto"
                                    DisplayMemberBinding="{Binding Path=CallExcess}"/>
                        <!--Put info-->
                        <gridviewcolumn header=" Strike " width="auto"
                                    DisplayMemberBinding="{Binding Path=Strike}"/>
                        <gridviewcolumn header=" Puts " width="auto"
                                    DisplayMemberBinding="{Binding Path=PutPosition}"/>
                        <gridviewcolumn header=" Put Settle " width="auto"
                                    DisplayMemberBinding="{Binding Path=PutSettle}"/>
                        <gridviewcolumn header=" Put Theo " width="auto"
                                    DisplayMemberBinding="{Binding Path=PutTheo}"/>
                        <gridviewcolumn header=" Excess " width="auto"
                                    DisplayMemberBinding="{Binding Path=PutExcess}"/>
                    
                </gridview>
            </listview.view>
        </listview>


[Edit (MTH): cleanup markup]
Posted
Updated 12-Sep-14 8:44am
v3
Comments
Pheonyx 12-Sep-14 12:09pm    

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900