Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
225 views
Hi,
I am using Rad Editor with deafult tool set,
when i paste contents like Text, Tables, Images from Ms Word file ,
1)The copied table in editor gets misaligned and not complete visible, i have tried with StripFormattingOnPaste="MSWordRemoveAll,Span,Css,Font" in source code ,it shows complete table but format gets changed like font color, border etc.
2)Also images are not get copied from the word document.

please have look on attached screenshot.
Thanks
Rahul Khinvasara
Top achievements
Rank 1
 answered on 28 Jan 2010
1 answer
131 views
Hi there,
This i smy first use of the Rad AJAX controls and I am a bit stuck.

I followed the Getting Started instructions at:
http://www.telerik.com/help/aspnet-ajax/radfileexplorer-getting-started.html

And when I run my app I can see the File Exporer with a file I put into the folder.
But all of the menu items other than Open are greyed out.
I can see Open and Copy in the right click menu but the rest are grey.

Selecting Open causes the following error:
#########################################################################################################

Server Error in '/' Application.

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

Requested URL: /~/Files/dfbsfrbsfb.txt

#########################################################################################################

I can browse to this file using:  http://localhost:49573/Files/dfbsfrbsfb.txt
I have given the ASP.NET Machine Account Modify/Read/Write?List access to this folder.

What am I doing wrong?

Thanks for any help
Richard

Visual Studio 2008
.NET 3.5
XP Sp3
IE 7 and Firefox 3.5.7



P.S. The Onliner help for File Explorer (using the arrow at the top of the component )is a broken link.

Fiko
Telerik team
 answered on 28 Jan 2010
2 answers
474 views
Hi

I have had trouble on an older site with cross-site scripting attacks and I want to be extra sure that I have the proper level of validation in place for upgrading the site.

My question is:

If I have a RadGrid with template columns and the editForm in window mode, and use the standard asp.net validators,
with - regular expression validation for best security -  what happens if the attacker has javascript turned off (the usual case)?

IE does the server side equivalent validation take place anyway, and prevent the postback?

And if not, how do I add the server side validation? ie get access to the edit or insert data before it is irrevocably
saved to the database.

Additionally I would want to check for the insertion of words like script, select, insert, update, delete, files with .js extension etc.

Thanks!

Clive
Tsvetoslav
Telerik team
 answered on 28 Jan 2010
1 answer
323 views

When applying round to top corners on a Bar chart doesn't give the results I was looking for for negative values.
On the bars presenting negative values the actual top corners are rounded not the corners that are furtherst away from the axis.

This markup for a chart displays this:

<telerik:RadChart ID="RadChart1" runat="server" > 
   <Series> 
      <telerik:ChartSeries Name="Series 1">  
         <Appearance Corners="Round, Round, Rectangle, Rectangle, 3">  
         </Appearance> 
         <Items> 
            <telerik:ChartSeriesItem Name="Item 1" YValue="10">  
            </telerik:ChartSeriesItem> 
            <telerik:ChartSeriesItem Name="Item 2" YValue="30">  
            </telerik:ChartSeriesItem> 
            <telerik:ChartSeriesItem Name="Item 3" YValue="-10">  
            </telerik:ChartSeriesItem> 
            <telerik:ChartSeriesItem Name="Item 4" YValue="10">  
            </telerik:ChartSeriesItem> 
         </Items> 
      </telerik:ChartSeries> 
   </Series> 
   <ChartTitle> 
      <TextBlock Text="Rounded Negative Corner">  
         <Appearance TextProperties-Color="Black" TextProperties-Font="Arial, 18pt">  
         </Appearance> 
      </TextBlock> 
   </ChartTitle> 
</telerik:RadChart> 

