Custom Template Help Needed

5 posts, 1 answers
  1. Murray
    Murray avatar
    121 posts
    Member since:
    Aug 2010

    Posted 28 Aug 2012 Link to this post

    Ok this is a strange one and I've tried all I can, but need some help.

    I need a GridView which is:
    • IsReadOnly="True"
    • ShowInsertRow=True"
    • CanUserInsertRows="True"
    • CanUserDeleteRows="True"

    I have  ReadOnly GridView but I want the InsertRow button to visible. We have this button wired up to open a dialog from which we make a selection and add that selection to the GridView. We can do all this with a IsReadOnly="False" grid but we need to block the user from editing the values in this grid.

    I tried setting the "PART_GridViewVirtualizingPanel" in the template to IsHitTestVisible="False" but unfortunately we have another requirement... the first Column in the grid is Templated with a RadButton, who's command is to remove the Row! If I set the "PART_GridViewVirtualizingPanel" to be IsHitTestVisible="False", then the templated RadButton in this column is also IsHitTestVisible="False".

    I hope I'm making some form of sense so far?

    Question?
    Is there any way to modify the template for a GridView to make the content ReadOnly and yet have the InsertRow area visible and clickable?

  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 29 Aug 2012 Link to this post

    Hello,

     You say that you have the button wired up to open a dialogue. In that case you can set the IsReadOnly property for all of the columns, not for the GridView.

    I hope this helps.

    Regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. Murray
    Murray avatar
    121 posts
    Member since:
    Aug 2010

    Posted 29 Aug 2012 Link to this post

    Yes I considered that, however we auto generate the rest of the columns.
  5. Answer
    Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 29 Aug 2012 Link to this post

    Hello,

    You can handle the AutoGeneratingColumn event of the grid and change the properties for the generated column. 

    Regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  6. Murray
    Murray avatar
    121 posts
    Member since:
    Aug 2010

    Posted 29 Aug 2012 Link to this post

    Thank you Didie

    I can have our devs add this as a class so we can use it globally.
Back to Top
DevCraft banner