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

RadGrid Displaying one column

2 Answers 27 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ravi Prasad Potturi
Top achievements
Rank 1
Ravi Prasad Potturi asked on 17 Sep 2008, 06:35 PM
Hi,

          I am beginer using telerik controls. Grid is displaying only one column even i defined six columns.

           Grid is displaying properly when i add "CommandItemDisplay="Top""  in  MasterTableView section with "Add new Reord and refresh " options.

              I want to display the data with sorting and paging.

Can you please help to solve this issue?

Thanks
Ravi




<%

@ Control Language="C#" AutoEventWireup="true" ClassName="Vehicles" CodeFile="Vehicles.ascx.cs" Inherits="Dealer_Vehicles" %>

<%

@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<table style="width:95%;" border = "1">

<tr>

<td align="left">

<!-- <asp:Button ID="tempbtnSearch" runat="server" CausesValidation="false" OnClientClick="LookupParameter()" SkinID="DisplayButton"

Text="Search" /> -->

<!-- <asp:Button ID="btnSearch" runat="server" CausesValidation="false" SkinID="DisplayButton"

OnClientClick = "return ShowInsertForm();" Text="Search" /> -->

&nbsp;

</td>

</tr>

<tr>

<td >

<telerik:RadGrid

ID="grdVehicles"

runat="server"

AllowPaging="True"

AllowSorting="True"

PageSize="10"

GridLines="None"

OnNeedDataSource="RadGrid1_NeedDataSource"

EnableAJAX="true"

Skin="Vista"

ShowFooter="false"

ShowStatusBar = "false"

>

<PagerStyle Mode="NumericPages" />

<MasterTableView

AutoGenerateColumns="False"

Width="100%"

PageSize="15"

TableLayout="Fixed">

<Columns>

<telerik:GridBoundColumn

DataField="MODEL_YEAR"

HeaderText="Model year"

SortExpression="MODEL_YEAR"

UniqueName="MODEL_YEAR"

DataFormatString = "<nobr>{0}</nobr>"

ItemStyle-CssClass ="RadGridItemTemplate"

HeaderStyle-Wrap="false"

HeaderStyle-HorizontalAlign="Center"

ItemStyle-HorizontalAlign="Center"

HeaderStyle-Font-Bold="true"

>

</telerik:GridBoundColumn>

<telerik:GridBoundColumn

DataField="TYPE"

HeaderText="Product Type"

ReadOnly="True"

SortExpression="TYPE"

UniqueName="TYPE"

DataFormatString = "<nobr>{0}</nobr>"

ItemStyle-CssClass ="RadGridItemTemplate"

HeaderStyle-HorizontalAlign="Center"

ItemStyle-HorizontalAlign="Center"

HeaderStyle-Font-Bold="true"

HeaderStyle-Wrap = "false"

>

</telerik:GridBoundColumn>

<telerik:GridBoundColumn

DataField="VIN"

HeaderText="VIN"

SortExpression="VIN"

UniqueName="VIN"

DataFormatString = "<nobr>{0}</nobr>"

ItemStyle-CssClass ="RadGridItemTemplate"

HeaderStyle-HorizontalAlign="Center"

ItemStyle-HorizontalAlign="Center"

HeaderStyle-Font-Bold="true"

HeaderStyle-Wrap = "false"

>

</telerik:GridBoundColumn>

<telerik:GridBoundColumn

DataField="COLOR"

HeaderText="Color"

SortExpression="COLOR"

UniqueName="COLOR"

DataFormatString = "<nobr>{0}</nobr>"

ItemStyle-CssClass ="RadGridItemTemplate"

HeaderStyle-HorizontalAlign="Center"

ItemStyle-HorizontalAlign="Center"

HeaderStyle-Font-Bold="true"

HeaderStyle-Wrap = "false"

>

</telerik:GridBoundColumn>

<telerik:GridBoundColumn

DataField="MODEL_CLASS_CODE"

HeaderText="Class Code"

SortExpression="MODEL_CLASS_CODE"

UniqueName="MODEL_CLASS_CODE"

DataFormatString = "<nobr>{0}</nobr>"

ItemStyle-CssClass ="RadGridItemTemplate"

HeaderStyle-Wrap="false"

HeaderStyle-HorizontalAlign="Center"

ItemStyle-HorizontalAlign="Center"

HeaderStyle-Font-Bold="true"

>

</telerik:GridBoundColumn>

<telerik:GridBoundColumn

DataField="MODEL_CLASS_DESC"

HeaderText="Class Description"

SortExpression="MODEL_CLASS_DESC"

UniqueName="MODEL_CLASS_DESC"

DataFormatString = "<nobr>{0}</nobr>"

ItemStyle-CssClass ="RadGridItemTemplate"

HeaderStyle-HorizontalAlign="Center"

ItemStyle-HorizontalAlign="Center"

HeaderStyle-Font-Bold="true"

HeaderStyle-Wrap = "false"

>

</telerik:GridBoundColumn>

</Columns>

</MasterTableView>

</telerik:RadGrid>

</td>

</tr>

</table>

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 18 Sep 2008, 04:07 AM
Hi Ravi,

I did not find any thing wrong with the above given code. Please verify that the DataFields set for the rest of the columns and those present in the DataBase are same.

Refer the following demo links to get more details on Paging and Sorting.
Basic paging
Basic sorting

Regards
Shinu
0
Sudipta Burman
Top achievements
Rank 1
answered on 30 Sep 2008, 12:36 AM
Shinu,

           I am able to see all columns and data when  i add "CommandItemDisplay="Top""  in  MasterTableView section. So i don't think this is data base issue. I am having the same issue without paging and sorting.

Can you please look into this?

Thanks
Ravi



Tags
Grid
Asked by
Ravi Prasad Potturi
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Sudipta Burman
Top achievements
Rank 1
Share this question
or