A workaround for this is simple for static chart (like the one above) all that is needed is to apply <Appearance Corners="Rectangle, Rectangle, Round, Round, 3" /> to the items with negative values.
The following code (C#) does this on itemDataBound for charts that are databound.
        protected void RadChart1_ItemDataBound(object sender, Telerik.Charting.ChartItemDataBoundEventArgs e)  
        {  
                if (e.SeriesItem.YValue < 0)  
                {  
                    e.SeriesItem.Appearance.Corners.BottomLeft = Telerik.Charting.Styles.CornerType.Round;  
                    e.SeriesItem.Appearance.Corners.BottomRight = Telerik.Charting.Styles.CornerType.Round;  
                    e.SeriesItem.Appearance.Corners.TopLeft = Telerik.Charting.Styles.CornerType.Rectangle;  
                    e.SeriesItem.Appearance.Corners.TopRight = Telerik.Charting.Styles.CornerType.Rectangle;  
                }  
        } 

Hope this can be of help to someone.
Ves
Telerik team
 answered on 28 Jan 2010
1 answer
130 views
Hi

I am trying to :
a. create a header text for my OrderId column in my nested grid and the specific Employee, something like: "Orders for <Last Name> "
b. when i press the Go button I would like to display the EmployeeID?

thanks

D

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="NestedNew.aspx.vb" Inherits="NestedNew" %> 
 
<%@ 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"> 
</head> 
<body class="BODY"> 
    <form runat="server" id="mainForm" method="post"> 
    <telerik:RadScriptManager runat="server" ID="ScriptManager1"> 
    </telerik:RadScriptManager> 
    <!-- content start --> 
    <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" OnPreRender="RadGrid1_PreRender" DataSourceID="SqlDataSource1" 
        runat="server" AutoGenerateColumns="False" AllowSorting="True" AllowMultiRowSelection="False" 
        AllowPaging="True" PageSize="5" GridLines="None" ShowGroupPanel="true"> 
        <PagerStyle Mode="NumericPages"></PagerStyle> 
        <MasterTableView DataSourceID="SqlDataSource1" DataKeyNames="EmployeeID" AllowMultiColumnSorting="True" 
            GroupLoadMode="Server"> 
            <NestedViewTemplate> 
                <asp:Label ID="label1" runat="server" Text='<%# Eval ("EmployeeID") %>'></asp:Label> 
                <asp:Label ID="label2" runat="server" Text='<%# Eval ("LastName") %>'></asp:Label> 
                <asp:Panel runat="server" ID="InnerContainer" CssClass="viewWrap" Visible="false"> 
                    <telerik:RadGrid runat="server" ID="OrdersGrid" DataSourceID="ObjectDataSource1" OnItemDataBound="onitemdatabound" 
                        OnItemCommand="onitemnested_command" ShowFooter="true" AllowSorting="true" EnableLinqExpressions="false"> 
                        <MasterTableView ShowHeader="true" AutoGenerateColumns="true" AllowPaging="true" 
                            DataKeyNames="OrderID" PageSize="7" HierarchyLoadMode="ServerOnDemand"> 
                            <Columns> 
                                <telerik:GridEditCommandColumn> 
                                </telerik:GridEditCommandColumn> 
                            </Columns> 
                            <EditFormSettings EditFormType="Template"> 
                                <FormTemplate> 
                                    <asp:Button ID="btninsert" runat="server" CommandName="PerformInsert" Text="go" /> 
                                </FormTemplate> 
                            </EditFormSettings> 
                        </MasterTableView> 
                    </telerik:RadGrid> 
                           <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetEmployeeid" 
                    TypeName="EmployeesODS"> 
                    <SelectParameters> 
                        <asp:ControlParameter ControlID="Label1" Name="empid" PropertyName="Text" 
                            Type="String" /> 
                    </SelectParameters> 
                </asp:ObjectDataSource> 
                    <asp:SqlDataSource ID="SqlDataSource3" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" 
                        ProviderName="System.Data.SqlClient" SelectCommand="SELECT OrderID, [Order Details].UnitPrice, Quantity, Discount, Products.ProductName FROM ([Order Details] LEFT JOIN Products on [Order Details].ProductID = Products.ProductID) where OrderID = @OrderID" 
                        runat="server"> 
                        <SelectParameters> 
                            <asp:SessionParameter Name="OrderID" SessionField="OrderID" Type="Int32" /> 
                        </SelectParameters> 
                    </asp:SqlDataSource> 
                </asp:Panel> 
          
            </NestedViewTemplate> 
            <Columns> 
                <telerik:GridBoundColumn SortExpression="FirstName" HeaderText="First Name" HeaderButtonType="TextButton" 
                    DataField="FirstName" UniqueName="FirstName"> 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn SortExpression="LastName" HeaderText="Last Name" HeaderButtonType="TextButton" 
                    DataField="LastName" UniqueName="LastName"> 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn SortExpression="Title" HeaderText="Title" HeaderButtonType="TextButton" 
                    DataField="Title" UniqueName="Title"> 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn SortExpression="BirthDate" DataFormatString="{0:MM/dd/yyyy}" 
                    HeaderText="Birth Date" HeaderButtonType="TextButton" DataField="BirthDate" UniqueName="BirthDate"> 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn SortExpression="City" HeaderText="City" HeaderButtonType="TextButton" 
                    DataField="City" UniqueName="City"> 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn SortExpression="Country" HeaderText="Country" HeaderButtonType="TextButton" 
                    DataField="Country" UniqueName="Country"> 
                </telerik:GridBoundColumn> 
            </Columns> 
        </MasterTableView> 
        <ClientSettings AllowDragToGroup="true" /> 
    </telerik:RadGrid> 
    <asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" 
        ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM Employees" 
        runat="server"></asp:SqlDataSource> 
    <!-- content end --> 
    </form> 
</body> 
</html> 
 

Imports Telerik.Web.UI 
Imports System 
Imports System.Data 
Imports System.Data.SqlClient 
Imports System.Web.UI.WebControls 
Imports System.Configuration 
 
Partial Class NestedNew 
    Inherits System.Web.UI.Page 
 
    Protected Sub RadGrid1_PreRender(ByVal sender As Object, ByVal e As EventArgs) Handles RadGrid1.PreRender 
        If Not Page.IsPostBack Then 
            RadGrid1.MasterTableView.Items(0).Expanded = True 
            RadGrid1.MasterTableView.Items(0).ChildItem.FindControl("InnerContainer").Visible = True 
        End If 
    End Sub 
 
    Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As GridCommandEventArgs) Handles RadGrid1.ItemCommand 
        If e.CommandName = RadGrid.ExpandCollapseCommandName Then 
 
            Session("EmployeeName") = DirectCast(source, Telerik.Web.UI.RadGrid).MasterTableView.Items(e.Item.ItemIndex)("LastName").Text 
            DirectCast(e.Item, GridDataItem).ChildItem.FindControl("InnerContainer").Visible = Not e.Item.Expanded 
        End If 
 
 
    End Sub 
 
    Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As GridItemEventArgs) Handles RadGrid1.ItemCreated 
        If TypeOf e.Item Is GridNestedViewItem Then 
            e.Item.FindControl("InnerContainer").Visible = (DirectCast(e.Item, GridNestedViewItem)).ParentItem.Expanded 
        End If 
    End Sub 
 
 
    Public Shared Function GetDataTable(ByVal query As String) As DataTable 
        Dim ConnString As String = ConfigurationManager.ConnectionStrings("NorthwindConnectionString").ConnectionString 
        Dim conn As SqlConnection = New SqlConnection(ConnString) 
        Dim adapter As SqlDataAdapter = New SqlDataAdapter 
        adapter.SelectCommand = New SqlCommand(query, conn) 
        Dim table1 As New DataTable 
        conn.Open() 
        Try 
            adapter.Fill(table1) 
        Finally 
            conn.Close() 
        End Try 
        Return table1 
    End Function 
 
  
 
    Protected Sub onitemnested_command(ByVal source As Object, ByVal e As GridCommandEventArgs) 
        If e.CommandName = RadGrid1.PerformInsertCommandName Then 
            'write the employeeid 
            'Response.Write(label1.text) 
        End If 
    End Sub 
 
    Protected Sub onitemdatabound(ByVal sender As Object, ByVal e As GridItemEventArgs) 
        If e.Item.ItemType = GridItemType.Header And Not Session("EmployeeName") Is Nothing Then 
            Dim hd As GridHeaderItem = e.Item 
            hd("OrderID").Text = " the orders for " + Session("EmployeeName").ToString() 
 
 
        End If 
    End Sub 
