This is a migrated thread and some comments may be shown as answers.

Telerik DropDown Dynamic popoulate

12 Answers 176 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Manne
Top achievements
Rank 1
Manne asked on 01 Oct 2015, 05:05 AM
Hello Team,
                    I am here to say that i am having a Parent telerik dropdown which consists two values. If i select any one value from parent dropdown a new child telerik dropdown must  be visible (Means selecting Parent telerik dropdown value a new dropdown must be visible) in telerik rad scheduler.Is it possible to do so ? if yes provide some sample or code to over come this problem.

12 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 01 Oct 2015, 02:09 PM
Hello Manne,

Thank you for writing.

The provided brief description is not enough for me to understand completely the exact requirement. I suppose that you are trying to customize the Appointment create/edit dialog. Please refer to the Adding a custom field to the EditAppointment dialog help article which demonstrates how to inherit the EditAppointmentDialog and add some new fields. You can follow approach for hiding/showing specific controls.

If it is not the case, please specify in details what you are trying to achieve. Thus, we would be able to think about a suitable solution and assist you further. Thank you in advance. 

Should you have further questions I would be glad to help.
 
Regards,
Dess
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Manne
Top achievements
Rank 1
answered on 03 Oct 2015, 05:47 AM
Hello Dess,
                   Thank you for the reply I need a new telerik dropdown in rad scheduler (appointment) when i select a  telerik dropdown value which am having at present in rad scheduler. Means i need a new telerik dropdown  with existing telerik dropdown list value by selecting a value in present dropdown i need a new telerik drop down should be generated or populated. 
0
Manne
Top achievements
Rank 1
answered on 03 Oct 2015, 06:01 AM
i am continuing earliest ticket .....  Means in one word i need "Populate telerik DropDownList Based on Selected Value in telerik DropDownList"
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 06 Oct 2015, 10:57 AM
Hello Manne,

Thank you for writing back.
 
I am not sure that I understand your requirement completely. However, note that RadDropDownList has SelectedIndexChanged event which gives you the opportunity to detect when the selection changes. In the event handler, you can manipulate the Visible property of another RadDropDownList and populate it with data either via data binding or programmatically. Thus, you can control when the RadDropDownList will be visible and what data to display. Alternatively, instead of manipulating the visibility, you can add/remove the RadDropDownList in the Controls collection of the parent container.

If none of the suggested approaches are suitable for your case, please give us explanation about the exact requirement that you are trying to achieve and where exactly you want to display the RadDropDownList. Thus, we would be able to assist you further. Thank you.

I hope this information helps. If you have any additional questions, please let me know.

Regards,
Dess
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Manne
Top achievements
Rank 1
answered on 06 Oct 2015, 11:19 AM
Hello Dess,
                    I am having a rad scheduler (appointment) in that i am having one telerik dropdown in that i am having two values . if i select any one value from present  telerik dropdown i need a new telerik dropdown in next line with out page loading (Means in one word Cascading present telerik drop down i need new telerik drop down) . I hope did you got requirement now
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 06 Oct 2015, 11:50 AM
Hello Manne,

Thank you for writing back.
 
Following the provided information and explained approach from my previous post, I have prepared a sample project demonstrating how to create a custom AppointmentElement with two RadDropDownListElements. The second one is shown when the second item from the top dropdown is selected. Note that this is just a sample approach and it may not cover all possible cases. Feel free to modify it in a way which suits your requirement best.

The Scheduler >> Scheduler Element Provider help article is quite useful about replacing scheduler elements with your custom ones.

I hope this information helps. If you have any additional questions, please let me know.
Regards,
Dess
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Manne
Top achievements
Rank 1
answered on 07 Oct 2015, 05:40 AM

Hello Dess,

Thank you for writing back to me ! 

 This what i am expecting from you.But i need this same concept at <telerik:radscheduler> you have created in list of appointments for the day but when i click on list of appointments a pop up will be open.In pop up i am using <telerik:radscheduler>  In that i need this concept . For more information i am enclosing  code and screen shot in that i need your concept with out page load.
