Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
75 views
HI ,
I encounter this error  when i want my embeded radcombox box to show the previous selected value in RadGrid.
The error message is as below:
DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'DataValue'. where DataRule is the value i pass in.

Below is my coding:
   <ajax:RadGrid ID="rgdRptAct" runat="server" DataSourceID="sqlCust" AutoGenerateColumns="false" AllowAutomaticUpdates="true" AllowAutomaticDeletes="true" AllowAutomaticInserts="true" AllowPaging="true" PageSize="3">
       <SortingSettings SortToolTip="<%$ Resources:Resource, Sort %>" />
       <ClientSettings EnableRowHoverStyle="True" EnablePostBackOnRowClick="true">
           <Selecting AllowRowSelect="True" />
       </ClientSettings>
       <MasterTableView EditMode="InPlace" DataKeyNames="Cno,CustPrefix,Action" CommandItemDisplay="Top" AllowSorting="True" NoMasterRecordsText="<%$ Resources:Resource, Search_Display %>">  
           <PagerStyle Mode="NextPrevAndNumeric" PagerTextFormat="{2}{3}{4}Page {0} of {1}" PageSizeLabelText="" AlwaysVisible="true" NextPageToolTip="<%$ Resources:Resource, NextPage %>"  PrevPageToolTip="<%$ Resources:Resource, PreviousPage %>" LastPageToolTip="<%$ Resources:Resource, LastPage %>" FirstPageToolTip="<%$ Resources:Resource, FirstPage %>"/>
 <Columns>
              <ajax:GridTemplateColumn UniqueName="Action" HeaderText="* Action" SortExpression="LMUser" HeaderStyle-Width="140px" ItemStyle-VerticalAlign="Top">
                   <ItemTemplate>
                       <%#DataBinder.Eval(Container.DataItem, "Action")%> 
                   </ItemTemplate>
                   <EditItemTemplate>
                           <ajax:RadComboBox ID="DdlAction" runat="server" AutoPostBack="False" AllowCustomText="False"  DataSourceID="sqlDllAction"
                           AppendDataBoundItems="true"
                           DataTextField="DataValue"
                           DataValueField="DataValue" 
                           SelectedValue='<%# DataBinder.Eval(Container.DataItem, "DataValue") %>'>
                         
                           </ajax:RadComboBox>
                    
                   </EditItemTemplate>
               </ajax:GridTemplateColumn>
 
</Columns>
Can someone please advice what have i miss out here.
My coding is working fine without 
SelectedValue='<%# DataBinder.Eval(Container.DataItem, "DataValue") %>'>

The error come out when i have this piece of code.

Help Please!!

Shinu
Top achievements
Rank 2
 answered on 04 Mar 2011
1 answer
142 views
Hi,

Spent ages trying to work out why my RadAjaxLoadingPanel isn't displaying for ajaxified FormViews. Turns out I had the RenderOuterTable property set to "false" on each of the FormViews.

Also notice you get the same problem if in .NET2, you use the CSS Friendly control adapters with FormViews.

Looks like unless you allow the Formview to render as a table, then the LoadingPanel doesn't display.

Has anyone found a workaround for this, either in code or CSS?

Cheers
Pavlina
Telerik team
 answered on 04 Mar 2011
7 answers
412 views
Hi all.
I am trying to create my own NewsDataProvider for read my news.
Today I have two origins. I think I have to create two providers. But, how?
Where I found some sample? Or detailed documentantion?

Thanks a lot.

-- EDITED

This is my current code. It is in an separated assembly.

using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Configuration.Provider;
using System.IO;
using System.Xml;
using Telerik.Web.UI;

namespace XP.Portal.CMS.Providers
{
   
    public class ReutersDataProvider : Telerik.Sitefinity.Modules.News.NewsDataProvider, Telerik.Sitefinity.Data.IOpenAccessDataProvider
    {
        private static System.Reflection.Assembly[] peristentAssemblies;
        private string[] supportedPermissionSets = new string[] { "Products", "Comments" };

        public ReutersDataProvider()
        {
        }

        protected override void Initialize(string providerName, NameValueCollection config, Type managerType)
        {
            if (config == null)
                throw new ArgumentNullException("config");
            if (string.IsNullOrEmpty(providerName))
                providerName = "ReutersDataProvider";

            base.Initialize(providerName, config, managerType);
        }

        protected override void Initialize(string providerName, NameValueCollection config, Type managerType, bool initializeDecorator)
        {
            if (config == null)
                throw new ArgumentNullException("config");
            if (string.IsNullOrEmpty(providerName))
                providerName = "ReutersDataProvider";
            
            initializeDecorator = false;
            base.Initialize(providerName, config, managerType, initializeDecorator);
        }

        /// <summary>
        /// Gets a unique key for each data provider base.
        /// </summary>
        /// <value></value>
        public override string RootKey
        {
            get { return "ReutersDataProvider"; }
        }

