Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
148 views
I'm writing a page which will show a list of artists and a selection of their artworks. In terms of structure it's very much like the demo here: http://demos.telerik.com/aspnet-ajax/listview/examples/datagrouping/defaultcs.aspx

Layout will be:

Artist (name/description/rating)
-- Artwork (title/image/price)
-- Artwork (title/image/price)
-- Artwork (title/image/price)
Artist (name/description/rating)
-- Artwork (title/image/price)
-- Artwork (title/image/price)
-- Artwork (title/image/price)
Artist (name/description/rating)
-- Artwork (title/image/price)
-- Artwork (title/image/price)
-- Artwork (title/image/price)

My SQL query returns all the data on artists and artworks. I can bind this to my RadListView and get the artwork records looking OK by setting them to be the ItemPlaceHolder. But  how can I get all the data for each artist such as Name, Description, Rating etc. I cannot understand how to get ANY data on each outer record except for the value of the DataKeyName. It is not exposed through <%# Eval("ArtistName") %>. 

Here is some code:

<telerik:RadListView ID="SupplierRadListView" runat="server" ItemPlaceholderID="WorkPlaceHolder" OnItemDataBound="SupplierRadListView_ItemDataBound" 
    PageSize="20" AllowPaging="true" DataKeyNames="MemberID">
    <LayoutTemplate>
        <asp:Panel runat="server" ID="ArtistPlaceHolder">

            <asp:Panel runat="server" ID="WorksPlaceHolder">
            </asp:Panel>
        </asp:Panel>
    </LayoutTemplate>
    <DataGroups>
        
        <telerik:ListViewDataGroup GroupField="MemberID" DataGroupPlaceholderID="ArtistPlaceHolder">
            <DataGroupTemplate>
                <div style="float: left; width: 200px;">
                <asp:Literal runat="server" ID="ArtistLiteral" />
                
                </div>
                <asp:Panel runat="server" ID="WorkPlaceHolder" />
            </DataGroupTemplate>
        </telerik:ListViewDataGroup>
    </DataGroups>
    <GroupSeparatorTemplate>
        <hr />
    </GroupSeparatorTemplate>
    <ItemTemplate>
        <div class="work_outer">
            <div class="work_inner">
                <%# Eval("Title") %>
            </div>
        </div>
    </ItemTemplate>
</telerik:RadListView>









Pavlina
Telerik team
 answered on 11 Jul 2014
5 answers
463 views
Hello All,
              I want to set textmode of RadTextBox to 'Password' through JavaScript ,I can successfully do it on server side ,but on client side ,I fail to do the same.Please help me out for this. 

Thanks,
Kapil Lavangade.
t
Top achievements
Rank 1
 answered on 11 Jul 2014
5 answers
205 views
Hi
Is Radbook will be include in ASP.Net Ajax controls family soon ?
How to do something like RadBook in asp.net or what's the alternative way to achieve that?

Thanks, 
Mansi 
Rumen
Telerik team
 answered on 11 Jul 2014
2 answers
210 views
Hi,
do we have radscheduler navigation commands similar to this "http://www.telerik.com/help/aspnet-ajax/scheduler-navigationcommand.html" for client side.
I am using  following information to decide which navigation command was fired.
Unfortunatley  "more" in  "MonthView" and "click" on "Today" button  both fire command "8". How do I differentiate between the two especially in Month View?

 function OnClientNavigationComplete(sender, eventArgs) {
                 var command = eventArgs.get_command();

                 /*
                    8 - > Today
                    6 --> NextDay
                    7-->PreviousDay
                    12 --> pop Up calendaer selectdDate
                 */


                 var selectedView = sender.get_selectedView();
                 var targetDate = sender.get_selectedDate();
                 if(targetDate)
                     targetDate = targetDate.toDateString();
                 console.log("OnClientNavigationComplete" + ", targetDate: " + targetDate + ", command: " + command);

                doCustomAction( targetDate, command);
                   
             }


Thanks,
Prava
Prava kafle
Top achievements
Rank 1
 answered on 11 Jul 2014
2 answers
97 views
I have the following (simplified) snippet defined in my toolsfile:

<snippet name="Test">
    <![CDATA[
        <table cellpadding="0" cellspacing="0" width="100%" style="mso-table-rspace:10pt">
            <tr>
                <td valign="bottom">Image here</td>
            </tr>
            <tr>
                <td bgcolor="#ffffff" style="background-color:#ffffff; font-family:Arial, Helvetica, Sans Serif; font-size:12px; line-height:16px; color:#000000; padding:0 20px;">
                    <a href="#" style="color:#78348c;">Read on &#9658;</a>
                </td>
            </tr>
        </table>
    ]]>
</snippet>

When inserting this snippit, two issues emerge:
  1. The style="mso-table-rspace:10pt" attribute is removed from the table tag
  2. After 'read on' there is a HTML character with code 9658 (which displays an arrow). How ever on insert, the character is not inserted with the character code (like &#9658;), but as the character itself. This renders incorrectly in Outlook. In fact, inserting the above code example here did exactly the same thing.

StripFormattingOnPaste and StripFormattingOptions are both set to none, ContentFilters are set to: RemoveScripts,ConvertFontToSpan,FixUlBoldItalic,IECleanAnchors,FixEnclosingP,ConvertTags,ConvertFontToSpan,OptimizeSpans,IndentHTMLContent.

What else can I do to fix this issue?


Luuk
Top achievements
Rank 1
 answered on 11 Jul 2014
5 answers
360 views

Hello,

 

I’m trying to figure an issue with the RadComboBox (Ajax Q1 2014 version). I using Visual Studio 2012, Sql 2012 (the example code is using Adventure Works 2008 database), Web application with Master Content pages.

The combo boxes have CheckBoxes="true" EnablecheckAllItemsCheckBox="true" CheckedItemsTexts="DisplayAllInInput" set. My application needs multiple columns w/ multiple values filtering and to have initial values set on load.

In the included example there are 2 Combo Boxes. Initially Country has France and US  Checked. Now uncheck both. Page refreshes. With no items checked. Open States combo box check ‘Ain’ first Item. Click the ‘Show’ button.  The Id’s are shown as State Id 87. Now open the State combo box and uncheck the ‘Ain’ item. Now click off the combo box. Page refreshes. ‘Ain’ is still checked.  The javascript event for OnClientDropDownClose is called which is supposed to raises the OnTextChanged event but dosen’t.

How do I get the Item to behave correctly??

 

David Carson

Ps. The code probably   still has typos from the OCR processes.



<%@ Page Tit1e="Home Page" Language="C#" MasterPageFile="~/Site.Master" AutoEventwireup="true“
  CodeBehind="Default.aspx.cs" Inherits:"webApplicationl._Default" %>
<%@ Register Assembly="Telerik.web.UI" Namespace="Telerik.web.UI" TagPrefix="telerik" %>

<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="Maincontent">

<telerik:RadScriptBlock ID="RadScriptBlockl" runat="server">
<script type="text/javascript">
function ApplyFilter(sender, args) {sender.raise_textChange(sender, args);}
</script>
</telerik:RadScriptBlock>

<telerik:RadComboBox ID="rcbo0" runat="server" DropDownAutowidth=“Enabled" AutoPostBack="true"
    width="400px" CheckBoxes="true" EnablecheckAllItemsCheckBox="true"
    CheckedItemsTexts="DisplayAllInInput" Label="Country:" DataTextField="Name"
    DataValueField="CountryRegionCode" OnClientDropDownClosed="ApplyFilter" onTextChanged="CreateFilter0" />
<br />
<telerik:RadComboBox ID="rcbo1" runat="server" DropDownAutowidth="Enabled" AutoPostBack="true"
    width="400px" CheckBoxes="true" EnablecheckAllItemsCheckBox="true"
    CheckedItemsTexts="DisplayAllInInput“ Label="States:" DataTextField="Name"
    DatavalueField="StateProvinceID" onClientDropDownClosed="ApplyFilter" OnTextChanged="CreateFilter1" />
<br />
<asp:Button ID="Button1" runat="server" Text="Show Sel Ids" OnClick="Buttonl_Click" />
<asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" Rows="3"></asp:TextBox>
<br />
<br />
<asp:Label ID="Label0“ runat="server" Text="Label"></asp:Label>
<br />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<br />
</asp:Content>

 

 

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.web.UI;
using Telerik.web.UI;

namespace webApplication1
{
public partial class _Default : Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
//Session["Filter0"]
//Session["Filter1"] = "1,2,3,4,5,100,200,300";
Session["Filter0"] = "US,FR";
Session["Filter1"] = "";
}

protected override void OnPreRender(EventArgs e)
{
base.onPreRender(e);
Build_0_Data();
Build_1_Data();
Label0.Text = "Filter0 = " + Session["Filter0"];
Label1.Text = "Filterl = " + Session["Filter1"];
}

private static void SetChecked_Combo(object sender, object oSessionFilter)
{
if (oSessionFilter != null)
{
string sSessionFilter = oSessionFilter.ToString();
List<string> sValueArray = sSessionFilter.Split(new char[] {','}
    , Stringsplitoptions.RemoveEmptyEntries).ToList<string>();
RadComboBoxItem comboltem;
RadComboBox combo = (RadComboBox)sender;
if (sValueArray.Count > 0)
{
foreach (string s in sValueArray)
{
comboItem = combo.Items.FindItemByValue(s);
if (comboItem != null)
comboItem.Checked = true;
}
}
}
}

public void CreateFilter0(object sender, EventArgs e)
{
CheckedCombo_CreateFilter(sender, "Filter0");
}
public void CreateFilter1(object sender, EventArgs e)
{
CheckedCombo_CreateFilter(sender, "Filter1");
}
private void CheckedCombo_CreateFilter(object sender, string sSessionName)
{
string sFilter = string.Empty;
if ((sender != null) && (sender.GetType() == typeof(RadComboBox)))
{
RadComboBox cbo = (RadComboBox)sender;
if ((cbo != null) && (cbo.CheckedItems != null))
{
foreach (RadComboBoxItem comboltem in cbo.CheckedItems)
{
if (!string.IsNullOrEmpty(sFilter))
sFilter += ",";
sFilter += comboItem.Value;
}
}
}
Session[sSessionName] = sFilter;
}

protected void Build_O_Data()
{
string sFilter = (string)Session[“Filter1"];
Sqlconnection sqlConn = new Sqlconnection(ConfigurationManager.
    ConnectionStrings["Database1"].ConnectionString);
sqlConn.Open();

SqlCommand cmd_Tmp = new SqlCommand();
cmd_Tmp.Connection = sqlConn;
if (!string.IsNullOrEmpty(sFilter))
{
 cmd_Tmp.CommandText = "DECLARE @x XML;"
   + "SET @x = '<i>' + REPLACE(@filter, ',', '</i><i>') + '</i>';"
   + "SELECT DISTINCT C.[CountryRegionCode],C.[Name]"
   + "FROM [Person].[CountryRegion] C"
   + "INNER JOIN [Person].[StateProvince] S"
   + "ON C.[CountryRegionCode] = S.[CountryRegionCode]"
   + "WHERE [StateProvinceID] IN (SELECT x.i.value('.', 'NVarChar(3)') From @x.nodes('//i') x(i))" ;
cmd_Tmp.Parameters.Add(new SqlParameter("@filter", sFilter));
}
else
cmd_Tmp.CommandText = "SELECT DISTINCT C.[CountryRegionCode],C.[Name] FROM [Person].[CountryRegion]C";

SqlDataAdapter sda = new SqlDataAdapter(cmd_Tmp);
DataTable dt = new DataTable("Tmp");
sda.Fill(dt);

rcbo0.DataSource = dt;
rcbo0.DataBind();

SetChecked_Combo(rcbo0, Session["Filter0"]);
}

protected void Build_1_Data()
{
string sFilter = (string)Session["Filter0"];
Sqlconnection sqlconn = new Sqlconnection(ConfigurationManager.
    Connectionstrings["Database1"].Connectionstring);
sqlConn.Open();
Sqlcommand cmd_Tmp = new SqlCommand();
cmd_Tmp.Connection = sqlConn;
if (!string.IsNullOrEmpty(sFilter))
{
cmd_Tmp.CommandText = "DECLARE @x XML;“
   + "SET @x = '<i>' + REPLACE(@filter, ',', '</i><i>') + '</i>';"
   + "SELECT DISTINCT_S.[StateProvinceID],S.[Name]
   + "FROM [Person].[StateProvince] S"
   + "INNER JOIN [Person].[CountryRegion] C"
   + "ON C.[CountryRegionCode] = S.[CountryRegionCode]"
   + "WHERE S.[CountryRegionCode] IN (SELECT x.i.value('.', 'NVarChar(3)') From @x.nodes('//i') X(i))" ;
cmd_Tmp.Parameters.Add(new SqlParameter("@filter", sFilter));
}
else
cmd_Tmp.CommandText = "SELECT [StateProvinceID],[Name] FROM [Adventureworks2008].[Person].[StateProvince] ";
SqlDataAdapter sda = new SqlDataAdapter(cmd_Tmp);
DataTable dt = new DataTable("Tmp");
sda.Fill(dt);
rcbo1.DataSource = dt;
rcbo1.DataBind();
SetChecked_Combo(rcbo1, Session["Filter1"]);
}

protected void Button1_Click(object sender, EventArgs e)
{
string sFilter = string.Empty;
foreach (RadComboBoxItem comboItem in rcbo0.CheckedItems)
{
if (!string.IsNullorEmpty(sFilter))
sFilter += ",";
sFilter += comboItem.Value;
}
TextBox1.Text = "Sel Country ID: " + sFilter + System.Environment.NewLine;

sFilter = string.Empty;
foreach (RadComboBoxItem comboItem in rcbo1.CheckedItems)
{
if (!string.IsNullorEmpty(sFilter))
sFilter += ",";
sFilter += comboItem.Value;
}
TextBox1.Text += @"Sel State ID: " + sFilter;
}
}
}

 

Hristo Valyavicharski
Telerik team
 answered on 11 Jul 2014
2 answers
215 views
Hi there,

We use a CrystalReportsViewer inside a modal RadWindow to show reports inside our application.  I've received a number of reports from our users that when they move to the next page in a report, the "close button" disappears.  Whilst investigating this issue, I battled to reproduce it until I discovered that it seems to only happen on smaller displays / lower resolutions, perhaps when the content of the RadWindow is larger than the browser window.

Essentially what is happening is that when the next page button is clicked, the RadWindow is "jumping up" a few millimeters and concealing the title bar behind the browser's address bar.  If the user resizes the browser window, even by a FRACTION, or if they zoom in and out (basically anything that causes a redraw), the RadWindow fixes itself immediately.

I have created an animated gif of the phenomenon to try and illustrate the issue.  I have exaggerated the size of the browser window here to replicate the problem clearly. Please take a look and let me know if you have any ideas as to what could be causing this.

Nick

Nick
Top achievements
Rank 1
 answered on 11 Jul 2014
6 answers
415 views
i have a strange problem.
our components stay on the radajaxpanel and postbacks calls loading panel...we have grid pages ...when changing the pages  .. when the page count increase ..data increase loading panel doesn't close ...stays infinetly
Maria Ilieva
Telerik team
 answered on 11 Jul 2014
