This is a migrated thread and some comments may be shown as answers.

RadGridView & RadMenu UI Automation

2 Answers 102 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 1
Joe asked on 03 Jul 2012, 07:55 PM
Hello again,

I'm working with RadGridViews this time and I'm having trouble searching/iterating through them.
What I want to do is to find a row in the grid where a specific field's text matches a specific string, and right clicks to open a menu.
Here's the xaml for reference.  Attached is a picture of me right-clicking on a row where meter name = "freepadthai"
<telerik:RadGridView Grid.Row="3" Margin="15,15,15,0" Name="meterGrid" VerticalAlignment="Top" HorizontalAlignment="Left" IsReadOnly="True" Opacity="100" RowIndicatorVisibility="Collapsed" Grid.Column="0" Grid.ColumnSpan="3"
    AutoGenerateColumns="False" SelectionMode="Single" telerik:StyleManager.Theme="Office_Blue" Height="250" RowActivated="meterGrid_RowActivated" >
 
    <!--Fade In Animaiton-->
<!--<telerik:RadGridView.Resources>
<Storyboard x:Name="_animationGridLoad">
<DoubleAnimation Storyboard.TargetName="meterGrid" Storyboard.TargetProperty="Opacity" From="0.0" To="1.0" Duration="0:0:2" AutoReverse="false" />
</Storyboard>
</telerik:RadGridView.Resources>-->
 
<!--Right Click Context Menu-->
<telerik:RadContextMenu.ContextMenu>
    <telerik:RadContextMenu ItemClick="RadContextMenu_ItemClick">                
        <telerik:RadContextMenu.Items>
            <telerik:RadMenuItem Header="Create New Meter" CommandParameter="Create" />
            <telerik:RadMenuItem Header="Edit Meter Details" CommandParameter="Edit" />
            <telerik:RadMenuItem Header="Delete Meter" CommandParameter="Delete" />
            <telerik:RadMenuItem Header="View on Map" CommandParameter="View" />
            <telerik:RadMenuItem Header="View Meter History" CommandParameter="History" />
            <telerik:RadMenuItem Header="View Documents" CommandParameter="DocLibrary" />
        </telerik:RadContextMenu.Items>
    </telerik:RadContextMenu>
</telerik:RadContextMenu.ContextMenu>
 
<!--Display Columns-->
<telerik:RadGridView.Columns>
    <telerik:GridViewDataColumn Width="*" Header="Meter Name" DataMemberBinding="{Binding MeterName}"  />
    <telerik:GridViewDataColumn Width="*" Header="Manufacturer" DataMemberBinding="{Binding MainManufacturer}"  />
    <telerik:GridViewDataColumn Width="*" Header="M.C. Approval" DataMemberBinding="{Binding MainMCApprovalNum}" />
    <telerik:GridViewDataColumn Width="*" Header="CT Ratio" DataMemberBinding="{Binding CTRatio}" />
    <telerik:GridViewDataColumn Width="*" Header="Meter ID" DataMemberBinding="{Binding MeterID}" />
</telerik:RadGridView.Columns>
 
</telerik:RadGridView>

2 Answers, 1 is accepted

Sort by
0
Accepted
Anthony
Telerik team
answered on 03 Jul 2012, 10:16 PM
Hello Joe,

We have several code sample articles on Silverlight RadGridView, such as this one that demonstrates going through each cell in each row. You'll essentially use a foreach loop to go through each row, and a nested foreach loop to go through each cell in each row.

You'll have to implement code on what to do when a match is found, and logic for what to do when a match isn't found.

You can right click by Invoking a Mouse Action, then click the desired RadMenuItem within the RadMenu. As an alternative, you can use Blind Key Presses to invoke the Down and Enter keys.

Kind regards,
Anthony
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Joe
Top achievements
Rank 1
answered on 04 Jul 2012, 01:12 PM
Thanks, that helped me a lot.
Tags
General Discussions
Asked by
Joe
Top achievements
Rank 1
Answers by
Anthony
Telerik team
Joe
Top achievements
Rank 1
Share this question
or