End Class 
 


App_Code folder :

Imports Microsoft.VisualBasic 
 
Imports Telerik.Web.UI 
Imports System 
Imports System.Data 
Imports System.Data.SqlClient 
Imports System.Web.UI.WebControls 
Imports System.Configuration 
 
Public Class EmployeesODS 
    Public Shared Function GetEmployeeid(ByVal empid As String) As ArrayList 
 
        Dim arr As New ArrayList 
 
 
        For Each dr As DataRow In GetDataTable("Select * from orders where employeeid='" + empid + "'").Rows 
 
            Dim emp As New Employee 
            emp.EmployeeID = dr("EmployeeID") 
            emp.OrderId = dr("OrderID") 
            arr.Add(emp) 
        Next 
 
        Return arr 
    End Function 
 
    Public Shared Function GetDataTable(ByVal query As String) As DataTable 
        Dim ConnString As String = ConfigurationManager.ConnectionStrings("NorthwindConnectionString").ConnectionString 
        Dim conn As SqlConnection = New SqlConnection(ConnString) 
        Dim adapter As SqlDataAdapter = New SqlDataAdapter 
        adapter.SelectCommand = New SqlCommand(query, conn) 
        Dim table1 As New DataTable 
        conn.Open() 
        Try 
            adapter.Fill(table1) 
        Finally 
            conn.Close() 
        End Try 
        Return table1 
    End Function 
