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

[Solved] Unbound one column grid

4 Answers 178 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.
Aaron
Top achievements
Rank 1
Aaron asked on 10 Jan 2011, 04:26 PM
I have looked through the forums and documentation but I'm still not sure how to add 6 static rows to a one column grid. These row's values are text only and won't change and I would like them to show at design time so I need a way to add them through the xaml. I like the look and feel of the grid otherwise I would just use a listbox, etc. 
Thanks!

4 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 11 Jan 2011, 06:12 PM
Hi Aaron,

You can use this approach:

<telerik:RadGridView>
    <telerik:RadGridView.Items>
        <sys:String>item 1</sys:String>
        <sys:String>item 2</sys:String>
        <sys:String>item 3</sys:String>
        <sys:String>item 4</sys:String>
        <sys:String>item 5</sys:String>
        <sys:String>item 6</sys:String>
    </telerik:RadGridView.Items>
</telerik:RadGridView>

Hope this helps.

All the best,
Vanya Pavlova
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Aaron
Top achievements
Rank 1
answered on 11 Jan 2011, 06:51 PM
Thanks Vanya. I appreciate you looking into this. Here is the xaml with your example but I'm not seeing the values show at design or run-time.

<telerik:RadGridView Name="Sections" CanUserReorderColumns="False" IsFilteringAllowed="False" IsReadOnly="True" CanUserFreezeColumns="False" CanUserResizeColumns="False" RowIndicatorVisibility="Collapsed" ShowGroupPanel="False" CanUserInsertRows="False" CanUserDeleteRows="False" BorderThickness="0" AutoGenerateColumns="False" RowHeight="20" >
    <telerik:RadGridView.Columns>
        <telerik:GridViewColumn Width="200"/>
    </telerik:RadGridView.Columns>
    <telerik:RadGridView.Items>
        <sys:String>item 1</sys:String>
        <sys:String>item 2</sys:String>
        <sys:String>item 3</sys:String>
        <sys:String>item 4</sys:String>
        <sys:String>item 5</sys:String>
        <sys:String>item 6</sys:String>
    </telerik:RadGridView.Items>
</telerik:RadGridView>
0
Accepted
Vanya Pavlova
Telerik team
answered on 12 Jan 2011, 01:53 PM
Hello Aaron,

 

Having in mind the fact that RadGridView's AutoGenerateColumns property is set to False just replace the GridViewColumn with GridViewDataColumn and everything will work as expected, you may find attached the sample project that demonstrates this approach.

If you need any further assistance please let me know.

Kind regards,
Vanya Pavlova
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Aaron
Top achievements
Rank 1
answered on 12 Jan 2011, 03:10 PM
Thank you very much Vanya. That worked. 
Tags
GridView
Asked by
Aaron
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Aaron
Top achievements
Rank 1
Share this question
or