Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
160 views
I have a question. Is it possible to use JSON to query a web service and return a RadListViewItem (or preferably an array of them) to then append to the current listview on the page without a postback or lengthy ajax call? I have watched a few of the demos on how to use JSON and a web service but it didn't entirely help (new to JSON). Anyways, I am essentially making a commenting system and I want people to be able to load comments on demand and post new comments without experiencing a somewhat lengthy AJAX call using the panels or postingback completely. Right now when someone ads a new comment it actives the radajax components of the panel to make the call. It isn't terrible but I want something a little faster and seemless for the user. Let me know if something like this would work and if so, where I might start (specifically how to handle the return):

User wants to view more comments:

On page load (load top 30 results)
click "more" button and use JSON to get an array of RadListViewItems and append them to the current list view at the bottom (everything is ordered by date).

User wants to post:
Use JSON to write post to database (I can do this)
get the new record and return it as a RadListViewItem.

Thanks for all of your help guys.
Tsvetoslav
Telerik team
 answered on 15 Aug 2012
5 answers
447 views

 

hi
i have a standard grid with a series of columns in it i.e GridDropDownColumn, GridBoundColumn etc.
i want to know if there is a way of making the column a required field and validate it as such.
i know you can do it with a template column , but i dont want to have to create template columns for all the fields that require validation , there must be a simpler way to make a column a required field.
just to clarify this is for the insert/edit modes of the grid i need to validate the fields for.

thanks for your input on this.
Radoslav
Telerik team
 answered on 15 Aug 2012
1 answer
87 views
Hi,
I have a letter template which is populated in my treeView, I wanted to drag and drop template items to both radeditor and textbox. During drag I want to change it to hand cursor and whenever it dragover my editor or textbox it will highlight the control. Any way I could accomplish this, any sample that I could refer to?
Thanks in advance,
RJ
RJ
Top achievements
Rank 1
 answered on 15 Aug 2012
1 answer
87 views
I am using RadTreeView to display forum menu. I want to show an alert image for all the forum menu which have new reply. So I want to show/hide an image on databound similar we do in Radgrid on the rowDataBound event.

My Treeview don't have any child nodes. Below is my tree view node. Simply i bind this tree from database and onNodeClick i redirect to the another page.

<telerik:RadTreeView id = "radtree"  runat = "server" onNodeClick="radtreeNode_Click">
</telerik:RadTreeView >

Thanks
Puru

Puru
Top achievements
Rank 1
 answered on 15 Aug 2012
1 answer
81 views
I get the following error when I remove all rows from the grid source and rebind the grid.

Error: 'this.get_element().tBodies.0.rows' is null or not an object

This does not happen in IE7. It happened to me in IE8 and Firefox.

ASPX:
<form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager" runat="server"></telerik:RadScriptManager>
    <telerik:RadAjaxPanel ID="RadAjaxPanel" runat="server">
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="True"
            OnNeedDataSource="RadGrid1_NeedDataSource">
            <MasterTableView AutoGenerateColumns="True" ClientDataKeyNames="Id" DataKeyNames="Id" CommandItemDisplay="Top">
            </MasterTableView>
            <ClientSettings>
                <Selecting AllowRowSelect="True"></Selecting>
                <Scrolling AllowScroll="True" UseStaticHeaders="True"></Scrolling>
            </ClientSettings>
        </telerik:RadGrid>
        <telerik:RadButton ID="RadButton1" runat="server" Text="RadButton"
            onclick="RadButton1_Click">
        </telerik:RadButton>
    </telerik:RadAjaxPanel>
    </form>

C#:

private Dictionary<int, string> GridSource
{
   get
   {
       return (Dictionary<int, string>) ViewState["gridSource"];
   }
   set
   {
       ViewState["gridSource"] = value;
   }
}
protected void Page_Load(object sender, EventArgs e)
{
   if (!IsPostBack)
   {
       GridSource = new Dictionary<int, string>();
 
       for (int i=0; i<2; i++)
       {
           GridSource.Add(i, "test data " + i);
       }
   }
}
 
protected void RadButton1_Click(object sender, EventArgs e)
{
   GridSource.Remove(int.Parse(RadGrid1.SelectedItems[0].Cells[2].Text));
   RadGrid1.Rebind();
}
 
protected void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
   RadGrid1.DataSource = from d in GridSource select new { Id = d.Key, Text = d.Value };
}
Leonard
Top achievements
Rank 1
 answered on 15 Aug 2012
3 answers
136 views
Hi,

Please response to kassaiefarshad@yahoo.com

I have used a RadEditor in webpart on Sharepoint 2010.However, some buttons like "Image Manager" or "Document Manager" or "Hyperlink Manager" and so forth in Editor doesn't work and return an error.
error is such as follow:
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: /_CONTROLTEMPLATES/Hojan.KMS.Webparts/KnowledgeEntry/Telerik.Web.UI.DialogHandler.aspx

any help appreciated.

Cheers,
Farshad


Vasu
Top achievements
Rank 1
 answered on 15 Aug 2012
3 answers
368 views
Is it possible to filter records onTextChanged or onKeyUp event of internal TextBox(Header TextBox) of Radgrid?
I dont want to select 'Start With', 'Contains' and other options from dropdown to filter records in Radgrid.