        /// <summary>
        /// Gets the permission sets relevant to this specific secured object.
        /// To be overridden by relevant providers (which involve security roots)
        /// </summary>
        /// <value>The supported permission sets.</value>
        public override string[] SupportedPermissionSets
        {
            get
            {
                return this.supportedPermissionSets;
            }

            set
            {
                this.supportedPermissionSets = value;
            }
        }


        public override Telerik.Sitefinity.News.Model.NewsItem CreateNewsItem(Guid id)
        {
            throw new NotImplementedException("Lucas 1");
        }

        public override Telerik.Sitefinity.News.Model.NewsItem CreateNewsItem()
        {
            throw new NotImplementedException("Lucas 2");
        }

        public override void Delete(Telerik.Sitefinity.News.Model.NewsItem newsItemToDelete)
        {
            throw new NotImplementedException("Lucas 3");
        }

        public override Telerik.Sitefinity.News.Model.NewsItem GetNewsItem(Guid id)
        {
            throw new NotImplementedException("Lucas 4");
        }

        public override System.Linq.IQueryable<Telerik.Sitefinity.News.Model.NewsItem> GetNewsItems()
        {
            throw new NotImplementedException("Lucas 5");
        }



        public override Telerik.Sitefinity.Security.Model.ISecuredObject GetSecurityRoot()
        {
            return base.GetSecurityRoot();
        }

        public override Telerik.Sitefinity.Security.Model.ISecuredObject GetSecurityRoot(bool create)
        {
            return base.GetSecurityRoot(create);
        }

        #region IOpenAccessDataProvider

        /// <summary>
        /// Gets or sets the database instance for this provider.
        /// </summary>
        /// <value>The database.</value>
        public Telerik.OpenAccess.Database Database
        {
            get;
            set;
        }

        /// <summary>
        /// Gets a value indicating whether to use implicit transactions.
        /// The recommended value for this property is true.
        /// </summary>
        /// <value>
        /// <c>true</c> if [use implicit transactions]; otherwise, <c>false</c>.
        /// </value>
        public bool UseImplicitTransactions
        {
            get { return true; }
        }

        /// <summary>
        /// The list of all assemblies with persistent classes inside.
        /// Only this list of assemblies will be used, it must be complete!
        /// </summary>
        /// <returns>The persistent assemblies.</returns>
        /// <value>The persistent assemblies.</value>
        public System.Reflection.Assembly[] GetPersistentAssemblies()
        {
            return peristentAssemblies;
        }

        #endregion
    }
}


The above code generate an error when the system try to execute the GetSecurityRoot method.
What I need to do?

Lucas Massena
XP Investimentos CCTVM S/A
Ivan Dimitrov
Telerik team
 answered on 04 Mar 2011
1 answer
173 views
Hi,

I have RadListview control in my aspx page its working everything correct, In ItemTemplate i have a button event what i need when
click that button i need to open pop up window.(which is already is that different page)

currently i am using Jquery thickbox which i have some alignment issues in that popup. so i want to change my code using telerik control please let me know what code  i have use for that one...


kiran
Princy
Top achievements
Rank 2
 answered on 04 Mar 2011
3 answers
164 views
Hi ...

I have set column formatstring ="0####0.00".

When my Value of column is Null or blank then column value should be 0.00 but it dispaly blank. can you please suggest me soluction for same.
Princy
Top achievements
Rank 2
 answered on 04 Mar 2011
2 answers
124 views
Howdy,
I have a radmultipage with three pageviews.  There are several dropdownlists and textboxes on two of the pageviews.  I am having difficulty trying to get the validationsummary to display only what is on that pageview instead of the entire multipage.  I am using VS 2008 with the 2009.2.826.35 version of the Telerik controls.  Would someone have a suggestion on how to achieve this?

Thanks,
Alex
Alex
Top achievements
Rank 1
 answered on 03 Mar 2011
1 answer
97 views
Hi,
   I am yogesh. I am new to asp.net with C# and im working with asp.net ajax radgrid. i want to store image in radgrid column and then when i click select row in grid it should be displayed in then page imagebox... I tried but unable to get it....Could anyone send me the code snippet plz....if possible send sample project plz...
Daniel
Telerik team
 answered on 03 Mar 2011
4 answers
330 views
I recently downloaded the trial version Telerik RadControls for ASP.NET AJAX for evaluation, and am having a problem with the RadEditor. I am attempting to have a user edit content via the editor and then save the HTML content to the database for later use in another area of the website. I have tried searching and have come up with nothing, so I figured I would ask here.

Whenever the user clicks to save the content, the HTML content is not saved. Instead the text is saved and all of the "<br>" tags are replaced with "\n". I have looked multiple times and it looks like I'm referencing the HTML correctly so I don't know why I'm not getting the actual HTML content. Below is the code for my .aspx page:

