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

Custom Template Help Needed

4 Answers 15 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Murray
Top achievements
Rank 2
Murray asked on 28 Aug 2012, 11:20 PM
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?

4 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 29 Aug 2012, 05:46 AM
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.

0
Murray
Top achievements
Rank 2
answered on 29 Aug 2012, 10:52 AM
Yes I considered that, however we auto generate the rest of the columns.
0
Accepted
Dimitrina
Telerik team
answered on 29 Aug 2012, 10:55 AM
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.

0
Murray
Top achievements
Rank 2
answered on 29 Aug 2012, 01:41 PM
Thank you Didie

I can have our devs add this as a class so we can use it globally.
Tags
GridView
Asked by
Murray
Top achievements
Rank 2
Answers by
Dimitrina
Telerik team
Murray
Top achievements
Rank 2
Share this question
or