End Class 
 
 
Public Class Employee 
    Private _OrderId As String 
    Private _CompanyName As String 
    Private _EmployeeID As String 
 
 
 
    Public Property CompanyName() As String 
        Get 
            Return _CompanyName 
        End Get 
        Set(ByVal value As String) 
            _CompanyName = value 
        End Set 
    End Property 
 
    Public Property EmployeeID() As String 
        Get 
            Return _EmployeeID 
        End Get 
        Set(ByVal value As String) 
            _EmployeeID = value 
        End Set 
    End Property 
 
    Public Property OrderId() As String 
        Get 
            Return _OrderId 
        End Get 
        Set(ByVal value As String) 
            _OrderId = value 
        End Set 
    End Property 
 
 
End Class 
 

Rosen
Telerik team
 answered on 28 Jan 2010
1 answer
118 views
Hello,
I'd used bar chart, line chart and bezier chart to show the same data, both of bar chart and line chart were going well, however, when selecting bezier chart, I got the error message shown in the clip, is there any ways to capture error and do some external work to prevent this yellow page?

Regards,

Ves
Telerik team
 answered on 28 Jan 2010
1 answer
213 views
Hello,

I try to use a hierarchical grid using entity-data. Viewing, updating both entities works fine but inserting doesn´t work. I get "Object reference not set to an instance of an object." in " System.Web.UI.WebControls.EntityDataSourceView.ConvertWCProperty(IDictionary values, Dictionary`2 convertedValues, List`1 visitedProperties, PropertyDescriptor pd, ParameterCollection referenceParameters, Dictionary`2& exceptions)"

Here is my code:

