Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
223 views
I trying to figure out how to pass the name of a wave file that is displayed into the file explorer. So when the user double clicks on the file name, it plays in a media player that is next to the file explorer (see attached screen shot).

Currently if you double click the file name a window opens and the wave file starts playing. That doesn't work to well as if you close the window the calls keeps playing.

I need to pass the JavaScript var "name" to
<param name="URL" value=""  />
in the Windows Media Player control and not have the file explorer default to
popping up a window and using the user's default media player.

Any suggestions????

Thanks,
Joe

Here's the code I have got so far...

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
    </telerik:RadScriptManager>
    <br />
     <table cellspacing="4">
        <tr>
            <td rowspan="2" style="vertical-align: top;">
                Browse to an image and click to preview.
                <telerik:RadFileExplorer ID="RadFileExplorer1" Runat="server" Configuration-MaxUploadFileSize="104857600" Width="500px">
                    <Configuration SearchPatterns="*.*"></Configuration>
                </telerik:RadFileExplorer>
            </td>
            <td style="vertical-align: top">
            <br />
                <fieldset style="width: 270px; height: 85px">
                    <legend> Play Call  </legend>
                   
                  <script type="text/javascript">
                      function OnClientFileOpen(oExplorer, args) {
                          var item = args.get_item();
 
                          //check if the opened item is a file
                          //if the item does not have extension it is a directory
                          //you can add additional check if the file has specific extension
                          if (item.get_extension()) {
                              args.set_cancel(true); //cancel the default execution
 
                              var name = item.get_name(); //you can use get_path() method to get full path to the item
                              alert(name);
                               
                              //execute the custom function changing the video in the MediaPlayer control
                          }
 
                      }
</script>
                         
               <object id="MediaPlayer1" height="65" 
               classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject">
                 <param name="URL" value=""  />
                    <param name="FileName" value="" />
                    <param name="enabled" value="true" />  
                    <param name="ShowStatusBar" value="-1"/>
                     <param name="AutoStart" value="-1"/>
                     <param name="BufferingTime" value="5"/>
                     <param name="ShowCaptioning" value="0"/>
                     <param name="WindowlessVideo" value="0"/>
                     <param name="Balance" value="-1"/>
                     <param name="PreviewMode" value="1"/>
                     <param name="Volume" value="100"/>
                      <param name="AudioStream" value="-1"/>
                      <param name="AutoSize" value="-1"/>
                      <param name="AnimationAtStart" value="0"/>
                      <param name="AllowScan" value="0"/>
                      <param name="AllowChangeDisplaySize" value="0"/>
                      <param name="AutoRewind" value="0"/>
                      <param name="ClickToPlay" value="-1"/>
                      <param name="CursorType" value="0"/>
                      <param name="CurrentPosition" value="-1"/>
                      <param name="CurrentMarker" value="0"/>
                      <param name="DisplayBackColor" value="0"/>
                      <param name="DisplayForeColor" value="16777215"/>
                      <param name="DisplayMode" value="0"/>
                      <param name="DisplaySize" value="0"/>
                      <param name="EnableContextMenu" value="-1"/>
                      <param name="EnablePositionControls" value="-1"/>
                      <param name="EnableFullScreenControls" value="-1"/>
                      <param name="EnableTracker" value="-1"/>
                      <param name="InvokeURLs" value="-1"/>
                      <param name="Language" value="-1"/>
                      <param name="Mute" value="0"/>
                      <param name="PlayCount" value="1"/>
                      <param name="Rate" value="1"/>
                      <param name="SelectionStart" value="0"/>
                      <param name="SelectionEnd" value="-1"/>
                      <param name="SendOpenStateChangeEvents" value="0"/>
                      <param name="SendWarningEvents" value="0"/>
                      <param name="SendErrorEvents" value="0"/>
                      <param name="SendKeyboardEvents" value="0"/>
                      <param name="SendMouseClickEvents" value="0"/>
                      <param name="SendMouseMoveEvents" value="0"/>
                      <param name="SendPlayStateChangeEvents" value="0"/>
                      <param name="ShowControls" value="-1"/>
                      <param name="ShowAudioControls" value="-1"/>
                      <param name="ShowDisplay" value="0"/>
                      <param name="ShowGotoBar" value="0"/>
                      <param name="ShowPositionControls" value="-1"/>
                      <param name="ShowTracker" value="-1"/>
                      <param name="TransparentAtStart" value="-1"/>
                      <param name="VideoBorderWidth" value="2"/>
                      <param name="VideoBorderColor" value="0"/>
                      <param name="VideoBorder3D" value="-1"/>
                </object>
                
