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

Method to verify whether a KendoGrid cell is readonly or not

6 Answers 139 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
VVP
Top achievements
Rank 2
VVP asked on 26 May 2015, 04:39 AM

Hi,

 

I have a Kendo grid cell and want to verify whether a cell is readonly or not.

I looped the grid to find properties of each cell. But i couldnt find any property which says it is readonly.

Any way to check .I tried IsEnabled. It always returns true.

6 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 27 May 2015, 05:51 PM
Hi Vishnu,

Kendo grid cell's don't really have a "read only" state or mode. They're either in edit mode or not in edit mode. To further complicate things the Kendo grid can be set to edit in row mode or cell mode. See the attached screen shots for examples.

Regards,
Cody
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
VVP
Top achievements
Rank 2
answered on 05 Jun 2015, 08:50 AM

Ok. Thanks for the info.

So is it possible to check that properties for a cell in program.

0
Cody
Telerik team
answered on 05 Jun 2015, 08:14 PM
Hi VVP,

Yes but I need one clarification. When you say "in program" are you referring to a coded step, or a standard verification step in a test?


Regards,
Cody
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
VVP
Top achievements
Rank 2
answered on 10 Jun 2015, 10:30 AM

Hi Cody, 

I meant coded verification step.

0
VVP
Top achievements
Rank 2
answered on 10 Jun 2015, 10:31 AM

Hi Cody,

I meant Coded step.

Thanks,

VVP

0
Cody
Telerik team
answered on 10 Jun 2015, 05:29 PM
Hello VVP,

Here's a code sample:
// Verify the first cell is in edit mode
iAttribute edit_cell_class = Pages.JQueryGridCustomEditing0.EditCell.BaseElement.GetAttribute("class");
Assert.IsNotNull(edit_cell_class);
Assert.AreEqual<string>("k-edit-cell", edit_cell_class.Value);
 
// Verify the second cell is not in edit mode
iAttribute non_edit_cell_class = Pages.JQueryGridCustomEditing0.NonEditCell.BaseElement.GetAttribute("class");
Assert.IsNull(non_edit_cell_class);

I also attached the complete test for your review.


Regards,
Cody
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
Tags
General Discussions
Asked by
VVP
Top achievements
Rank 2
Answers by
Cody
Telerik team
VVP
Top achievements
Rank 2
Share this question
or