<asp:EntityDataSource ID="ordersDS" runat="server" ConnectionString="name=oscEnties" 
        DefaultContainerName="oscEnties" EnableDelete="False" EnableInsert="True" EnableUpdate="True" 
        EntitySetName="i_orders" Include="orderparts"> 
    </asp:EntityDataSource> 
    <asp:EntityDataSource ID="orderpartDS" runat="server" ConnectionString="name=oscEnties" 
        DefaultContainerName="oscEnties" EnableDelete="false" EnableInsert="True" EnableUpdate="True" 
        EntitySetName="i_orderpart" Where="it.order.orderid==@orderid"> 
        <InsertParameters> 
            <asp:Parameter Name="order.orderid" Type="Int32" /> 
        </InsertParameters> 
    </asp:EntityDataSource> 
     
     
    <telerik:RadGrid ID="ordersGrid" runat="server" ShowGroupPanel="True" GridLines="None" 
        OnItemCommand="ordersGrid_ItemCommand" AllowAutomaticInserts="True" DataSourceID="ordersDS" 
        AllowFilteringByColumn="True" AllowAutomaticUpdates="true" AllowSorting="True" 
        AutoGenerateColumns="False"> 
        <HeaderContextMenu> 
            <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
        </HeaderContextMenu> 
        <ClientSettings AllowKeyboardNavigation="true" EnablePostBackOnRowClick="true"> 
            <Selecting AllowRowSelect="true" /> 
        </ClientSettings> 
        <MasterTableView GroupLoadMode="client" AutoGenerateColumns="False" DataKeyNames="orderid" 
            CommandItemDisplay="Top"> 
            <DetailTables> 
                <telerik:GridTableView DataSourceID="orderpartDS" DataKeyNames="orderpartid" AutoGenerateColumns="false" 
                    AllowAutomaticUpdates="true" AllowAutomaticInserts="true" CommandItemDisplay="Top" 
                    AllowFilteringByColumn="false"> 
                    <ParentTableRelation> 
                        <telerik:GridRelationFields DetailKeyField="orderid" MasterKeyField="orderid" /> 
                    </ParentTableRelation> 
                    <NoRecordsTemplate> 
                        Hittade inga orderdelar 
                    </NoRecordsTemplate> 
                    <Columns> 
                        <telerik:GridBoundColumn DataField="orderpartid" DataType="System.Int32" HeaderText="ID" 
                            ReadOnly="True" SortExpression="orderpartid" UniqueName="orderpartid"> 
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="ordername" HeaderText="Namn" SortExpression="ordername" DataType="System.String" 
                            UniqueName="ordername"> 
                        </telerik:GridBoundColumn> 
                        <telerik:GridDateTimeColumn DataField="orderdate" DataType="System.DateTime" DataFormatString="{0:d}" 
                            HeaderText="Ankommande" UniqueName="orderdate" SortExpression="orderdate"> 
                        </telerik:GridDateTimeColumn> 
                        <telerik:GridDateTimeColumn DataField="shippingdate" DataType="System.DateTime" DataFormatString="{0:d}" 
                            HeaderText="Ankommande" UniqueName="shippingdate" SortExpression="shippingdate"> 
                        </telerik:GridDateTimeColumn> 
                        <telerik:GridDateTimeColumn DataField="arrivaldate" DataType="System.DateTime" DataFormatString="{0:d}" 
                            HeaderText="Ankommande" UniqueName="arrivaldate" SortExpression="arrivaldate"> 
                        </telerik:GridDateTimeColumn> 
                        <telerik:GridNumericColumn DataField="currency" DataType="System.Double" HeaderText="Växelkurs" 
                            UniqueName="currency" SortExpression="currency" NumericType="Number" KeepNotRoundedValue="true"> 
                        </telerik:GridNumericColumn> 
                        <telerik:GridNumericColumn DataField="freightcost" DataType="System.Double" HeaderText="Fraktkostnad" 
                            UniqueName="freightcost" SortExpression="freightcost" NumericType="Number" KeepNotRoundedValue="true"> 
                        </telerik:GridNumericColumn> 
                        <telerik:GridNumericColumn DataField="order.orderid" DataType="System.Int32" HeaderText="OrderId" 
                            UniqueName="order.orderid" SortExpression="order.orderid" Visible="true" ReadOnly="false"> 
                        </telerik:GridNumericColumn> 
                        <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"> 
                            <ItemStyle CssClass="MyImageButton" /> 
                        </telerik:GridEditCommandColumn> 
                    </Columns> 
                    <EditFormSettings ColumnNumber="2" CaptionFormatString="Ändra orderdel"> 
                        <FormTableItemStyle Wrap="False"></FormTableItemStyle> 
                        <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle> 
                        <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="1" BackColor="White" 
                            Width="100%" /> 
                        <FormTableStyle CellSpacing="0" CellPadding="2" Height="60px" BackColor="White" /> 
                        <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle> 
                        <EditColumn ButtonType="ImageButton" InsertText="Lägg till" UpdateText="Uppdatera" 
                            UniqueName="EditCommandColumn1" CancelText="Avbryt"> 
                        </EditColumn> 
                    </EditFormSettings> 
                </telerik:GridTableView> 
            </DetailTables> 
            <NoRecordsTemplate> 
                Hittade inga ordrar 
            </NoRecordsTemplate> 
            <Columns> 
                <telerik:GridBoundColumn DataField="orderid" DataType="System.Int32" HeaderText="ID" 
                    ReadOnly="True" SortExpression="orderid" UniqueName="orderid"> 
                </telerik:GridBoundColumn> 
                <telerik:GridCheckBoxColumn DataField="open" DataType="System.SByte" HeaderText="Öppen för best." 
                    SortExpression="open" UniqueName="open"> 
                </telerik:GridCheckBoxColumn> 
                <telerik:GridBoundColumn DataField="ordername" HeaderText="Namn" SortExpression="ordername" 
                    UniqueName="ordername"> 
                </telerik:GridBoundColumn> 
                <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"> 
                    <ItemStyle CssClass="MyImageButton" /> 
                </telerik:GridEditCommandColumn> 
            </Columns> 
            <EditFormSettings ColumnNumber="2" CaptionDataField="ordername" CaptionFormatString="Ändra pÃ¥ order: {0}"> 
                <FormTableItemStyle Wrap="False"></FormTableItemStyle> 
                <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle> 
                <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="1" BackColor="White" 
                    Width="100%" /> 
                <FormTableStyle CellSpacing="0" CellPadding="2" Height="60px" BackColor="White" /> 
                <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle> 
                <EditColumn ButtonType="ImageButton" InsertText="Lägg till" UpdateText="Uppdatera" 
                    UniqueName="EditCommandColumn1" CancelText="Avbryt"> 
                </EditColumn> 
            </EditFormSettings> 
        </MasterTableView> 
        <ClientSettings AllowDragToGroup="True"> 
        </ClientSettings> 
        <FilterMenu> 
            <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
        </FilterMenu> 
    </telerik:RadGrid> 

