Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
285
TemplateColumnLayout without Key
posted

Hi,

I am showing all property of entity in xam grid as column now i have to add a TemplateColumnLayout in the grid which will show a another view but TemplateColumnLayout needs key and i can't set same key to two column. 

Ex:

<ig:TextColumn   Key="Status" HeaderText="status" />
<ig:TemplateColumnLayout Key="Status" Template="{StaticResource StatusTemplate}" />

What should i do in this case.

Please suggest.

Parents
No Data
Reply
  • 6759
    Suggested Answer
    Offline posted

    Hi,

    in order to achieve this scenario you need to replace the TextColumn with Key="Status" with an Unbound one. The reason is that you could have only one column directly bound to a property of your data object. Have in mind that for the unbound column you need to specify an unique key(it does not need to match a property from the data object - i.e. you could set its key to "asdasd"). And finally customize the date column to look like a text column. Here is an example how the xaml code for the unbound column should look like:

    <ig:UnboundColumn Key="asdasd" Header="Status">

        <ig:UnboundColumn.ItemTemplate>

            <DataTemplate>

                <TextBlock Text={Binding RowData.Status}/>

            <DataTemplate>

        </ig:UnboundColumn.ItemTemplate>

        <ig:UnboundColumn.EditorTemplate>

            <DataTemplate>

                <TextBlock Text={Binding RowData.Status}/>

            <DataTemplate>

        </ig:UnboundColumn.EditorTemplate>

    </ig:UnboundColumn>

    Hope this helps,

Children
No Data