<telerik:RadEditor ID="RadContentEditor" Runat="server" Width="100%" Height="350px">
    <Tools>
    <telerik:EditorToolGroup Tag="MainToolbar">
        <telerik:EditorTool Name="Print" ShortCut="CTRL+P" />
        <telerik:EditorTool Name="AjaxSpellCheck" />
        <telerik:EditorTool Name="FindAndReplace" ShortCut="CTRL+F" />
        <telerik:EditorTool Name="SelectAll" ShortCut="CTRL+A" />
        <telerik:EditorTool Name="Cut" />
        <telerik:EditorTool Name="Copy" ShortCut="CTRL+C" />
        <telerik:EditorTool Name="Paste" ShortCut="CTRL+V" />
        <telerik:EditorToolStrip Name="PasteStrip">
        </telerik:EditorToolStrip>
        <telerik:EditorSeparator />
        <telerik:EditorSplitButton Name="Undo">
        </telerik:EditorSplitButton>
        <telerik:EditorSplitButton Name="Redo">
        </telerik:EditorSplitButton>
    </telerik:EditorToolGroup
    ******More tool groups here**********
</Tools>
<Content>
</Content>
<ImageManager UploadPaths="/BlastImages/" ViewPaths="/BlastImages/" />
<DocumentManager UploadPaths="/BlastDocuments/" ViewPaths="/BlastDocuments/" />
</telerik:RadEditor>
<br />
<table id="buttonTable" width="75%" align="center">
    <tr>
        <td style="width:50%; text-align:center;">
            <telerik:RadButton ID="saveContentButton" runat="server" ButtonType="LinkButton" OnClick="saveContentButton_OnClick" Text="Update Content">
                <Icon PrimaryIconCssClass="rbSave" />
            </telerik:RadButton>
        </td>
        <td style="width:50%; text-align:center;">
            <telerik:RadButton ID="cancelButton" runat="server" ButtonType="LinkButton" OnClick="cancelButton_OnClick" Text="Cancel">
                <Icon PrimaryIconCssClass="rbCancel" />
            </telerik:RadButton>
        </td>
    </tr>
</table>
<asp:SqlDataSource ID="sectionDS" runat="server" 
        ConnectionString="<%$ ConnectionStrings:MyConnString %>" 
        SelectCommand="SELECT [Content].id, [Content].page_id, [Content].section_name, [Content].html_content FROM [Content] INNER JOIN Pages ON [Content].page_id = Pages.id WHERE [Pages].page_url=@page_url" >
    <SelectParameters>
        <asp:SessionParameter Name="page_url" SessionField="page_url" />
    </SelectParameters>
</asp:SqlDataSource>

And this is the code-behind which handles the actual insert into the database:

 

 

 

protected void saveContentButton_OnClick(object sender, EventArgs e)
{
     PageHelper ph = new PageHelper();
  
     try
     {
          string section_id = (string)Session[Constants.SESSION_SECTION_ID];
          string section_content = RadContentEditor.Content;
          ph.updateSectionContent(section_id, section_content);
                      
          Response.Redirect("~/Web/Admin/Content/ManagePageSections.aspx");
     }
     catch (Exception ex)
     {
         Response.Redirect("~/Errors/UnhandledException.htm");
     }
}

Andrew
Top achievements
Rank 1
 answered on 03 Mar 2011
0 answers
76 views
Hi All,

We deployed our usercontrols (Radgrid,Radtextboxes & button) on sharepoint 2010 site, & everything works fine.

Now testing team altered the viewstate value of controls through Fiddler and changed it with some junk characters, now after submitting the form to server, it throws Invalid JASON Primitive (server 500 error)

In web.config file, by default EnableViewStateMac is true.
Is it any way to restrict  users or any way to stop the postback,  if some one alters the viewstate to stop submiting  form to server.
naimish
Top achievements
Rank 1
 asked on 03 Mar 2011
3 answers
203 views
Hello!
I have a web service that returns a collection of anonymous types. Here is an example of something that works for me.

var allMyFoo = (from w in fooService.GiveMeFoo()
                 select new
                 {
                   ID = w.ID,
                   Foo = w.Foo.Name                        
                 });
 
var myFooCount = fooService.CountMyFoo();
return new Dictionary<string, object> {
  {"foo", allMyFoo},
  {"fooCount", myFooCount}
};

in aspx...

<telerik:GridBoundColumn UniqueName="FooName" SortExpression="Foo.Name" DataField="Foo" HeaderText="Foo" DataType="System.String">
</telerik:GridBoundColumn>
But this is what I wanted to do with bolded changes in code and aspx

var allMyFoo = (from w in fooService.GiveMeFoo()
                 select new
                 {
                   ID = w.ID,
                   Foo = new { Name = w.Foo.Name }
                 });
  
var myFooCount = fooService.CountMyFoo();
return new Dictionary<string, object> {
  {"foo", allMyFoo},
  {"fooCount", myFooCount}
};
 
in aspx...
 
<telerik:GridBoundColumn UniqueName="FooName" SortExpression="Foo.Name" DataField="Foo.Name" HeaderText="Foo" DataType="System.String">
</telerik:GridBoundColumn>

Could you tell me why the grid doesn't display the Name of Foo when I try the second example?
Marin
Telerik team
 answered on 03 Mar 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?