Hi, I want to add a new row to a RadGridView via automation. I've searched the forums but haven't found this topic yet.
I see that there is a NewRow property, in my case..
There is also a function called AddNewRow which I assume is used to make the new row.
So I'm guessing I have to set each column in my NewRow then call AddNewRow to commit it. But I don't know how to loop through each column in my row to set each columns value.
So far I have...
Is this correct? Also, I would like to search by xamlpath as well as xamlTag for a column's textbox, dropdown, etc. Is this possible?
Thanks for the help
I see that there is a NewRow property, in my case..
Pages.USSPOSCOIndustries.FrameHome.SilverlightApp.GridviewEarnings.NewRow
There is also a function called AddNewRow which I assume is used to make the new row.
So I'm guessing I have to set each column in my NewRow then call AddNewRow to commit it. But I don't know how to loop through each column in my row to set each columns value.
So far I have...
Telerik.WebAii.Controls.Xaml.RadGridView rgv = Pages.USSPOSCOIndustries.FrameHome.SilverlightApp.GridviewEarnings;
int
rowCounter = rgv.Rows.Count;
int
cellCounter = 1;
foreach
(Telerik.WebAii.Controls.Xaml.GridViewCell gCell
in
Pages.USSPOSCOIndustries.FrameHome.SilverlightApp.GridviewEarnings.NewRow
) {
//Nested loop; Goes through all the cells within each row
if
(gCell.XamlTag ==
"textbox"
&& gCell.AutomationId ==
"PART_EditableTextBox"
)
gCell.Text = (
string
)(System.Convert.ChangeType(Data[
"Hours"
],
typeof
(
string
)));
//You can implement any type of verification you like against the text here
if
(gCell.XamlTag ==
"selectivescrollinggrid"
&& gCell.Name ==
"grid"
)
gCell.Text = (
string
)(System.Convert.ChangeType(Data[
"Hours"
],
typeof
(
string
)));
//You can implement any type of verification you like against the text here
cellCounter++;
}
rowCounter++;
Pages.USSPOSCOIndustries.FrameHome.SilverlightApp.GridviewEarnings.AddNewRow();
Is this correct? Also, I would like to search by xamlpath as well as xamlTag for a column's textbox, dropdown, etc. Is this possible?
Thanks for the help