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

Problem with RadGrid trial

1 Answer 65 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Benny Mengesha
Top achievements
Rank 1
Benny Mengesha asked on 13 Apr 2010, 09:40 AM
hello!

I downloaded a RadGrid that i want to try before i try i read the instructions
to implement the grid with the outlook skin.
http://demos.telerik.com/aspnet-ajax/window/examples/demoemail/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/Common/QSFInstructions/Instructions.html

i made the changes in the aspx file and i am trying to run the solution but i recive an exeption
that says.

The data source 'SessionDataSource1' only supports a single view named 'DefaultView'. You may also leave the view name (also called a data member) empty for the default view to be chosen

what do i do.

this is the Code:

<%

@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>

 

<%

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

 

<!

 

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

 

<

 

html xmlns="http://www.w3.org/1999/xhtml" >

 

<

 

head id="Head1" runat="server">

 

 

<!-- custom head section -->

 

 

<link href="Styles.css" rel="stylesheet" type="text/css" />

 

 

<style type="text/css">

 

 

.RadGrid th input

 

{

 

margin-top:0;

 

 

margin-bottom:0;

 

 

height:12px;

 

}

 

.OutlookTopBar

 

{

 

background-image: url(Img/outlookBarTop.gif);

 

 

background-color: white;

 

 

background-repeat: repeat-x;

 

 

padding-top: 3px;

 

 

border: 1px solid #002D96;

 

 

width: 180px;

 

 

font-size: 11px;

 

 

padding-left: 4px;

 

}

.OutlookTable

{

 

background-color:#c4dafa;

 

 

margin-top:4px;

 

}

.MailSubject

{

 

color: #808080;

 

}

.SelectedRow_Outlook

 

.MailSubject

 

{

 

color: white;

 

}

 

</style>

 

 

<!-- end of custom head section -->

 

</

 

head>

 

<

 

body class="BODY">

 

 

<form runat="server" id="mainForm" method="post">

 

 

<telerik:RadScriptManager ID="RadScriptManager1" runat="server" />

 

 

<!-- content start -->

 

 

<div style="background: url(img/bg.jpg) no-repeat; padding: 7px 5px; width:742px;">

 

 

<div style="font-size:13px;font-weight: bold;color:#15428b;padding: 4px 30px;"> <b>Outlook&reg;</b> style</div>

 

 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

 

 

<AjaxSettings>

 

 

<telerik:AjaxSetting AjaxControlID="RadGrid1">

 

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1"/>

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

</AjaxSettings>

 

 

</telerik:RadAjaxManager>

 

 

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />

 

 

 

 

<telerik:RadGrid ID="RadGrid1" runat="server" Width="741px" AllowSorting="True"

 

 

AllowMultiRowSelection="True" AllowPaging="True" ShowGroupPanel="True" GridLines="None"

 

 

AutoGenerateColumns="False" DataMember="Mails"

 

 

DataSourceID="SessionDataSource1">

 

 

<PagerStyle Mode="NextPrevAndNumeric">

 

 

</PagerStyle>

 

<

 

HeaderContextMenu EnableAutoScroll="True"></HeaderContextMenu>

 

 

<MasterTableView DataMember="Mails" AllowMultiColumnSorting="True"

 

 

Width="724px" TableLayout="Fixed" DataSourceID="SessionDataSource1">

 

 

<GroupByExpressions>

 

 

<telerik:GridGroupByExpression>

 

 

<SelectFields>

 

 

<telerik:GridGroupByField FieldAlias="Received" FieldName="Received" FormatString="{0:D}" HeaderValueSeparator=" from date: "></telerik:GridGroupByField>

 

 

</SelectFields>

 

 

<GroupByFields>

 

 

<telerik:GridGroupByField SortOrder="Descending" FieldName="Received" FormatString="" HeaderText="">

 

 

</telerik:GridGroupByField>

 

 

</GroupByFields>

 

 

