Hi,
I have the following RadGrid as shown in the code snippet. Inside a Unit Test code using ArtOfTest.WebAii.TestTemplates etc. library in C#, I am trying to get to the EditColumn ImageButton and mimic a click on the image to initiate a 'edit item' operation.
I have the grid using (RadGrid grid = Find.ById<RadGrid>("RadGrid1");).
How do I get to the HtmlImageButton or equivalent object for a specific row in the MasterTable?
I would greatly appreciate any pointers.
<telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="True" PageSize="5" AllowPaging="True" OnItemCreated="RadGrid1_ItemCreated" OnColumnCreated="RadGrid1_ColumnCreated" OnNeedDataSource="RadGrid1_NeedDataSource" OnItemCommand="RadGrid1_ItemCommand" OnItemDataBound="RadGrid1_ItemDataBound" OnUpdateCommand="RadGrid1_UpdateCommand" OnDeleteCommand="RadGrid1_DeleteCommand"> <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle> <MasterTableView DataKeyNames="ID" CommandItemDisplay="Top" AutoGenerateColumns="false" ShowHeadersWhenNoRecords="true" > <CommandItemTemplate> <div style="padding: 5px 5px;"> <asp:LinkButton ID="btnRebind" runat="server" CommandName="RebindGrid"><img style="border:0px;vertical-align:middle;" alt="" src="Images/Refresh.gif" />Refresh</asp:LinkButton> </div> </CommandItemTemplate> <Columns> <telerik:GridButtonColumn UniqueName="InsertColumn" ButtonType="ImageButton" CommandName="AddItem" ImageUrl="~/Images/AddRecord.gif" HeaderStyle-Width="20px" HeaderText="Create New Item"/> <telerik:GridButtonColumn UniqueName="EditColumn" ButtonType="ImageButton" CommandName="EditItem" HeaderStyle-Width="20px" HeaderText="Edit/View Item" /> <telerik:GridBoundColumn DataField="ID" Visible="false" /> </Columns> </MasterTableView> <ClientSettings> <Selecting AllowRowSelect="true" /> </ClientSettings> </telerik:RadGrid>Regards
Athadu