<telerik:radscheduler id="MyRadSchedulerRD" runat="server" datakeyfield="ID" datastartfield="Start"
                                            advancedform-enablecustomattributeediting="true" datasubjectfield="Subject" daystarttime="08:00:00"
                                            dayendtime="21:00:00" timezoneoffset="00:00:00" datadescriptionfield="Description"
                                            dataendfield="End" width="800px" skin="Default" onappointmentcommand="RadScheduler1_AppointmentCommand"
                                            onformcreated="RadScheduler1_FormCreated" onappointmentupdate="RadScheduler_AppointmentUpdate"
                                            overflowbehavior="Expand" onclientappointmentediting="OnClientAppointmentEditing"
                                            startinsertinginadvancedform="true" datarecurrencefield="" onclienttimeslotclick="insertAppointment"
                                            onclientappointmentclick="editAppointment">
                                            <%--<AdvancedForm EnableResourceEditing="false" />--%>
                                             <AdvancedForm Modal="true"></AdvancedForm>                                             
                                             <WeekView HeaderDateFormat="dd/MM/yyyy"></WeekView>
                                            <AppointmentTemplate>
                                                <span><b>
                                                    <%# Eval("Subject") %>:&nbsp;</b></span><span style="font-style: italic;">
                                                        <%# Eval("Description") %></span>
                                                         <span style="font-style: italic;"></span>                                                                                                            
                                     
                                            </AppointmentTemplate>

                                          <%--   <ResourceTypes>
                                                                 <telerik:radcombobox id="ddAssigns" runat="server" width="200" height="200" emptymessage="Select User"
                                            datasourceid="ObjectDataSourceAssignedTo" datatextfield="OName" datavaluefield="AssignTo">
               </telerik:radcombobox>
                                             </ResourceTypes>--%>
                                             <ResourceTypes>
                                                <telerik:ResourceType KeyField="ViewATFlag" Name="Type*" TextField="ViewATFlagText" ForeignKeyField="ViewATFlag"
                                                    DataSourceID="ObjectDataSourceTypes" />
                                            </ResourceTypes>
                                              <ResourceTypes>
                                                <telerik:ResourceType KeyField="AssignTo" Name="Assigned To*" TextField="OName" ForeignKeyField="AssignTo"
                                                    DataSourceID="ObjectDataSourceAssignedTo" />
                                            </ResourceTypes>
                                            <ResourceTypes>
                                                <telerik:ResourceType KeyField="Apptype" Name="Property Type*" TextField="ResType" ForeignKeyField="Apptype"
                                                    DataSourceID="Propertytype" />
                                            </ResourceTypes>
                                            <ResourceTypes>
                                               <telerik:ResourceType KeyField="PropTo" Name="Sale*" TextField="OProp" ForeignKeyField="PropTo"
                                                    DataSourceID="ObjectDataSourcePropTo" />
                                            </ResourceTypes>
                                            <ResourceTypes>
                                               <telerik:ResourceType KeyField="PropTolet" Name="Letting*" TextField="OProplet" ForeignKeyField="PropTolet"
                                                    DataSourceID="ObjectDataSourcePropTolet" />
                                            </ResourceTypes>                                                              
                                                              
                                            <ResourceTypes>
                                                <telerik:ResourceType KeyField="ViewValFlag" Name="Flag" TextField="ResText" ForeignKeyField="ViewValFlag"
                                                    DataSourceID="ObjectDataSourceResource" />
                                            </ResourceTypes>          
                                            <ResourceTypes>
                                                <telerik:ResourceType KeyField="AppStatus" Name="Status*" TextField="ResText" ForeignKeyField="AppStatus"
                                                    DataSourceID="AppointmentTypesDataSource" />
                                            </ResourceTypes>
                                            <ResourceStyles>
                                                <telerik:ResourceStyleMapping Key="1" Text="Viewing" ApplyCssClass="rsCategoryBlue" />
                                                <telerik:ResourceStyleMapping Key="2" Text="Valuation" ApplyCssClass="rsCategoryRed" />
                                                <telerik:ResourceStyleMapping Key="3" Text="Follow Up" ApplyCssClass="rsCategoryGreen" />
                                            </ResourceStyles>                                                                                 
                                        </telerik:radscheduler>

 

and also once look over screen shot

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 07 Oct 2015, 06:37 AM
Hello Manne,

Thank you for writing back.

I would like to note that this forum is related to RadScheduler for the Telerik UI for WinForms suite. If this is not the exact product that you are currently using, feel free to open a thread in the appropriate forum: http://www.telerik.com/forums.

I hope this information helps. 

Regards,
Dess
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Kareem
Top achievements
Rank 2
answered on 29 Oct 2017, 09:27 PM
Hi,  when i try the data binding with data table if give me a null error that object is not set also the data table have data on it ?!
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 30 Oct 2017, 02:14 PM
Hello, Kareem,

Thank you for writing.  

The provided information is not enough for me to understand the complete scenario that you have and the problem you are facing. Could you please specify the exact steps how to reproduce the problem? Alternatively, you can submit a support ticket where you can provide a sample project demonstrating the exact error that you are trying to handle. Thus, we would be able to investigate the precise case and assist you further. Thank you in advance. 

I am looking forward to your reply.

Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Kareem
Top achievements
Rank 2
answered on 30 Oct 2017, 06:46 PM

 