</telerik:GridGroupByExpression>

 

 

</GroupByExpressions>

 

 

</MasterTableView>

 

 

<ClientSettings AllowDragToGroup="True">

 

 

<Selecting AllowRowSelect="True"></Selecting>

 

 

<Scrolling AllowScroll="True" UseStaticHeaders="True" ScrollHeight="275px"></Scrolling>

 

 

<ClientMessages DragToGroupOrReorder="Drag to group" />

 

 

</ClientSettings>

 

 

</telerik:RadGrid>

 

 

 

<asp:SqlDataSource ID="SessionDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"

 

ProviderName

 

="System.Data.SqlClient" SelectCommand="SELECT ProductID, ProductName, CategoryID, QuantityPerUnit, UnitPrice, UnitsInStock, Discontinued FROM [Products]"

 

DeleteCommand

 

="DELETE FROM [Products] WHERE [ProductID] = @ProductID" InsertCommand="INSERT INTO Products(ProductName, CategoryID, QuantityPerUnit, UnitPrice, UnitsInStock, Discontinued) VALUES (@ProductName, @CategoryID, @QuantityPerUnit, @UnitPrice, @UnitsInStock, @Discontinued)"

 

UpdateCommand

 

="UPDATE [Products] SET [ProductName] = @ProductName, [CategoryID] = @CategoryID, [QuantityPerUnit] = @QuantityPerUnit, [UnitPrice] = @UnitPrice, [UnitsInStock] = @UnitsInStock, [Discontinued] = @Discontinued WHERE [ProductID] = @ProductID AND [ProductName] = @ProductName AND [CategoryID] = @CategoryID AND [QuantityPerUnit] = @QuantityPerUnit AND [UnitPrice] = @UnitPrice AND [UnitsInStock] = @UnitsInStock AND [Discontinued] = @Discontinued"

 

 

OldValuesParameterFormatString="original_{0}" ConflictDetection="CompareAllValues">

 

 

<DeleteParameters>

 

 

<asp:Parameter Name="original_ProductID" Type="Int32" />

 

 

</DeleteParameters>

 

 

<UpdateParameters>

 

 

<asp:Parameter Name="ProductName" Type="String" />

 

 

<asp:Parameter Name="QuantityPerUnit" Type="String" />

 

 

<asp:Parameter Name="UnitPrice" Type="Decimal" />

 

 

<asp:Parameter Name="UnitsInStock" Type="Int16" />

 

 

<asp:Parameter Name="Discontinued" Type="Boolean" />

 

 

<asp:Parameter Name="original_ProductID" Type="Int32" />

 

 

<asp:Parameter Name="original_ProductName" Type="String" />

 

 

<asp:Parameter Name="original_QuantityPerUnit" Type="String" />

 

 

<asp:Parameter Name="original_UnitPrice" Type="Decimal" />

 

 

<asp:Parameter Name="original_UnitsInStock" Type="Int16" />

 

 

<asp:Parameter Name="original_Discontinued" Type="Boolean" />

 

 

</UpdateParameters>

 

 

<InsertParameters>

 

 

<asp:Parameter Name="ProductName" Type="String" />

 

 

<asp:Parameter Name="QuantityPerUnit" Type="String" />

 

 

<asp:Parameter Name="UnitPrice" Type="Decimal" />

 

 

<asp:Parameter Name="UnitsInStock" Type="Int16" />

 

 

<asp:Parameter Name="Discontinued" Type="Boolean" />

 

 

</InsertParameters>

 

</

 

asp:SqlDataSource>

 

 

</div>

 

 

<!-- content end -->

 

 

</form>

 

</

 

body>

 

</

 

html>

 

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 16 Apr 2010, 07:09 AM
Hi Benny,

Try removing the DataMember setting from the MasterTableView tag and leave only the DataSourceID and se if the error persists.

Regards,
Iana
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Benny Mengesha
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or