Get the text from the GridViewCell control

2 posts, 1 answers
  1. Stanislav
    Stanislav avatar
    1 posts
    Member since:
    May 2012

    Posted 01 Nov 2012 Link to this post

    Hello all,

    Is this a correct behaviour when I try to get a text from the GridViewCell control, and there is a button there, the Text property returns nothing?
    I would have thought that it returns the text from all child controls.

    In my case, there is a button in the GridViewCell, so, it is impossible to find a cell by its text, so, I have to find all cells, than a button with the expected text. It is a little bit overwhelming, isn't it? Or, I am doing something wrong. Please, give me some advice.

    Thank you.

    Kind Regards,
    Stanislav Hordiyenko
  2. Answer
    Plamen avatar
    8 posts

    Posted 07 Nov 2012 Link to this post

    Hi Stanislav,

    Yes, this is expected behavior. The 'Text' property returns only the text of the first TextBlock by default. In order to get the text content of all child TextBlock elements you need to use the 'TextBlockContent' property. 

    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top