Posted By: xaep | Jul 7th, 2005 @ 7:57 PM
page 1 of 1
Comments: 8 | Views: 2857
I am learning Avalon and try to make some demo base on it. But I don't find any grid control like DataGrid in Beta 1 RC, why? Does it mean grid-like control will not exist any more in Avalon? Or another type of control will instead of it?
Tyler Brown
Tyler Brown
Bullets change governments far surer than votes.
xaep wrote:
I am learning Avalon and try to make some demo base on it. But I don't find any grid control like DataGrid in Beta 1 RC, why? Does it mean grid-like control will not exist any more in Avalon? Or another type of control will instead of it?
It's been a month or two since I've done anything with Avalon as I'm currently exploring Indigo, however there should be a grid control which you can use as follows.
<Grid>

    <Grid.ColumnDefinitions>

        <Grid.Column\>

    </Grid.ColumnDefinitions>

    <Grid.RowDefinitions>

        <Grid.Row\>

    </Grid.RowDefinitions>

</Grid>

Tyler Brown
Tyler Brown
Bullets change governments far surer than votes.
This grid can do what you are asking, you just have to place the elements into the proper grid. Define as many rows and columns as you need, and then add elements to the grid. Grid counting starts at 0 for rows and columns. In the following example, a button will be added to the first row and first column, and another button will be added to the first row and second column.
<Grid>

    <Grid.ColumnDefinitions>

        <ColumnDefinition\>

        <ColumnDefinition\>



    </Grid.ColumnDefinitions>

    <Grid.RowDefinitions>

        <RowDefinition\>

        <RowDefinition\>



    </Grid.RowDefinitions>

</Grid>

<Button Grid.Column="0" Grid.Row="0"\>

<Button Grid.Column="1" Grid.Row="0"\>


Please note the change from Grid.Column to ColumnDifinition. Alternatively you could place the elements within the ColumnDefinition and RowDefinition tags. I haven't tested this, but this would make sense.
An Avalon Datagrid Demo comes with Beta 1 RC. Check your docs man. Wink

Edit: Here's the link to the online version http://winfx.msdn.microsoft.com/library/default.asp?url=/library/en-us/wcp_samples/winfx/port_sample_data_binding.asp
DCMonkey
DCMonkey
Monkey see, monkey do, monkey will destroy you!
I would think that the Listbox would be the logical place to start, using Grid layout controls in each Listbox item to get the regular row/column layout. I seem to remember a Grid property that sounded like it would allow tying together the resizing of multiple grid layout controls (don't know if it works or if that is what is was for though). You could also just have an arbitrary layout per item instead of just sticking to rows and columns.

The only aspect I'm not sure on is enabling editing of Listbox items. I tried to make something work on an older Avalon build and didn't get very far. Any tips on how to do that or are we supposed to start at a lower level for this kind of UI like that aforementioned datagrid SDK sample does.?
You may have a better chance of getting a satisfactory answer on the avalon newsgroup. It has people far more qualified than myself to give answers.