Find the attached file for more understanding...
Jayesh Goyani
Top achievements
Rank 2
 answered on 14 Aug 2012
2 answers
108 views
I can only seem to reproduce this in Chrome.  When a document is long enough to require a scrollbar, scrolling will put horizontal lines over the newly viewable part of the document. It seems to be related to the <td> which has a border that the iframe is in.  If I change the color of the border-bottom the lines output over the document change with it. I thought removing the border would resolve the issue, but it puts white lines over instead of black, transparent border has the same effect.  I can't seem to reproduce this in Chrome with regular iframes or any of the official demonstrations on this website.  

I have tried changing ContentAreaMode to DIV and although the lines do not appear with this it causes other issues so isn't a viable solution.

Any help anyone has would be much appreciated.
Brandon
Top achievements
Rank 1
 answered on 14 Aug 2012
2 answers
235 views

In my RadImageEditor declaration, I use the OnClientCommandExecuting attribute to prevent the save dialog from appearing.  I also use the OnImageLoading and OnImageSaving attributes so I can load/save the image to a database.  In the ImageSaving routine, I am trying to provide a success/fail confirmation on the screen by setting a label's text property to "File Saved".

When I click the Save button in the RadImageEditor, the file is saved but the label text is never updated.

I found a work around by adding my own asp.button on the form and calling the SaveEditableImage("",true) method.  But I'm hoping I can get the RadImageEditor save button to work.  In case is makes an difference, I'm currently using dll version 2011.3.1305.35.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="RadTest1._Default" %>
 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
    <telerik:RadCodeBlock ID="codeblock1" runat="server">
 
        <script type="text/javascript">
            function OnClientCommandExecuting(sender, eventArgs) {
                if (eventArgs.get_commandName() == 'Save') {
                    var imEditor = $find("<%= RadImgEdt.ClientID %>");
                    imEditor.saveImageOnServer('', true);
                    imEditor.setToggleState('Save', false);
                    eventArgs.set_cancel(true);
                }
            }
        </script>
 
    </telerik:RadCodeBlock>
</head>
<body>
<form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI"
                Name="Telerik.Web.UI.Common.Core.js">
            </asp:ScriptReference>
            <asp:ScriptReference Assembly="Telerik.Web.UI"
                Name="Telerik.Web.UI.Common.jQuery.js">
            </asp:ScriptReference>
            <asp:ScriptReference Assembly="Telerik.Web.UI"
                Name="Telerik.Web.UI.Common.jQueryInclude.js">
            </asp:ScriptReference>
        </Scripts>
    </telerik:RadScriptManager>
    <div>
        <asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" />
        <asp:Button ID="btnClose" runat="server" Text="Close" />
        <asp:Label ID="lblError" runat="server" EnableViewState="false" style="color: Red; margin-left: 5px;" />
    </div>
    <div style="margin-top: 50px;">
        <telerik:RadImageEditor ID="RadImgEdt" runat="server"
            OnImageLoading="RadImgEdt_ImageLoading"
            OnImageSaving="RadImgEdt_ImageSaving"
            OnClientCommandExecuting="OnClientCommandExecuting"
            Width="95%" Height="600px" style="top: 0px; left: 0px">
        </telerik:RadImageEditor>
    </div>
</form>
</body>
</html>

protected void RadImgEdt_ImageLoading(object sender, Telerik.Web.UI.ImageEditorLoadingEventArgs args)
{
    //TODO - Get image from imaging database
    string filename = Server.MapPath("TestImages");
    filename = Path.Combine(filename, "FatCat.jpg");
    MemoryStream mstream = new MemoryStream(File.ReadAllBytes(filename));
 
    Telerik.Web.UI.ImageEditor.EditableImage img = new Telerik.Web.UI.ImageEditor.EditableImage(mstream);
    args.Image = img;
    args.Cancel = true;
}
 
protected void RadImgEdt_ImageSaving(object sender, Telerik.Web.UI.ImageEditorSavingEventArgs args)
{
    //TODO - Save image to imaging database
    string filename = Server.MapPath("TestImages");
    filename = Path.Combine(filename, string.Format("FatCat-{0}.jpg", DateTime.Now.ToString("yyyyMMdd-hhmmss")));
 
    Telerik.Web.UI.ImageEditor.EditableImage img = args.Image;
    img.Image.Save(filename);
    lblError.Text = "File Saved";
    args.Cancel = true;
}
 
protected void btnSave_Click(object sender, EventArgs e)
{
    RadImgEdt.SaveEditableImage("", true);
}
Aaron Ford
Top achievements
Rank 1
 answered on 14 Aug 2012
3 answers
131 views
Hi, after upgrading to Q2 2012 for both RadControls and Telerik Reporting I noticed that the control icons for the Telerik Controls (ASP.NET and Reporting) are not on the toolbox on Visual Studio 2010.  I removed the previous version (Q1 2012) before installing the Q2 versions.  

I'm running Visual Studio 2010 Professional on Windows 7 64bit.  I tried re-installing, repairing the installations but I still don't get the items on the toolbox.  Any recommendations?

Thanks.

Yolanda
Chavdar Dimitrov
Telerik team
 answered on 14 Aug 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?