when radDropDownList2_SelectedIndexChanged triggered radDropDownList1.selected text comes null also it have value

 

 

 

 

 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.Win32;
using System.Data.SqlClient;
 
namespace SmartSeating
{
    public partial class Form1 : Form
    {
 
        string strconnection = @"Data Source=.;Initial Catalog=SmartSeating;Integrated Security=True";
 
 
        public Form1()
        {
          
            InitializeComponent();
            
 
            DataTable Building = new DataTable();
            DataTable y = new DataTable();
            DataTable Seating = new DataTable();
            Building = SelectQuery("SELECT distinct [x]  FROM [SmartSeating].[dbo].[Seating_Status]", strconnection);
            this.radDropDownList1.DataSource = Building;
            this.radDropDownList1.DisplayMember = "x";          
            y = SelectQuery("SELECT distinct [y]  FROM [SmartSeating].[dbo].[Seating_Status] where [x] = '" + this.radDropDownList1.SelectedText + "'", strconnection);
            this.radDropDownList2.DataSource = y;
            this.radDropDownList2.DisplayMember = "y";
            Seating = SelectQuery("SELECT distinct [z]  FROM [SmartSeating].[dbo].[Seating_Status] where [x] = '" + this.radDropDownList1.SelectedText + "' and [y] = '" + this.radDropDownList2.SelectedText + "'", strconnection);
            this.radDropDownList3.DataSource = Seating;
            this.radDropDownList3.DisplayMember = "z";
 
        }
 
        public void InsertQuery(string qry, string connection)
        {
            SqlConnection conne = new SqlConnection(connection);
            SqlCommand cmd = new SqlCommand();
            cmd.CommandType = CommandType.Text;
            cmd.CommandText = qry;
            cmd.Connection = conne;
            conne.Open();
            cmd.ExecuteNonQuery();
            conne.Close();
        }
        public DataTable SelectQuery(string qry, string connection)
        {
 
            SqlConnection conn = new SqlConnection(strconnection);
            SqlCommand cmd2 = new SqlCommand();
            cmd2.CommandType = CommandType.Text;
            cmd2.CommandText = qry;
            cmd2.Connection = conn;
            conn.Open();
            SqlDataAdapter dscmd = new SqlDataAdapter(qry, strconnection);
            DataTable ds = new DataTable();
            dscmd.Fill(ds);
            conn.Close();
            return ds;
        }
       
     
 
        private void radDropDownList1_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e)
        {
            DataTable y = new DataTable();
            DataTable Seating = new DataTable();
            y = SelectQuery("SELECT distinct [y]  FROM [SmartSeating].[dbo].[Seating_Status] where [x] = '" + this.radDropDownList1.SelectedText + "'", strconnection);
            Seating = SelectQuery("SELECT distinct [z]  FROM [SmartSeating].[dbo].[Seating_Status] where [x] = '" + this.radDropDownList1.SelectedText + "' and [y] = '" + this.radDropDownList2.SelectedText + "'", strconnection);
 
            
            this.radDropDownList2.DataSource = y;
            this.radDropDownList2.DisplayMember = "y";
 
            this.radDropDownList3.DataSource = Seating;
            this.radDropDownList3.DisplayMember = "z";
        }
 
       
 
 
        private void radDropDownList2_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e)
        {
            DataTable Seating = new DataTable();
           Seating = SelectQuery("SELECT distinct [z]  FROM [SmartSeating].[dbo].[Seating_Status] where [x] = '" + this.radDropDownList1.SelectedText + "' and [y] = '" + this.radDropDownList2.SelectedText + "'", strconnection);
 
 
            this.radDropDownList3.DataSource = Seating;
            this.radDropDownList3.DisplayMember = "z";
        }
 
       
    }
}
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 31 Oct 2017, 11:25 AM
Hello, Kareem,    

Thank you for writing back. 

It seems that your question is related to RadDropDownList but not RadScheduler as the product for the thread is specified. I would kindly ask you to open a separate thread with the appropriate product (RadDropDownList for WinForms) and to avoid mixing different subjects in the same thread in future. This will also give you the opportunity to track the different cases easily in your account. Thank you for your understanding.

As a gesture of good will, we will address this question. A usual case is when users use a common DataSource for several controls. Thus, when you change the selection for one of the controls that use this DataSource, the other controls are also affected. This is because the Current item is changed in the DataSource. That is why I would recommend you to use different DataSource objects (e.g. a different DataTable instance) although they can be populated with the same data.

I hope this information helps. If you have any additional questions, please let me know. 

 Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Scheduler and Reminder
Asked by
Manne
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Manne
Top achievements
Rank 1
Kareem
Top achievements
Rank 2
Share this question
or