locked
Using Grid as ItemsPanel RRS feed

  • Question

  • Hello everyone,

    I am using a Grid for the ItemsPanel of an ItemsControl. It is looks like this;

     <ItemsControl ItemsSource="{Binding days}">    
                                <ItemsControl.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition/>
                                                <ColumnDefinition/>
                                                <ColumnDefinition/>
                                                <ColumnDefinition/>
                                                <ColumnDefinition/>
                                                <ColumnDefinition/>
                                                <ColumnDefinition/>
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition/>
                                                <RowDefinition/>
                                                <RowDefinition/>
                                                <RowDefinition/>
                                                <RowDefinition/>
                                            </Grid.RowDefinitions>
                                        </Grid>
                                    </ItemsPanelTemplate>
                                </ItemsControl.ItemsPanel>
    </ItemsControl>

    I want to set row and column property of the items at runtime. What should I do?
    Thanks.



    Saturday, December 20, 2014 11:59 PM

Answers

  • please refer to: WPF Grid’s Row/Column Count Properties

    and , this is my Windows Store App sample project download here


    在現實生活中,你和誰在一起的確很重要,甚至能改變你的成長軌跡,決定你的人生成敗。 和什麼樣的人在一起,就會有什麼樣的人生。 和勤奮的人在一起,你不會懶惰; 和積極的人在一起,你不會消沈; 與智者同行,你會不同凡響; 與高人為伍,你能登上巔峰。

    Sunday, December 21, 2014 4:52 AM