editable GridViewDynamicHyperlinkColumn

4 posts, 0 answers
  1. sprucely
    sprucely avatar
    13 posts
    Member since:
    Feb 2010

    Posted 13 Sep 2011 Link to this post

    I want users to be able to tab into a cell of a hyperlink column and edit the url when a row is in edit mode. Since the GridViewDynamicHyperlinkColumn is read-only, I thought I could subclass it to provide an edit textbox. But I can't override CanEdit because you've made it internal. Is there a reason for this? I've worked around it by subclassing GridViewBoundColumnBase and reimplementing stuff from the hyperlink column. If you could remove the internal specifier from CanEdit, it would help avoid unnecessary duplication.
  2. Pavel Pavlov
    Pavel Pavlov avatar
    2039 posts

    Posted 17 Sep 2011 Link to this post

    Hi Sprucely,

    The setter is intentionally not exposed. Here is some general reasoning - If we allow setting this property , we should provide some editing functionality to the column . And for the hyperlink there is not a standard editor - one would like to edit the url , other would like to edit the description etc. Since we can not cover the general case and yet the column is purposed for navigation and not editing we could not allow setting of this property .

    For such scenario either your approach (inheriting GridViewBoundColumnBase )  or retemplating the GridViewDataColumn are recommended.

    Best wishes,
    Pavel Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
  4. sprucely
    sprucely avatar
    13 posts
    Member since:
    Feb 2010

    Posted 19 Sep 2011 Link to this post

    OK. I can live with my current solution. And if I have time I will look at the retemplating option, as that could help reduce some code.

    But I don't quite understand your reasoning. If a developer wants to extend the column to add the ability to edit a url, there is no need for Telerik to implement a standard editor, as it is up to the developer to decide how the url should be edited. Also, it is a virtual method, not a setter, so I don't see how allowing developers to override it could cause any problems. If the subclass overrides CanEdit(...) to return true in some cases, then it is the responsibility of that subclass to provide the edit control.
  5. Marc Roussel
    Marc Roussel avatar
    429 posts
    Member since:
    Dec 2009

    Posted 02 Feb 2012 Link to this post

    Be able to edit a HyperLink is a good idea and I see that I will have to work around that lack.
    When the Row is in EditMode, hiting TAB to get to the hyperlink should have an internal implementation to edit the hyperlink as we are in edit mode but clicking it is all right when not editing the row.

    Of course as developers we can do it by Templating as Telerik suggests.
Back to Top