Home Forums WPF controls Xceed DataGrid for WPF How can I access the DataGridControl from Column class

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #26373 |

    Hi,

    I need access to the parent DataGridControl from the Column-class.

    what I have is:

    class CustomColumn : Column
    {
    private string _filter;

    public string Filter
    {
    get { return _filter; }
    set
    {
    _filter = value;

    // This doesn’t work!
    DataGridControl dgc = DataGridControl.GetParentDataGridControl(this);
    dgc.RaiseEvent(…)

    }
    }

    Imported from legacy forums. Posted by Daniel (had 2903 views)

    Xceed Support
    Member
    Post count: 5658

    What does not work? The provided code should retrieve the parent DataGridControl.

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

    User (Old forums)
    Member
    Post count: 23064

    DataGridControl.GetParentDataGridControl(this) returns always null in this context!

    Imported from legacy forums. Posted by Daniel (had 428 views)

    Xceed Support
    Member
    Post count: 5658

    Sorry, you are correct. GetParentDataGridControl will only function on elements that derive from FrameworkElement and that are contained in the VisualTree, which is not the case for Columns since they are not visual elements.

    I will add a feature request for columns to expose their parent DataGridControl.

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

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