<br />
  
    </div>
 
                </fieldset>
            </td>
        </tr>
    </table>
     
    
</asp:Content>
Joe
Top achievements
Rank 2
 answered on 06 Sep 2011
5 answers
1.5K+ views
Here is my grid:

 <telerik:RadGrid runat="server" ID="radTableColumns" AutoGenerateColumns="false" AllowMultiRowSelection="true" > 
            <ClientSettings> 
                <Selecting AllowRowSelect="true" /> 
            </ClientSettings> 
            <MasterTableView> 
            <Columns> 
                <telerik:GridClientSelectColumn HeaderStyle-Width="40px"   /> 
               <telerik:GridBoundColumn DataField="column_name" HeaderText="Column Name" /> 
                <telerik:GridBoundColumn DataField="column_type" HeaderText="Column Type" /> 
            </Columns> 
            </MasterTableView> 
             </telerik:RadGrid> 

It's in a radwindow, so I need to be able to loop through the grid and compile a list of items where the checkbox is checked. 

I saw the example where you can set it to postback on the check changed event, but I'd prefer not to have to rebuild the string and postback everytime something is checked.

Is there anyway to do a loop through in javascript?

Thanks.
Kavya
Top achievements
Rank 2
 answered on 06 Sep 2011
2 answers
103 views
the below code resizes radchart when you resize dock. but when page first loads, radchart is bigger than dock itself and some of chart is not visible. can someone help please ?


the below code resizes radchart when you resize dock. but when page first loads, radchart is bigger than dock itself and some of chart is not visible. can anybody help me with a code sample ? I searched forums and tried every single chart resize example but could no succeed..

the below code resizes radchart when you resize dock. but when page first loads, radchart is bigger than dock itself and some of chart is not visible. can anybody help me with a code sample ? I searched forums and tried every single chart resize example but could no succeed..
 
