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
185
Xamgrid multiple point
posted

Hello,

I would like to use the same key on further columns on Xamgrid, how can i do ? 

At the moment i have an error on this point.

I'm doing something like this :

         <ig:XamGrid x:Name="dataGrid"
                    ItemsSource="{Binding Orders}">      

          <ig:XamGrid.Columns>             

<ig:TemplateColumn Key="Order" HeaderText="Update">
                        <ig:TemplateColumn.ItemTemplate>
                            <DataTemplate>
                                <Button Style="{StaticResource EditButtonStyle}" Height="18" Command="{Binding DataContext.DrawOrderDetail,RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ig:XamGrid}}}" CommandParameter="{Binding Order}"></Button>
                            </DataTemplate>
                        </ig:TemplateColumn.ItemTemplate>
                    </ig:TemplateColumn>
                    <ig:TemplateColumn  Key="Order" HeaderText="PDF">
                        <ig:TemplateColumn.ItemTemplate>
                            <DataTemplate>
                                <Button Style="{StaticResource FlatIconeButton}" BorderBrush="White" Background="White"
                                    Command="{Binding DataContext.DrawPDFCommand,RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ig:XamGrid}}}" CommandParameter="{Binding Order}"
                                    <ContentControl Style="{StaticResource PDF_ContentControlStyle}"  
                                                            BorderBrush="Black"/>
                                </Button>
                            </DataTemplate>
                        </ig:TemplateColumn.ItemTemplate>
                    </ig:TemplateColumn >

          </ig:XamGrid.Columns>

</xamgrid>

I just want to add button for each row... But for this column i don't really need key.

First problem :
I can't use Order because Orders is ObservableCollection<Order>, why ?
I can't use current row object ?
Can i use Self or Current keywords ?

Second problem :
I would like to use an empty key...
I didn't really need key in this case because i use parameter to call command action
How remove this key ?



-----------------------------------------------------------------------------------------------------

I have another problem on column with multiple value;
I'm trying to do this :

<ig:TemplateColumn Key="Person" HeaderText="Person" IsReadOnly="True" Width="100">
                        <ig:TemplateColumn.ItemTemplate>
                            <DataTemplate>
                                <TextBlock>
                                    <TextBlock.Text>
                                        <MultiBinding StringFormat="{}{0} {1}">
                                            <Binding Path="Person.Name"/>
                                            <Binding Path="Person.FirstName"/>
                                        </MultiBinding>
                                    </TextBlock.Text>
                                </TextBlock>
                            </DataTemplate>
                        </ig:TemplateColumn.ItemTemplate>
                    </ig:TemplateColumn>

When i group the table on this column i get an exception.

Did i have to do converter to be able to sort or group this column ?

Can i create columns with multiple key ?

I find solution to this problem, i put Key="Person.Name" to repolace Key="Person".

Thanks

Parents Reply Children