Home Forums WPF controls Xceed DataGrid for WPF Is there an easy way to use my cell control?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • Xceed Support
    Member
    Post count: 5658
    #24427 |

    Hi,

    I was wondering if there were an easy way use my cell class instead of yours.
    I have created a CustomCell class:

    public class CustomCell : Xceed.Wpf.DataGrid.Cell
    {

    }

    I know there is the override:

    protected override DependencyObject GetContainerForItemOverride()
    {

    }

    But do I have to create 3 classes:

    a CustomCell class,
    a CustomDataRow that overrides the GetContainerForItemOverride() with CustomCell
    a CustomDataGridControl that overrides the GetContainerForItemOverride() with CustomDataRow CustomDataRow ?

    Thanks in advance.

    Imported from legacy forums. Posted by Simon (had 574 views)

    Xceed Support
    Member
    Post count: 5658

    Yes. That is what you need to do.

    Imported from legacy forums. Posted by Jenny [Xceed] (had 390 views)

    Xceed Support
    Member
    Post count: 5658

    But in DataRow, there is no:
    protected override DependencyObject GetContainerForItemOverride()
    {

    }

    What should I do?

    Here is the example that I want to do
    public class CustomDataRow : Xceed.Wpf.DataGrid.DataRow
    {
    protected override DependencyObject GetContainerForItemOverride()
    {
    return new CustomCell();
    }
    }

    Thanks in advance.

    Imported from legacy forums. Posted by Simon (had 363 views)

    Xceed Support
    Member
    Post count: 5658

    When creating a class that derives from row, you need to override CreateCell to return your new custom cell. There is no GetContainerForItemOverride.

    Imported from legacy forums. Posted by Jenny [Xceed] (had 212 views)

    Xceed Support
    Member
    Post count: 5658

    Thanks works great!

    Imported from legacy forums. Posted by Simon (had 4588 views)

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.