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
405
Custom Column for XamGrid
posted

I am using xamgrid (CellClickActionMode.SelectRow, EnterEditMode.SingleClick). I have multiple columns some of them custom. One of these, also custom, I cannot get it to work.

The closest thing I could find in the samples that looks like it, is the DateTimeColumn. My column should show a control that looks like a texbox just like the datetime. When you single click a small combobox should appear to the right of the textbox. I should be able to edit the textbox and use the combobox and exit editmode only when I click/tab away. At that point the Combox should not be visible. A lot like the DateTime column...

Well, there is always something wrong I am doing, I do not seem to be in the right edit mode at the right time and so forth. I try to do all this by setting the ItemTemplate of the column with a Datatemplate in a resource file.

Any chance you could provide a sample on how to do something like this? I would greatly appreciate it.

  • 17475
    Offline posted

    Hello Roberta,

    When IsMouseActionEditingEnabled="SingleClick" is used for the XamGrid control the cell enters edit mode when the user clicks over it. This will display the default EditorTemplate. In order to change it you need to set a custom DataTemplate as an EditorTemplate. Here is a code snippet illustrating it:

     <ig:TemplateColumn.EditorTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text="Editing"/>
                                    <ig:XamComboEditor ItemsSource="{Binding Path=Titles}"
                                                       DisplayMemberPath="FullTitle"
                                                       Width="100"/>
                                </StackPanel>
                            </DataTemplate>
                        </ig:TemplateColumn.EditorTemplate>


    Please feel free to let me know if you have any questions.