<head runat="server">
    <title>Untitled Page</title>
    <style type="text/css">
        .rdContent
        {
            overflow: hidden !important;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
        <script type="text/javascript">
            function ResizeChart(sender, args) {
                var chart = $get("<%= RadChart1.ClientID %>");
                var chartimg = chart.getElementsByTagName("img")[0];
                chartimg.style.setAttribute("width", sender.get_width() - 50 + "px");
                chartimg.style.setAttribute("height", sender.get_height() - 50 + "px");
            }
 
        </script>
    </telerik:RadScriptBlock>
      
    <br />
    <div>
        <telerik:RadDockLayout runat="server" ID="RadDockLayout1" StoreLayoutInViewState="false">
            <telerik:RadDockZone runat="server" ID="RadDockZone4" Width="372px" Style="float: left;
                margin-right: 5px" BorderColor="#E1E1E1" BorderStyle="Solid">
                <telerik:RadDock ID="RadDock4" runat="server" Resizable="true" Width="350px" EnableRoundedCorners="true"
                    OnClientResizeEnd="ResizeChart">
                    <ContentTemplate>
                        <div>
                            <telerik:RadChart ID="RadChart1" runat="server">
                                <Series>
                                    <telerik:ChartSeries>
                                        <Items>
                                            <telerik:ChartSeriesItem YValue="3">
                                            </telerik:ChartSeriesItem>
                                            <telerik:ChartSeriesItem YValue="6">
                                            </telerik:ChartSeriesItem>
                                            <telerik:ChartSeriesItem YValue="2">
                                            </telerik:ChartSeriesItem>
                                            <telerik:ChartSeriesItem YValue="1">
                                            </telerik:ChartSeriesItem>
                                            <telerik:ChartSeriesItem YValue="5">
                                            </telerik:ChartSeriesItem>
                                            <telerik:ChartSeriesItem YValue="4">
                                            </telerik:ChartSeriesItem>
                                        </Items>
                                    </telerik:ChartSeries>
                                </Series>
                            </telerik:RadChart>
                        </div>
                    </ContentTemplate>
                </telerik:RadDock>
            </telerik:RadDockZone>
            <telerik:RadDockZone runat="server" ID="RadDockZone5" Width="372px" Style="float: left;
                margin-right: 5px;" BorderColor="#E1E1E1" BorderStyle="Solid">
                <telerik:RadDock ID="RadDock5" runat="server" Resizable="true" Width="327px" EnableRoundedCorners="true">
                    <ContentTemplate>
                        asdfads
                    </ContentTemplate>
                </telerik:RadDock>
            </telerik:RadDockZone>
            <telerik:RadDockZone runat="server" ID="RadDockZone6" Width="372px" Style="float: left;"
                BorderColor="#E1E1E1" BorderStyle="Solid">
                <telerik:RadDock ID="RadDock6" runat="server" Resizable="true" Width="327px" EnableRoundedCorners="true">
                    <ContentTemplate>
                        asdf
                    </ContentTemplate>
                </telerik:RadDock>
            </telerik:RadDockZone>
        </telerik:RadDockLayout>
    </div>
    </form>
</body>
</html>

aykut
Top achievements
Rank 1
 answered on 06 Sep 2011
1 answer
243 views
Hi,
pleas I need your help...
This is the error


...and this is all the code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.Adapters;
using Oracle.DataAccess.Client;
using Telerik.OpenAccess.Config.Sql;
using System.Data;
using Telerik.Web.UI;
using System.Configuration;
using System.IO;
using System.Collections;

namespace WebApplication1
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        private OracleConnection conn = new OracleConnection();
        string ConnString= "data source=OG_DB2;password=ghid101;user id=OG_GHIDONI";
        string sql = " select tasso_iva, data_inizio, data_fine from tassi_iva group by tasso_iva, data_inizio, data_fine";

        protected void Page_Load(object sender, EventArgs e)
        {
            string ConnString = "data source=OG_DB2;password=ghid101;user id=OG_GHIDONI";

            conn.ConnectionString = ConnString; //ccc associo la connection string con un connection object

            try
            {
                conn.Open();    //ccc apro la connessione

            }

            catch (Exception ex) // ccc catches any error
            {
                MessageBox.Show(ex.Message.ToString());
            }


        }

        protected void Page_Init(object sender, EventArgs e)
        {
            RadListView1.NeedDataSource += (s, args) =>
            {
                RadListView1.DataSource = GetDataSet(sql);
                // ccc il max per selezionare prima quello con la data d'inizio maggiore non gli piace! Trovare altra sol!!
            };

        }


        protected void RadListView1_ItemUpdating(object sender, RadListViewCommandEventArgs e)
        {
            RadListViewEditableItem editedItem = (RadListViewEditableItem)e.ListViewItem;
            Hashtable newValues = new Hashtable();
            editedItem.ExtractValues(newValues);

            DataTable IvaTable = RadListViewSource;

            //Locate the changed row in the DataSource
            DataRow[] changedRows = IvaTable.Select("tasso_iva = " + editedItem.GetDataKeyValue("tasso_iva"));

            if (changedRows.Length != 1)
            {
                e.Canceled = true;
                return;
            }

            //Update new values
            changedRows[0].BeginEdit();
            try
            {
                foreach (DictionaryEntry entry in newValues)
                {
                    changedRows[0][(string)entry.Key] = entry.Value;
                }
                changedRows[0].EndEdit();
                this.ViewState["lvds"] = IvaTable;
            }

            catch (Exception ex)
            {
                changedRows[0].CancelEdit();
                //output a warning message as necessary
                e.Canceled = true;
                 MessageBox.Show(ex.Message.ToString());
            }
            
        }

        protected void RadListView1_ItemInserting(object sender, RadListViewCommandEventArgs e)
        {
            RadListViewEditableItem insertedItem = (RadListViewEditableItem)e.ListViewItem;
            Hashtable newValues = new Hashtable();
            insertedItem.ExtractValues(newValues);
            DataTable IvaTable = RadListViewSource;

            DataRow newRow = IvaTable.NewRow();

            try
            {
                newRow["tasso_iva"] = IvaTable.Rows.Count + 1;
                foreach (DictionaryEntry entry in newValues)
                {
                    newRow[(string)entry.Key] = entry.Value;
                }
                IvaTable.Rows.Add(newRow);
                this.ViewState["lvds"] = IvaTable;
            }
            catch (Exception ex)
            {
                //output a warning message as necessary
                MessageBox.Show(ex.Message.ToString());
                e.Canceled = true;
            }
        }

        protected void RadListView1_ItemDeleting(object sender, RadListViewCommandEventArgs e)
        {
            try
            {
                DataTable IvaTable = this.RadListViewSource;

                DataColumn pk = IvaTable.Columns["tasso_iva"];
                DataColumn[] pkeys = new DataColumn[1];
                pkeys[0] = pk;
                IvaTable.PrimaryKey = pkeys;

                int id = int.Parse(e.CommandArgument.ToString());

                IvaTable.Rows.Find(id).Delete();
                IvaTable.AcceptChanges();
                this.ViewState["lvds"] = IvaTable;
            }
            catch (Exception ex)
            {
                //output a warning message as necessary
                MessageBox.Show(ex.Message.ToString());
                e.Canceled = true;
            }
        }

        private DataTable RadListViewSource
        {
            get
            {
                Object obj = ViewState["lvds"];
                if (obj != null)
                {
                    return (DataTable)obj;
                }
                else
                {
                    DataTable listViewDataSource;

                    listViewDataSource = new DataTable();

                    OracleDataAdapter adapter = new OracleDataAdapter(sql, ConnString);
                    adapter.Fill(listViewDataSource);

                    ViewState["lvds"] = listViewDataSource;
                    return listViewDataSource;
                }
            }
        }




        protected void RadListView1_NeedDataSource(object source, Telerik.Web.UI.RadListViewNeedDataSourceEventArgs e)
        {
            RadListView1.DataSource = GetDataSet(" select tasso_iva, max(data_inizio), data_fine from tassi_iva group by tasso_iva, data_inizio, data_fine");
            //+ "where data_inizio = to_date('01.01.01', 'DD.MM.YY')";
        }

        public DataSet GetDataSet(string query)
        {
            string ConnString = "data source=OG_DB2;password=ghid101;user id=OG_GHIDONI";
            //string qry = " select tasso_iva, max(data_inizio), data_fine from tassi_iva group by tasso_iva, data_inizio, data_fine";

            OracleDataAdapter adapter = new OracleDataAdapter(query, ConnString);

            DataSet ds = new DataSet();


            try
            {
                adapter.Fill(ds, "tassi_iva");
            }
            finally
            {
                conn.Close();
            }
            return ds;
        }

    }
}

Somebody can help me?
Thanks a lot
clo
Top achievements
Rank 1
 answered on 06 Sep 2011
1 answer
265 views
I have a RadGrid with a GridClientDeleteColumn. The table also has a ItemTemplate with a RadNumericTextBox so values can be entered and udpate a total in the footer client side just like this example.

http://mono.telerik.com/Controls/Examples/Integration/GridAndInput/DefaultCS.aspx?product=grid

However, because of the DeleteColumn, whenever a user enters a new value in the TextBox on a row, and hits enter, the row gets deleted, it's firing off the delete event? Why? If I remove the DeleteColumn, of course, this no longer happens.

I tried adding OnClientEvent OnKeyPress event handler to capture the enter being pressed but can't find the documentation to tell me what the 'isEnterKey' property name is that shows in the debugger

Can I disable this somehow so the delete doesn't occur on pressing the enter key and the user has to click the delete button?

<telerik:GridClientDeleteColumn ButtonType="ImageButton" HeaderStyle-Width="25px" ItemStyle-Width="25px" />
...

 

 

 

<telerik:GridTemplateColumn UniqueName="awardCol" DataField="Amount" HeaderText="Amount">

 

 

 

<ItemTemplate>

 

 

 

<telerik:RadNumericTextBox ID="amountEntryField" DataType="System.Double" MinValue="1.0" Value='<%# Eval("Amount") %>' runat="server">

 

 

 

<ClientEvents OnBlur="amtBlur" OnFocus="amtFocus" OnKeyPress="updateAmount" />

 

 

 

</telerik:RadNumericTextBox>

 

 

 

</ItemTemplate>

 

Tsvetina
Telerik team
 answered on 06 Sep 2011
1 answer
112 views
We are using Radeditor export to PDF feature to generate a Radeditor contents into PDF format and saving it to sharepoint document library.
We wanted to make reverse of this functionlity i.e wanted to replace a Radeditor body with PDF contents so that user can edit contents and genrate a new PDF again.
How can we implement this scenario. 
Rumen
Telerik team
 answered on 06 Sep 2011
1 answer
63 views
I have a Radcombobox that is bind from the database.
i have put the following properties TRUE
ShowMoreResultsBox=true
EnableVirtualScrolling=true
EnableLoadOnDemand=true
ItemPerRequest=20
it works fine.
Suppose i add a Employee record. on the Employee add form there is a Radcombobox that have the Cities filled with it from the City table in database. when i click on the Radcombobox with each request next 20 cities are shown, its fine. Selected city suppose "California" is selected and inserted in database.
now when i come in edit mode i write down the code to select the california that was already added in database.
RadCombobox1.SelectedValue=20;  //California State ID from the database.
but it is not shown by default unless we click on the radCombobox.
I want that Seleceted state should be displayed by default and as well as pagination should be worked with above mentioned properties.

 
Ivana
Telerik team
 answered on 06 Sep 2011
1 answer
77 views
Hi there,

At the moment I am working with recourses. I have 2 agenda's in my scheduler now. But I have a problem. I am working with schemes. And one person has another scheme than another person. When a person clicks on a timeslot I have to check if the person create an appointment and not outside of that scheme. How can I get the timeslot resource key when clicking on a timeslot? I need it in C#.

I hope someone can help me.

Thanks in advance.

Sander
Ivana
Telerik team
 answered on 06 Sep 2011
1 answer
160 views
Hi,
I'm using RadScheduler control with AdvancedInsertTemplate and AvancedEditTemplate.
I'm using the same ascx to declare the template, and when I create an Appointment it works correctly, but when I try to edit it or another appointment I don't find the new values in e.ModifiedAppointment object but in e.Appointment.

I've fired the event AppointmentCommand e AppointmetInsert, AppointmentUpdate.
In the first event I check the CommandName to find the correct template in which find the controls (eg: textbox, dropdownlist)
After fire the   AppointmetInsert and it works.

In EditMode this not works.

This is my ASCX codebehind

/// <summary>
/// Restituisce o imposta la modalità di accesso alla form
/// </summary>
[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
public SchedulerFormMode Modalita { get; set; } // qui non è necessario usare il viewstate perchè non viene agganciata da un datareader
/// <summary>
/// Restituisce o imposta il titolo della form
/// </summary>
[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
public string FormTitle { get; set; } // qui non è necessario usare il viewstate perchè non viene agganciata da un datareader
/// <summary>
/// Restituisce o imposta l'id dell'attività
/// </summary>
[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
public int AppointmentId
{
    get { return Convert.ToInt32(this.ViewState["AppointmentId"]); }
    set { this.ViewState["AppointmentId"] = value; }
}
/// <summary>
/// Restituisce o imposta l'oggetto dell'attività
/// </summary>
[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
public string Subject
{
    get { return this.ViewState["Subject"].ToString(); }
    set { this.ViewState["Subject"] = value; }
}
/// <summary>
/// Restituisce o imposta l'autore dell'attività
/// </summary>
[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
public string Author 
{
    get { return this.ViewState["Author"].ToString(); }
    set { this.ViewState["Author"] = value; }
}
/// <summary>
/// Restituisce o imposta a descrizione dell'attività
/// </summary>
[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
public string Description
{
    get { return this.ViewState["Description"].ToString(); }
    set { this.ViewState["Description"] = value; }
}
/// <summary>
/// Restituisce o imposta la data e l'ora di inizio dell'attività
/// </summary>
[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
public DateTime Start
{
    get { return Convert.ToDateTime(this.ViewState["Start"]); }
    set { this.ViewState["Start"] = value; }
}
/// <summary>
/// Restituisce o imposta la data e l'ora di fine dell'attività
/// </summary>
[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
public DateTime End
{
    get { return Convert.ToDateTime(this.ViewState["End"]); }
    set { this.ViewState["End"] = value; }
}
/// <summary>
/// Restituisce o imposta la regola di ripetizione dell'attività
/// </summary>
[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
public string RecurrenceRule
{
    get { return this.ViewState["RecurrenceRule"].ToString(); }
    set { this.ViewState["RecurrenceRule"] = value; }
}
/// <summary>
/// Restituisce o imposta la regole di promemoria dell'attività
/// </summary>
[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
public string Reminders
{
    get { return this.ViewState["Reminders"].ToString(); }
    set { this.ViewState["Reminders"] = value; }
}
 
And this are the three events in ASPX code behind

protected void Scheduler_AppointmentUpdate(object sender, AppointmentUpdateEventArgs e)
{
    SchedulerTask taskToEdit = Scheduler[Convert.ToInt32(e.Appointment.ID)];
    taskToEdit.Comments = e.ModifiedAppointment.Description;
    taskToEdit.StartTime = e.ModifiedAppointment.Start;
    taskToEdit.EndTime = e.ModifiedAppointment.End;
    taskToEdit.Subject = e.ModifiedAppointment.Subject;
    taskToEdit.Tipologia = e.ModifiedAppointment.Resources.GetResourceByType("Tipologia") != null ?
        (TipologiaTask)Convert.ToInt32(e.ModifiedAppointment.Resources.GetResourceByType("Tipologia").Key) : TipologiaTask.Varie_Note;
    taskToEdit.Reminder = e.ModifiedAppointment.Reminders.ToString();
    taskToEdit.Recurrence = e.ModifiedAppointment.RecurrenceRule;
    taskToEdit.RecurrenceParentID = e.ModifiedAppointment.RecurrenceParentID;
    taskToEdit.Stato = StatoTask.MODIFICA;
      
    taskToEdit.Salva();
    this.schGestioneLocazioni.DataSource = Scheduler.CopyToDataTable();
}
 
protected void Scheduler_AppointmentInsert(object sender, AppointmentInsertEventArgs e)
{
    try
    {
        // recupero la tipologia selezionata dall'utente tramite la finestra modale di editing
        // se non ha impostato nulla imposto io una tipologia di default
        TipologiaTask tipologia = e.Appointment.Resources.GetResourceByType("Tipologia") == null ?
            TipologiaTask.Property_Management_Note : (TipologiaTask)Convert.ToInt32(e.Appointment.Resources.GetResourceByType("Tipologia").Key);
          
        string autore = e.Appointment.Attributes["Autore"] == null ?
            SchedulerConstants.Autori.SCH_AUTORE_SYS : e.Appointment.Attributes["Autore"].ToString();
 
 
        SchedulerTask taskToAdd = Scheduler.NewSchedulerTask(
                                    e.Appointment.Subject,                  // oggetto
                                    e.Appointment.Description,              // descrizione
                                    e.Appointment.Start,                    // inizio
                                    e.Appointment.End,                      // fine
                                    tipologia,                              // tipologia
                                    e.Appointment.Reminders.ToString(),     // promemoria (basta fare il ToString della Collection e ottengo il reminder formattato
                                    e.Appointment.RecurrenceRule,           // regola di ricorrenza   
                                    e.Appointment.RecurrenceParentID,       // parent ID
                                    StatoTask.INSERIMENTO,
                                    SchedulerTaskAvvisato.NO,
                                    autore,
                                    DateTime.Now);
 
 
        Scheduler.Add(taskToAdd);
        this.schGestioneLocazioni.DataSource = Scheduler.CopyToDataTable();
        RadAjaxManager.GetCurrent(this).Alert("Appointment was inserted successfully.");
    }
    catch (SqlForeignKeyConstraintException ex)
    {
        RadAjaxManager.GetCurrent(this).Alert(ex.Message);
    }
    catch (SqlException ex)
    {
        RadAjaxManager.GetCurrent(this).Alert(ex.Message);
    }
    catch (Exception)
    {
        RadAjaxManager.GetCurrent(this).Alert(MessaggiException.Exception);
    }
}
 
 
protected void Scheduler_AppointmentCommand(object sender, AppointmentCommandEventArgs e)
{
    Control SchedulerAdvancedForm;
    switch (e.CommandName.ToLower())
    {
        case "insert":
            SchedulerAdvancedForm = e.Container.FindControl("advTemplateInsert"); break;
        case "update":
            Scheduler.ReadTasks();  // rileggo per avere eventuali nuove task inserite sul db
            SchedulerAdvancedForm = e.Container.FindControl("advTemplateEdit"); break;
        default:
            SchedulerAdvancedForm = e.Container.FindControl("advTemplateInsert"); break;
    }
 
    if (SchedulerAdvancedForm != null)
    {
        e.Container.Appointment.Subject = ((RadTextBox)SchedulerAdvancedForm.FindControl("txtAdvInsertSubject")).Text;
        e.Container.Appointment.Description = ((RadTextBox)SchedulerAdvancedForm.FindControl("txtAdvInsertDescription")).Text;
        e.Container.Appointment.Attributes["Autore"] = ((RadTextBox)SchedulerAdvancedForm.FindControl("txtAdvInsertAuthor")).Text;
        e.Container.Appointment.Start = ((RadDateTimePicker)SchedulerAdvancedForm.FindControl("rtpAdvInsertStartTime")).SelectedDate.Value;
        e.Container.Appointment.End = ((RadDateTimePicker)SchedulerAdvancedForm.FindControl("rtpAdvInsertEndTime")).SelectedDate.Value;
          
    }
}

Where I wrong?

Best Regards
Plamen
Telerik team
 answered on 06 Sep 2011
2 answers
63 views
Hi there,

I'm using a custom GridTemplateColumn to do some filtering. The filter combo-box is bound to a Dictionary<int, string> and renders with no problems; it's bound with:

            rcBox.DataTextField = "value";
            rcBox.DataValueField = "key";

When I try to select an item from the list however, I get an error message "Expression expected" with the following code:

        private void rcBox_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            ((GridFilteringItem)(((RadComboBox)sender).Parent.Parent)).FireCommandEvent("Filter", new Pair());
        }

The code was previously:

        private void rcBox_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            ((GridFilteringItem)(((RadComboBox)sender).Parent.Parent)).FireCommandEvent("Filter", new Pair("EqualTo", this.UniqueName));
        }

but that also gives "Expression Expected" with a UniqueName value of "key".

Any thoughts?

Thank you,

Mike K.
Mike
Top achievements
Rank 1
 answered on 06 Sep 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?