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

[Solved] Having Difficulty Templating GridView

4 Answers 141 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Stephen Kennedy
Top achievements
Rank 1
Stephen Kennedy asked on 13 Jan 2010, 12:42 AM
Hello,

I am attempting to modify some cell templates using your RadGridView control.  I am using SIlverlight 4 with Visual Studio 2010 beta 2. 
While I have installed the Q3 2009 SP1 release, I created a test project and had it reference the dlls inside the latest internal build 00371RadControls_for_Silverlight_2009_3_1219_Trial) to get around the issue of a right click crashing Blend.

Now while I am quite comfortable with playing with Silverlight XAML inside Visual Studio I am a complete Blend novice.  I have tried following the instructions that come with your control suite but my experience differs from what is expected.

If I follow the instructions for 'Templating a Cell' inside the RadControls for Silverlight Documentation I am able to add the cell to my screen and create a template copy for it.  However, I do not see any of the Disabled state group, and the only PART I can see and edit is the PART_EditorPresenter.

I have similar issues if I follow the instructions for 'Templating the RadGridView' in that I seem to be missing states and parts to edit.

The project I am working with is just a temporary one that I am using to try and pull across the templates into my main project, it contains no other controls or code outside of the documentation instructions.  This issue occurs for me in Expression Blend 3, and Expression Blend 4 Preview for .Net 4.0.

Chances are that it is my inexperience with Blend that is causing me these issues, but is there any known issue with the latest internal build not propogating across these fields into Blend?

4 Answers, 1 is accepted

Sort by
0
Kalin Milanov
Telerik team
answered on 15 Jan 2010, 10:40 AM
Hello Stephen Kennedy,

The steps explained in the documentation are correct although I fear the online resources available on the subject are falling behind the actual templates of the control. Even though the differences are not (in most cases) substantial they may temper with the expectations you are having about styling the controls. That being said our blend support is not where we want it to be and providing a seamless experience is our top priority for Q1.
 
I would very much like to help you with your difficulties but I would need a bit more specific information in order to do so.

Regards,
Kalin Milanov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Stephen Kennedy
Top achievements
Rank 1
answered on 17 Jan 2010, 11:30 PM
Hi Kalin,

I have been using the supplied documentation with the installer, not the online documentation.

I just downloaded SP2 and I am still only seeing the PART_EditorPresenter inside the Parts tab when I.

1.  Add a GrdiViewCell to a user control
2.  Right click on the cell, Select Edit Template, Edit a Copy.
3.  Accept the default values and click OK.
4.  Go the parts tab of the newly created control template.  I do not see the PART_CellBorder or the PART_ContentPresenter, and I do not see any states inside the State tab.

I am following the instructions on my local machine at ms-help://telerik.windows.controls.Silverlight/telerik.windows.controls.gridview/gridview-templating-cell.html

Again this could because of my lack of experience with Blend.

In terms of what I am trying to achieve.  I want to be able to alter the template of a cell as it is displayed on the grid.  And there is the potential that I will also need to alter the template of a cell when it is being edited as well.  To be honest the only reason I am using Blend is that is because your instructions for editing templates use this application. 

I have found a forum post here where Hristo has detailed some XAML on how to change a cells background based on data (which I will also need to do).  If I follow what has perscribed in his XAML if I want to edit a content template all I need to do is to change the relevant {TemplateBinding ContentTemplate} assignment to my own template?

Thanks,

Stephen
0
Accepted
Kalin Milanov
Telerik team
answered on 20 Jan 2010, 09:58 AM
Hello Stephen Kennedy,

Attached I am sending you a sample solution which includes a GridView and a GridViewCell alongside with the cell template. You can edit the template as to your requirements and it will automatically apply its style to the cells of the grid.

There are issues however. It might be possible you get invalid XAML in blend for the BorderThickness property of the PART_CellBorder. For some reason Blend does not like bindings like the one there and we are working on a resolution around it. If you remove the property Blend will work as it should and will let you see the template and the visual styles.

Again I do not believe there is something you are doing wrong, rather it is a shortcoming on our end and one we are heavily working on. As for dynamically changing cell properties I would suggest you take a look at this blog for more info and sample code.

Best wishes,
Kalin Milanov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Stephen Kennedy
Top achievements
Rank 1
answered on 20 Jan 2010, 08:03 PM
Thanks Kalin,

Exactly what I was looking for.
Tags
GridView
Asked by
Stephen Kennedy
Top achievements
Rank 1
Answers by
Kalin Milanov
Telerik team
Stephen Kennedy
Top achievements
Rank 1
Share this question
or