Skip to content

Select entire row of a data grid view #11

@MonoAutomation

Description

@MonoAutomation

Uisng Treewalker ,i am able to get required row number from the grid but not able to select that row.

i have tried selection,invoke, and other pattern but everything is throwing error like un supported pattern.
myrow=2 //example
// to get row element)
AutomationElement rowElementToSelect = requiredGrid.FindFirst(TreeScope.Children, new PropertyCondition(AutomationElement.AutomationIdProperty, myrow.ToString()));

// get row header
AutomationElement rowHeader = rowElementToSelect.FindFirst(TreeScope.Children, new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Header));

// invoke it (select the whole line)
//((InvokePattern)rowHeader.GetCurrentPattern(InvokePattern.Pattern)).Invoke();

Environment: Windows forms,Infragistics,.netframework 4,

Can any one help to get the solution for this scenario?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions