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

I can't see the columns in Master table

12 Answers 124 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Stavros
Top achievements
Rank 1
Stavros asked on 12 Nov 2008, 11:55 AM
When I go to Property Builder --> Master table --> Columns I can't see my database columns neither in Available columns pane nor in Selected columns pane.
Any idea why is this happening?

12 Answers, 1 is accepted

Sort by
0
Darren
Top achievements
Rank 2
answered on 12 Nov 2008, 12:14 PM
check to make sure "AutoGenerateColumns" is set to false. Then you'll have to setup your own columns by adding them using the Property Builder or in Source between <Columns></Columns>.

If AutoGenerateColumns is true then it would generate your columns at runtime which is why your not able to see them now.
0
Stavros
Top achievements
Rank 1
answered on 12 Nov 2008, 01:00 PM

AutoGenerateColumns

 

="False" in MasterTableView tag but if you see this example 
http://www.telerik.com/help/aspnet-ajax/grdgettingstarted.html
the user can see his database data in selected columns pane.

 

0
Darren
Top achievements
Rank 2
answered on 12 Nov 2008, 01:11 PM
If you currently run your project now, does your radgrid populate properly in your browser?

When you run your app for the first time it will generate the columns and you'll be able to see the columns in your source and should be able to see them in your prop builder. If i remember sometimes it does this and asks whether you want to refresh the schema in Visual Studio.
If you can't i'd just goto Column in Property Builder and select a Bound Column, add it then set it up myself. It should also work it's just a little more work. The important properties not to forget would be your DataField and UniqueName which must be exactly the same as the Column in your database.


0
Stavros
Top achievements
Rank 1
answered on 12 Nov 2008, 01:57 PM
I can easily enter the columns manually but how can I enter the correct data type?
(in the database I am using nchar, nvarchar, int, datetime)
0
Darren
Top achievements
Rank 2
answered on 12 Nov 2008, 02:01 PM
here is an example:

<Columns>
        <telerik:GridBoundColumn DataField="ReportId" DataType="System.Int32" 
            HeaderText="ReportId" ReadOnly="True" 
            SortExpression="ReportId" UniqueName="ReportId" Visible="False">
        </telerik:GridBoundColumn>
</Columns>
0
Stavros
Top achievements
Rank 1
answered on 12 Nov 2008, 02:12 PM
Thanx for the answers.
What type should I use for nchar and datetime?
0
Darren
Top achievements
Rank 2
answered on 12 Nov 2008, 02:16 PM
nvarchar you'd use:
DataType="System.String" 

datetime you have:
DataType="System.DateTime"

there is also: 
DataType="System.TimeSpan" 

intellisense can show you whats available.

0
Stavros
Top achievements
Rank 1
answered on 12 Nov 2008, 02:49 PM
Thanks a lot!
Btw what exactly does this visible attribute you used?
0
Stavros
Top achievements
Rank 1
answered on 13 Nov 2008, 10:55 AM
I suppose that if you set visible to false the column does not appear at the web page?
0
Princy
Top achievements
Rank 2
answered on 13 Nov 2008, 11:43 AM
Hello Stavros,

The Visible property for columns in the grid returns a Boolean value, indicating whether the cells corresponding to the column, would be visible on the client, and whether they would be rendered on the client. For more information on this property, refer to this link as well.

Thanks
Princy.



0
Stavros
Top achievements
Rank 1
answered on 13 Nov 2008, 12:28 PM
Thanx Princy.
One last question.
What about ReadOnly attribute?
When does this attribute is used?
Thank you all for your time.
0
Princy
Top achievements
Rank 2
answered on 14 Nov 2008, 07:40 AM
Hello Stavros,

Tha ReadOnly property of a column gets or sets a value indicating if this column's items will be visible/available for edit during EditMode of the grid, but will be visible in the NormalMode of the grid. Also refer to the following link for information on this attribute.
ReadOnly Property

Regards
Princy.


Tags
Grid
Asked by
Stavros
Top achievements
Rank 1
Answers by
Darren
Top achievements
Rank 2
Stavros
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or