简体   繁体   中英

Prism Xamarin How to access my grid at runtime

I am developing with Prism library and Xamarin, I want to create a table which will be able to add new rows and fill the content in the new rows.

It seems there is no table control, and I made a test with Grid, I defined the Grid at xaml like below:

        <Grid x:Name="SourceGrid" >
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition/>
            <ColumnDefinition/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition/>
        </Grid.RowDefinitions>
    </Grid>

But, how can I access this Grid after my application lauch at runtime.

I want to add new row while runtime.

First google for such made controls, there are some available from the community. Second please kindly read about creating xamarin custom controls it will answer much.

For the direct answer:

You can access its SourceGrid.Children with methods like SourceGrid.Children.Add(view, col, row);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM