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
620
CTP TemplateColumn
posted

I want to add a Button to each line in the grid (this is what I have now)

 

   <igGrid:XamWebGrid.Columns>
    <igGrid:TextColumn Key="TDescription" HeaderText="Description" IsReadOnly="True" HorizontalContentAlignment="Left"/>
    <igGrid:TextColumn Key="TReportDescription" HeaderText="Report Description" IsReadOnly="True" HorizontalContentAlignment="Left"/>
    <igGrid:TemplateColumn Key="LEnabled" HeaderText="Enabled" IsReadOnly="True" HorizontalContentAlignment="Center">
     <igGrid:TemplateColumn.ItemTemplate>
     <DataTemplate>
      <CheckBox IsChecked="{Binding LEnabled}"></CheckBox>
     </DataTemplate>
     </igGrid:TemplateColumn.ItemTemplate>
    </igGrid:TemplateColumn>
    <igGrid:TemplateColumn Key="Edit" HeaderText=" ">
     <igGrid:TemplateColumn.ItemTemplate>
      <DataTemplate>
       <Button Tag="{Binding}" Content="Edit" Width="Auto" Height="Auto" Click="Button_Click"></Button>
      </DataTemplate>
     </igGrid:TemplateColumn.ItemTemplate>
    </igGrid:TemplateColumn>    
   </igGrid:XamWebGrid.Columns>
  </igGrid:XamWebGrid>

I want to store the Rows data object in the Tag of the button so I can get the data in the click event. Is this possible as I keep getting the Error

The following key(s) do not correspond with the DataSource: "Edit". If you'd like to add additional columns, please use the TemplateColumn type.

The Edit key is not in the datasource its just a name I have to the TemplateColumn.

Help..

Thanks David.

 

Parents Reply Children
No Data