Method to verify whether a KendoGrid cell is readonly or not

7 posts, 0 answers
  1. VVP
    VVP avatar
    61 posts
    Member since:
    Mar 2015

    Posted 25 May 2015 Link to this post

    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.

  2. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 27 May 2015 Link to this post

    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
     
  3. VVP
    VVP avatar
    61 posts
    Member since:
    Mar 2015

    Posted 05 Jun 2015 in reply to Cody Link to this post

    Ok. Thanks for the info.

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

  4. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 05 Jun 2015 Link to this post

    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
     
  5. VVP
    VVP avatar
    61 posts
    Member since:
    Mar 2015

    Posted 10 Jun 2015 in reply to Cody Link to this post

    Hi Cody, 

    I meant coded verification step.

  6. VVP
    VVP avatar
    61 posts
    Member since:
    Mar 2015

    Posted 10 Jun 2015 in reply to Cody Link to this post

    Hi Cody,

    I meant Coded step.

    Thanks,

    VVP

  7. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 10 Jun 2015 Link to this post

    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
     
Back to Top
  Cast Your Vote at DevPro Connections! Cast Your Vote at  Win IT Pro Connections!