cs-file:
  public partial class Orders : System.Web.UI.Page 
    { 
        protected void Page_Load(object sender, EventArgs e) 
        { 
            if (!IsPostBack) 
                orderpartDS.WhereParameters.Add(new SessionParameter() { Name = "orderid", SessionField = "orderid", Type = TypeCode.Int32 }); 
        } 
 
        protected void ordersGrid_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) 
        { 
 
            if (e.CommandName == RadGrid.PerformInsertCommandName) 
            { 
                if (e.Item.OwnerTableView.DataSourceID == "orderpartDS") 
                { 
                    GridDataItem parentItem = (GridDataItem)(e.Item.OwnerTableView.ParentItem); 
 
                    if (parentItem != null) 
                    { 
                        string orderId = parentItem.OwnerTableView.DataKeyValues[parentItem.ItemIndex]["orderid"].ToString(); 
                        orderpartDS.InsertParameters["order.orderid"].DefaultValue = orderId; 
                    } 
                } 
            } 
        } 
    } 

The last bit with insertParameters is only a guess from my side, seeing others having problems with this using sql but it might not apply to entitys?

I also attached a screenshot of the relevant entities.
Im using asp.net 3.5 sp1 with a mysql-adapter.
Telerik.Web.UI 2009.3.1314.35

Veli
Telerik team
 answered on 28 Jan 2010
3 answers
199 views
Hi,

I am using the RadGird control to display records. If try filtering the records using the column filters, I get only a handful of filtering options.

I am attaching a snapshot of the problem UI named "Problem UI.jpg" here and an UI working fine named "Proper UI.jpg".

NOTE:
- The problem UI is fetching about 1400 records, whereas the UI working fine is fetching around 20 records.

Any help or suggestions on the issue is highly appreciated.

Thanks
Princy
Top achievements
Rank 2
 answered on 28 Jan 2010
1 answer
69 views
I've taken my data (a list of clients and sub clients)... and converted it to a List<ClientData> where ClientData has three properties: ClientID (int), ParentID (int?), ClientName (string).

Top level clients have ParentID as null.  Sub-clients have ParentID set to the ClientID of their parent.

I bind this list to the RadTreeView and get a linear list of all the clients (in proper order), but no "tree view" or "noding" at all. :(  Please advise what the heck I'm doing wrong!!!

 

 

 

<telerik:radtreeview id="clientTree" runat="server" skin="Vista" width="100%" showlineimages="true" height="300px" maxdatabinddepth="2">  
            <databindings> 
                <telerik:radtreenodebinding textfield="ClientName" valuefield="ClientID" /> 
            </databindings> 
        </telerik:radtreeview> 

ClientTree.DataFieldID = "ClientID";  
 
ClientTree.DataFieldParentID = "ParentID";  
 
ClientTree.DataValueField = "ClientID";  
 
ClientTree.DataTextField = "ClientName";  
 
ClientTree.DataSource = parsed  (the List<ClientData>)
 
ClientTree.DataBind();  
 


Pleas

 

Yana
Telerik team
 answered on 28 Jan 2010
1 answer
98 views
I have a simple grid with paging that displays a few hundred records that are pulled from OnNeedDataSource. There is also a search box at the top of the page that when used retrieves a subset of the records. That all works well.

The issue develops if the search returns enough records that they span more than 1 page. The items that come back are correct and the number of pages are correct but if you click to change pages the grid rebinds and the second page is back to the full record set.

Is there a way to not have the grid rebind on a page switch in this situation?

thanks
Yavor
Telerik team
 answered on 28 Jan 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?