9 answers
1.6K+ views
Hi,

We are getting below exception from Telerik file upload control AsyncUpload but this issue coming very rarly. Can you anybody help what is rootcause of this issue and how to fix this issue. Hoping you may also faced this kind of issue in your apps. FYI,  TemporaryFileExpiration valuse set as default value only.


System.IO.FileNotFoundException: Could not find file 'C:\inetpub\wwwroot\wss\VirtualDirectories\80\TempUploadedFiles\5taz52la.zdo'.
File name: 'C:\inetpub\wwwroot\wss\VirtualDirectories\80\TempUploadedFiles\5taz52la.zdo'
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at Telerik.Web.UI.AsyncUploadedFile.get_InputStream().

Control has benn set as ber below:

<telerik:RadAsyncUpload runat="server" ID="radasycFileUpload"
DisablePlugins="true" Width="540" UseApplicationPoolImpersonation="true"
Localization-Select="Browse" TemporaryFolder="~/TempUploadedFiles" />

  

Thanks
Karthikeyan K
Hristo Valyavicharski
Telerik team
 answered on 11 Jul 2014
0 answers
369 views
Here is how you can upload files in Sharepoint Document Library:
  1. Create a new Visual Web Part
  2. Add reference to Telerik.Web.UI assembly
  3. Register Telerik.Web.UI assembly:
    <%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
    <%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
    <%@ Import Namespace="Microsoft.SharePoint" %>
    <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VisualWebPart1.ascx.cs" Inherits="VisualWebPartProject1.VisualWebPart1.VisualWebPart1" %>
    <%@ Register Assembly="Telerik.Web.UI, Version=2014.2.618.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
     
    <telerik:RadAsyncUpload runat="server" ID="RadAsyncUpload1" ></telerik:RadAsyncUpload>
    <telerik:RadButton runat="server" Text="Submit" ID="RadButton1" OnClick="RadButton1_Click"></telerik:RadButton>
4. Save the file
protected void RadButton1_Click(object sender, EventArgs e)
        {
            foreach (UploadedFile file in RadAsyncUpload1.UploadedFiles)
            {
                String sharePointSite = "http://ajax-sp2010/";
                String documentLibraryName = "Shared Documents";
 
                using (SPSite oSite = new SPSite(sharePointSite))
                {
                    using (SPWeb oWeb = oSite.OpenWeb())
                    {
                        SPFolder myLibrary = oWeb.Folders[documentLibraryName];
 
                        Boolean replaceExistingFiles = true;
                        // Upload document
                        SPFile spfile = myLibrary.Files.Add(file.FileName, file.InputStream, replaceExistingFiles);
 
                        // Commit
                        myLibrary.Update();
                    }
                }
            }
        }

Note that when file is selected it is uploaded in the App_Data folder:
C:\inetpub\wwwroot\wss\VirtualDirectories\80\App_Data\RadUploadTemp
Христо
Top achievements
Rank 1
 asked on 11 Jul 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
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?