Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
83 views
Hi,

I am trying to access a dropdown call "DropdownlistOuter" so I can attach a data source to it AFTER a row is put in edit mode. 
How do I get a handle to this control at run time when the Edit link is pressed.

Thanks!

Suresh

Here is the relevant aspx script.

 

<telerik:RadGrid ID="RadGridEmpData" runat="server" Width="800px" AllowPaging="True" AutoGenerateColumns="False" GridLines="None" Height="200px" PageSize="2" ShowGroupPanel="True" >

 

 

<ClientSettings AllowDragToGroup="True">

 

 

<Scrolling FrozenColumnsCount="4"/>

 

 

</ClientSettings>

 

 

<MasterTableView>

 

 

<columns>

 

 

<telerik:GridEditCommandColumn></telerik:GridEditCommandColumn>

 

 

<telerik:GridImageColumn ImageUrl="IMAGES/add_icon.gif" ImageHeight="" ImageWidth="" UniqueName="column" ></telerik:GridImageColumn>

 

 

<telerik:GridBoundColumn

 

 

DataField="EmployeeNo"

 

 

DataType="System.DateTime"

 

 

HeaderText="Employee No"

 

 

SortExpression="EmployeeNo"

 

 

UniqueName="EmployeeNo">

 

 

<ItemStyle Width="120px" />

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridTemplateColumn SortExpression="EmployeeNo" DataField="EmployeeNo" HeaderText="EmployeeNo" UniqueName="TemplateColumn">

 

 

<ItemTemplate>

 

 

<asp:LinkButton ID="LinkButtonEmployeeNo" runat="server" Text='<%#Eval("EmployeeNo")%>'></asp:LinkButton>

 

<%

--<asp:LinkButton ID="LinkButton1" runat="server"><%#Eval("EmployeeNo")%></asp:LinkButton>--%>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn SortExpression="Site" DataField="Site" HeaderText="Site" UniqueName="Site">

 

 

<ItemTemplate>

 

 

&nbsp;<asp:DropDownList ID="DropDownList1" runat="server">

 

 

</asp:DropDownList>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn SortExpression="EmployeeName" DataField="EmployeeName" HeaderText="EmployeeName" UniqueName="EmployeeName">

 

 

<ItemTemplate>

 

 

&nbsp;<asp:textbox ID="TextBoxEmployeeName" runat="server">

 

 

</asp:textbox>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridBoundColumn DataField="EmployeeNo" DataType="System.Int64" HeaderText="Employee No" SortExpression="EmployeeNo" UniqueName="EmployeeNo"><ItemStyle Width="120px" /></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="ProposalVersionId" HeaderText="ProposalVersionId" SortExpression="ProposalVersionId" UniqueName="ProposalVersionId"><ItemStyle Width="120px" /></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="OriginalCC" HeaderText="OriginalCC" SortExpression="OriginalCC" UniqueName="OriginalCC"><ItemStyle Width="120px" /></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="LevelDesc" HeaderText="LevelDesc" SortExpression="LevelDesc" UniqueName="LevelDesc"><ItemStyle Width="120px" /></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="AnnualSalary" DataType="System.Decimal" HeaderText="AnnualSalary" SortExpression="AnnualSalary" UniqueName="AnnualSalary"><ItemStyle Width="120px" /></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="AssessmentDate" DataType="System.DateTime" HeaderText="AssessmentDate" SortExpression="AssessmentDate" UniqueName="AssessmentDate"><ItemStyle Width="120px" /></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="CostRate" DataType="System.Decimal" HeaderText="CostRate" SortExpression="CostRate" UniqueName="CostRate"><ItemStyle Width="120px" /></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="BurdenRate" DataType="System.Decimal" HeaderText="BurdenRate" SortExpression="BurdenRate" UniqueName="BurdenRate"><ItemStyle Width="120px" /></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="LaborSchedule" HeaderText="LaborSchedule" SortExpression="LaborSchedule" UniqueName="LaborSchedule"><ItemStyle Width="120px" /></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="LaborCategoryCode" HeaderText="LaborCategoryCode" SortExpression="LaborCategoryCode" UniqueName="LaborCategoryCode"><ItemStyle Width="120px" /></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="ChangedUserId" HeaderText="ChangedUserId" SortExpression="ChangedUserId" UniqueName="ChangedUserId"><ItemStyle Width="120px" /></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="EnteredBy" HeaderText="EnteredBy" SortExpression="EnteredBy" UniqueName="EnteredBy"><ItemStyle Width="120px" /></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Notes" HeaderText="Notes" SortExpression="Notes" UniqueName="Notes"><ItemStyle Width="120px" /></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Education" HeaderText="Education" SortExpression="Education" UniqueName="Education"><ItemStyle Width="120px" /></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Experience" HeaderText="Experience" SortExpression="Experience" UniqueName="Experience"><ItemStyle Width="120px" /></telerik:GridBoundColumn>

 

 

</columns>

 

 

<EditFormSettings EditFormType="Template" >

 

 

<FormTemplate >

 

 

<table id="Table2" cellspacing="2" cellpadding="1" width="100%" border="1" rules="none"

 

 

style="border-collapse: collapse; background: white;">

 

 

<tr class="EditFormHeader">

 

 

<td colspan="2" style="font-size: small">

 

 

<b>Employee Details</b></td>

 

 

</tr>

 

 

<tr>

 

 

<td colspan="2">

 

 

<b>Company Info:</b></td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

 

<table id="Table6" cellspacing="1" cellpadding="1" width="250" border="0" class="module">

 

 

<tr>

 

 

<td>

 

 

</td>

 

 

<td>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

Country:

</td>

 

 

<td>

 

 

<asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind( "EmployeeNo" ) %>'>

 

 

</asp:TextBox></td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

City:

</td>

 

 

<td>

 

 

<asp:TextBox ID="TextBox8" runat="server" Text='<%# Bind( "EmployeeNo") %>' TabIndex="1">

 

 

</asp:TextBox></td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

Region:

</td>

 

 

<td>

 

 

<asp:TextBox ID="TextBox9" runat="server" Text='<%# Bind( "EmployeeNo") %>' TabIndex="2">

 

 

</asp:TextBox></td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

Home Phone:

</td>

 

 

<td>

 

 

<asp:TextBox ID="TextBox10" runat="server" Text='<%# Bind( "EmployeeNo") %>' TabIndex="3">

 

 

</asp:TextBox></td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

Birth Date:

</td>

 

 

<td>

 

 

<asp:TextBox ID="TextBox11" runat="server" Text='<%# Bind( "EmployeeNo") %>' TabIndex="4">

 

 

</asp:TextBox></td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

Title Of Courtesy

</td>

 

 

<td>

 

<%

-- <asp:DropDownList ID="DDLTOC" runat="server" SelectedValue='<%# Bind("EmployeeNo") %>'

 

DataSource='<%# (New string() { "Dr.", "Mr.", "Mrs.", "Ms." }) %>' TabIndex="7"

AppendDataBoundItems="True">

<asp:ListItem Selected="True" Text="Select" Value=""></asp:ListItem>

</asp:DropDownList>--

 

%></td>

 

 

</tr>

 

 

</table>

 

 

</td>

 

 

<td>

 

 

<table id="Table7" cellspacing="1" cellpadding="1" width="250" border="0" class="module">

 

 

<tr>

 

 

<td>

 

Notes:

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

 

<asp:TextBox ID="TextBox1" Text='<%# Bind( "EmployeeNo") %>' runat="server" TextMode="MultiLine"

 

 

Rows="5" Columns="40" TabIndex="5">

 

 

</asp:TextBox></td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

Address:

</td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

 

<asp:TextBox ID="TextBox6" Text='<%# Bind( "EmployeeNo") %>' runat="server" TextMode="MultiLine"

 

 

Rows="2" Columns="40" TabIndex="6">

 

 

</asp:TextBox></td>

 

 

</tr>

 

 

</table>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td colspan="2">

 

 

<b>Personal Info:</b></td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

 

<table id="Table8" cellspacing="1" cellpadding="1" width="250" border="0" class="module">

 

 

<tr>

 

 

<td>

 

FirstName:

</td>

 

 

<td>

 

 

<asp:TextBox ID="TextBox2" Text='<%# Bind( "EmployeeNo") %>' runat="server" TabIndex="8">

 

 

</asp:TextBox></td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

Last Name:

</td>

 

 

<td>

 

 

<asp:TextBox ID="TextBox3" Text='<%# Bind( "EmployeeNo") %>' runat="server" TabIndex="9">

 

 

</asp:TextBox></td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

Hire Date:

</td>

 

 

<td>

 

 

<asp:TextBox ID="Textbox5" Text='<%# Bind( "EmployeeNo") %>' runat="server" TabIndex="10">

 

 

</asp:TextBox></td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

Title:

</td>

 

 

<td>

 

 

<asp:TextBox ID="TextBox4" Text='<%# Bind( "EmployeeNo") %>' runat="server" TabIndex="11">

 

 

</asp:TextBox></td>

 

 

<td>

 

 

<asp:DropDownList Enabled="true" ID="DropDownListOuter" runat="server">

 

 

</asp:DropDownList>

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

</td>

 

 

<td>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td align="right" colspan="2">

 

 

<asp:Button ID="btnUpdate" Text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "Insert", "Update") %>'

 

 

runat="server" CommandName='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "PerformInsert", "Update")%>'>

 

 

</asp:Button>&nbsp;

 

<

 

asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"

 

CommandName

 

="Cancel"></asp:Button></td>

 

 

</tr>

 

 

</table>

 

 

</FormTemplate>

 

 

</EditFormSettings>

 

 

 

</MasterTableView>

 

 

</telerik:RadGrid>

 

Suresh Mishra
Top achievements
Rank 1
 answered on 01 Sep 2009
2 answers
67 views

my from is below.    on submit i would like to gather all the values from checkbox1
it comes from a database.    the idea is to  get all the items that the user keeps checked.





<

 

telerik:RadGrid ID="RadGrid1" runat="server"

 

 

DataSourceID="SqlDataSource1" GridLines="None" Skin="Sunset">

 

 

<MasterTableView autogeneratecolumns="False"

 

 

datasourceid="SqlDataSource1">

 

 

<RowIndicatorColumn>

 

 

<HeaderStyle Width="20px"></HeaderStyle>

 

 

</RowIndicatorColumn>

 

 

<ExpandCollapseColumn>

 

 

<HeaderStyle Width="20px"></HeaderStyle>

 

 

</ExpandCollapseColumn>

 

 

<Columns>

 

 

<telerik:GridTemplateColumn HeaderText=""

 

 

UniqueName="TemplateEditColumn">

 

 

<ItemTemplate>

 

 

<asp:CheckBox ID="CheckBox1" runat="server" Checked="True"></asp:CheckBox>

 

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridBoundColumn DataField="item" HeaderText="Accessories"

 

 

SortExpression="item" UniqueName="item">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="description" HeaderText="Description"

 

 

SortExpression="description" UniqueName="description">

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

</Columns>

 

 

</MasterTableView>

 

 

<HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"

 

 

Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"

 

 

Wrap="True" />

 

 

</telerik:RadGrid>

 

 

<asp:SqlDataSource ID="SqlDataSource1" runat="server"

 

 

ConnectionString="<%$ ConnectionStrings:wmConnectionString %>"

 

 

SelectCommand="wmUMEquipTableBySerial" SelectCommandType="StoredProcedure">

 

 

<SelectParameters>

 

 

<asp:QueryStringParameter DefaultValue="" Name="serial" QueryStringField="ID"

 

 

Type="String" />

 

 

</SelectParameters>

 

 

</asp:SqlDataSource>

 

 

<br />

 

Other options that you have installed

<br />

 

 

&nbsp;<asp:TextBox ID="TextBox1" runat="server" Width="610px" Height="122px"

 

 

TextMode="MultiLine"></asp:TextBox><br /><br />

 

 

<asp:CheckBox ID="CheckBox2" runat="server"

 

 

Text="Send me information about my trade-in options" /><br />

 

 

<asp:CheckBox ID="CheckBox3" runat="server"

 

 

Text="Send me information about consigning my mill on this website" /><br /><br />

 

 

<asp:Button ID="Button1" runat="server" Text="Submit" />&nbsp;&nbsp;&nbsp;&nbsp;<br /><br />

 

giani
Top achievements
Rank 1
 answered on 01 Sep 2009
2 answers
122 views
Hi,
I've noticed that TextChanged event is fired server side if I change modes (from Design to HTML) and do nothing else.
This gives the impression that there has been change to the content, but there hasn't.
Is there any way to address this?

Thanks!!


VF
Top achievements
Rank 1
 answered on 01 Sep 2009
1 answer
135 views
Hi,

I have a page with a single vertical splitter separating two RadPane's. The left hand pane has these settings:

<telerik:RadPane ID="LeftPane" runat="server" Width="250"> 

The Splitter has these settings:

<telerik:RadSplitBar ID="VerticalSplitBar" runat="server" CollapseMode="Forward" /> 

The right Pane has these settings:

 <telerik:RadPane ID="ContentPane" runat="server" > 

At the moment, the left pane houses a TreeView menu, sometimes the width of the menu exceeds the default 250px width setting of the pane, causing a horizontal scrollbar to appear, as can be seen in the following screenshot:

View Splitter Screenshot

What i'd prefer would be is if the splitter could increase in width to accommodate the full width of the treeview, an auto re-size if you will. I have tried removing the left RadPanes width setting, but this results in the starting width being 50% of the screen, which is far to wide.

Does anyone know if this is possible, either as an available setting or through CSS?

Thanx in advance.
Mr. Plinko
Top achievements
Rank 1
 answered on 01 Sep 2009
4 answers
160 views
Hi,

I have a very basic setup.

A very simple grid within a usercontrol.
I get a "Failed to load viewstate" error on every possible postback: paging, sorting, changing the pagesize...

I can't see any reasson for this, as I'm using grids in other usercontrols within the same project without any such problems.
I'm using Q1 2009 by the way.

I've tried disabling the viewstate in both the grid and the usercontrol, with no luck. If I disable the viewstate in the page the error goes away but I actually need that viewstate for other parts of the page.

Any thoughts on a solution?

Regards,
-DJ-

Pavlina
Telerik team
 answered on 01 Sep 2009
1 answer
118 views
Hi,

I have a RADGrid with static headers and scrolling enabled.
I set the height of the grid to be 400px.
When the page loads the grid first seems to open with the height of 400px, but then it expands to something like 420px.
What is the problem?

Thanks.
Pavlina
Telerik team
 answered on 01 Sep 2009
1 answer
224 views
Hi there,

I am using Q3 2008 version; I want to collapse/expand the Grid Rows (in GroupingByExpression).
I reffered to the http://www.telerik.com/community/forums/aspnet/grid/expand-collapse-all-groups-on-client.aspx, but I think this methodes used in this API are not supported by my version.
I also tried to use the tableView._getGroupExpandButton(tableView._getRowByIndexOrItemIndexHierarchical(0)) but it always return null.
I found the expand button for one of the row "tableView.get_element().all[7].all[1].all[0]" but I am unable to locate this inside dataitem.

Any quick response will be highly appriciated.

Thanks
Sajid

Schlurk
Top achievements
Rank 2
 answered on 01 Sep 2009
1 answer
55 views
For some reason the ajax loading panel is just not working on with my radgrid.  When I try to page or edit or anything it does a normal page refresh.  I am assuming I missed a step somewhere.  I setup my web.config per the asp.net ajax instructions and here is my code.  Any ideas?

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="xxx.aspx.vb" Inherits="xxx" 
    Title="xxx" MasterPageFile="~/main.master" %> 
 
<asp:Content ID="Content1" ContentPlaceHolderID="CPHMain" runat="Server"> 
    <span style="font-size: 2em; color: white;">xxx</span> 
    <br /> 
    <asp:Panel ID="pnlMain" runat="server"> 
        <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True" 
            DataSourceID="SqlDataSourceGlobalVars" GridLines="None" AllowAutomaticDeletes="True" 
            AllowAutomaticInserts="True" AllowAutomaticUpdates="True" AllowPaging="True" 
            AllowSorting="True" PageSize="20" ShowFooter="True" Skin="WebBlue" ShowStatusBar="True"> 
            <MasterTableView AutoGenerateColumns="False" DataKeyNames="id" DataSourceID="SqlDataSourceGlobalVars" 
                AllowSorting="False" ShowFooter="False" CommandItemDisplay="TopAndBottom"> 
                <RowIndicatorColumn> 
                    <HeaderStyle Width="20px" /> 
                </RowIndicatorColumn> 
                <ExpandCollapseColumn> 
                    <HeaderStyle Width="20px" /> 
                </ExpandCollapseColumn> 
                <Columns> 
                    <telerik:GridBoundColumn DataField="id" DataType="System.Int32" HeaderText="id" ReadOnly="True" 
                        SortExpression="id" UniqueName="id" Visible="False"> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="config_param" HeaderText="Parameter" SortExpression="config_param" 
                        UniqueName="config_param"> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="config_data" HeaderText="Value" SortExpression="config_data" 
                        UniqueName="config_data"> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="config_desc" HeaderText="Description" SortExpression="config_desc" 
                        UniqueName="config_desc"> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="datemod" DataType="System.DateTime" HeaderText="Last Modified" 
                        ReadOnly="True" SortExpression="datemod" UniqueName="datemod"> 
                    </telerik:GridBoundColumn> 
                </Columns> 
            </MasterTableView> 
        </telerik:RadGrid> 
        <asp:SqlDataSource ID="SqlDataSourceGlobalVars" runat="server" ConnectionString="<%$ ConnectionStrings:PrimaryConnectionString %>" 
            SelectCommand="SELECT [id], [config_param], [config_data], [datemod], [config_desc] FROM [site_config]" 
            UpdateCommand="UPDATE site_config SET config_desc = @config_desc , datemod = GETDATE(), config_data = @config_data, config_param = @config_param WHERE (id = @id)" 
            DeleteCommand="DELETE FROM site_config WHERE (id = @id)" InsertCommand="INSERT INTO site_config(config_desc, datemod, config_data, config_param) VALUES (@config_desc, GETDATE(), @config_data, @config_param)"> 
            <DeleteParameters> 
                <asp:Parameter Name="id" /> 
            </DeleteParameters> 
            <UpdateParameters> 
                <asp:Parameter Name="config_desc" /> 
                <asp:Parameter Name="config_data" /> 
                <asp:Parameter Name="config_param" /> 
                <asp:Parameter Name="id" /> 
            </UpdateParameters> 
            <InsertParameters> 
                <asp:Parameter Name="config_desc" /> 
                <asp:Parameter Name="config_data" /> 
                <asp:Parameter Name="config_param" /> 
            </InsertParameters> 
        </asp:SqlDataSource> 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1"> 
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="RadGrid1"> 
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" MinDisplayTime="1000" > 
        <asp:Image ID="imageloading" runat="server" ImageUrl="~/images/loading.gif" /> 
        </telerik:RadAjaxLoadingPanel> 
    </asp:Panel> 
</asp:Content> 
 

Pavlina
Telerik team
 answered on 01 Sep 2009
1 answer
146 views
I have a RadPanelBar like below,

<Telerik:RadPanelBar 
<Items> 
   <Telerik:RadPanelItem 
     <Items> 
      <Telerik:RadPanelItem 
    <ItemTemplate> 
      <asp:Panel> 
      </asp:Panel> 
      <Telerik:RadTreeView    .. 


I am loading User controls (dynamically) in the asp:Panel which is nested inside RadPanelItems.. under each asp:Panel I have telerik tree..
Right now I am generating (adding) same user control to five panel items..
Note: For now I have Panel items hardcoded.

1.How do I find the controls inside the user controls? is there any easy and dynamic way??
Venkat Ganesh
Top achievements
Rank 1
 answered on 01 Sep 2009
0 answers
172 views
  Below is the markup for an appointment scheduling interface. There is an DropDownList to select the facility which is populated by an SqlDataSource. Each facility has any number of resources.
  On first run all looks like it is working properly, accept the appointments template is not being used. Instead, just a rounded gray box appears in its time slot. When looking at the element in FireBug, there is nothing inside the <div class="rsAptContent"></div> tags. So, I removed the <AppointmentTemplate>, and it works. The subject is displayed. but i cannot figure how my ascx control is broken or breaking the scheduler. The code-behind this control is currently empty.

[BEGIN ScheduledAppointment.ascx]
<%@ Control Language="C#"
            AutoEventWireup="true"
            CodeBehind="ScheduledAppointment.ascx.cs"
            Inherits="org.WhoCo.MIS.Applications.Scheduling.ScheduledAppointment" %>
<asp:Panel runat="server" CssClass="misAppointment">
    <asp:Panel runat="server">

    </asp:Panel>
</asp:Panel>
[END] (Its just a place holder for now...)

  Also, when DblClicking on an open slot or on an appointment the LoadingPanel is displayed and then goes away, but no advanced edit/insert form is displayed. When selecting a different facility from the DropDownList, the same LoadingPanel is displayed, but the change in facility has no effect. The schedule and resources from the last facility in the list is always displayed.
  Lastly, changing the date using the DatePicker provided by the scheduler has no effect. Well, it has the same effect as the DropDownList and the DatePicker, but the date does not change.
  Below is the complete code from the page minus the <%@ %><html><head><body><form> stuff. Below that is the complete code-behind for the page. The connection strings are handled in the code-behind.

[BEGIN Scheduling.aspx]
    <%-- Telerik --%>
    <telerik:RadScriptManager ID="ScriptManager" runat="server"
                              EnableScriptGlobalization="true"
                              EnableScriptLocalization="true"
                              EnablePartialRendering="true">
        <Scripts>
            <asp:ScriptReference Assembly="org.WhoCo.MIS.Site" Name="org.WhoCo.MIS.Localization.Strings.js" />
            <asp:ScriptReference Assembly="org.WhoCo.MIS.Site" Name="org.WhoCo.MIS.Applications.Scheduling.Localization.Strings.js" />
            <asp:ScriptReference Assembly="org.WhoCo.MIS.Site" Name="org.WhoCo.MIS.Applications.Scheduling.ClientScript.js" />
        </Scripts>
    </telerik:RadScriptManager>
    
    <telerik:RadAjaxManager ID="AjaxManager" runat="server"
                            EnableEmbeddedScripts="true"
                            EnableAJAX="true">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="UpdatedControlsGroup">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ddlFacilities" />
                    <telerik:AjaxUpdatedControl ControlID="Scheduler" LoadingPanelID="lpDefault" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    
    <telerik:RadAjaxLoadingPanel ID="lpDefault" runat="server">
        <div class="updateOverlay">
            <div class="updateContent">
                <asp:Image runat="server"
                           ImageAlign="Middle"
                           ImageURL="~/Images/Loading.gif" />
            </div>
        </div>
    </telerik:RadAjaxLoadingPanel>
    <%-- /Telerik --%>

        <%-- Selections Panel --%>
        <asp:Panel runat="server" ID="UpdatedControlsGroup"
                   BackColor="Transparent"
                   BorderStyle="None">
            <%-- Facilities List --%>
            <asp:DropDownList ID="ddlFacilities" runat="server"
                              DataSourceID="dsFacilities"
                              AutoPostBack="true"
                              DataTextField="name"
                              DataValueField="id">
            </asp:DropDownList>
            
            <%-- Scheduler --%>
            <telerik:RadScheduler ID="Scheduler" runat="server"
                                  Width="100%" Height="100%"
                                  DataSourceID="dsSchedule"
                                  DataKeyField="id"
                                  DataStartField="start"
                                  DataEndField="end"
                                  DataSubjectField="id"
                                  ShowAllDayRow="false"
                                  ShowViewTabs="true"
                                  WeekView-ReadOnly="true"
                                  MonthView-ReadOnly="true"
                                  TimelineView-ReadOnly="true"
                                  StartEditingInAdvancedForm="true"
                                  StartInsertingInAdvancedForm="true"
                                  GroupBy="Schedulable"
                                  GroupingDirection="Horizontal"
                                  SelectedView="ResourceView"
                                  OnClientTimeSlotContextMenu="WhoCo.MIS.Scheduling.Schedule.OnContextMenu"
                                  OnClientAppointmentCreated="WhoCo.MIS.Scheduling.Appointment.OnCreated"
                                  OnClientAppointmentDoubleClick="WhoCo.MIS.Scheduling.Appointment.OnDoubleClick"
                                  OnFormCreated="Scheduler_FormCreated"
                                  OnAppointmentCreated="Scheduler_AppointmentCreated"
                                  OnAppointmentDataBound="Scheduler_AppointmentDataBound">
                <ResourceTypes>
                    <telerik:ResourceType Name="Schedulable" DataSourceID="dsResources" ForeignKeyField="rid" KeyField="id" TextField="name" AllowMultipleValues="false" />
                </ResourceTypes>

                <AdvancedForm Modal="true" />

                <AppointmentTemplate>
                    <mis:ScheduledAppointment ID="Appointment" runat="server" />
                </AppointmentTemplate>

                <AdvancedInsertTemplate>
                    <mis:AppointmentForm ID="InsertForm" runat="server" Mode="Insert" />
                </AdvancedInsertTemplate>

                <AdvancedEditTemplate>
                    <mis:AppointmentForm ID="EditForm" runat="server" Mode="Edit" />
                </AdvancedEditTemplate>
            </telerik:RadScheduler>
        </asp:Panel>

        <%-- Data Sources --%>
        <%-- Facilities DataSource --%>
        <asp:SqlDataSource ID="dsFacilities" runat="server"
                           SelectCommandType="Text"
                           SelectCommand="SELECT id, name FROM facilities">
        </asp:SqlDataSource>

        <%-- Resources DataSource --%>
        <asp:SqlDataSource ID="dsResources" runat="server"
                           SelectCommandType="Text"
                           SelectCommand="SELECT id, status, sort, name, type FROM resources WHERE facility = @p_facility ORDER BY sort ASC">
            <SelectParameters>
                <asp:ControlParameter ControlID="ddlFacilities" Name="p_facility" Type="UInt32" />
            </SelectParameters>
        </asp:SqlDataSource>
        
        <%-- Scheduler DataSource --%>
        <asp:SqlDataSource ID="dsSchedule" runat="server"
                           SelectCommandType="Text"
                           SelectCommand="SELECT * FROM schedule;">
        </asp:SqlDataSource>
[END]

[BEGIN Scheduling.aspx.cs]

using System;
using System.Threading;
using System.Globalization;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
// ...
using Telerik.Web.UI;

namespace org.WhoCo.MIS.Applications.Scheduling {
    public partial class Main : System.Web.UI.Page {
        #region [ Page Events ]

        protected void Page_Load( object sender, EventArgs e ) {

        }

        protected void Page_Init( object sender, EventArgs e ) {
            if( !IsPostBack ) {
            // Initialize Components
                // Datasources
                string dbcc = MIS.Database.Client.Prefix + MIS.Session.User.Client.Code;
            //    dsFacilities.SelectCommand = "SELECT id, name FROM " + dbcc + ".facilities;";

                dsFacilities.ProviderName = ConfigurationManager.ConnectionStrings["DB.MIS.WhoCo.lan"].ProviderName;
                dsFacilities.ConnectionString = ConfigurationManager.ConnectionStrings["DB.MIS.WhoCo.lan"].ConnectionString.Replace( "initial catalog=_mis", "initial catalog=" + dbcc );
                dsResources.ProviderName = ConfigurationManager.ConnectionStrings["DB.MIS.WhoCo.lan"].ProviderName;
                dsResources.ConnectionString = ConfigurationManager.ConnectionStrings["DB.MIS.WhoCo.lan"].ConnectionString.Replace( "initial catalog=_mis", "initial catalog=" + dbcc );
                dsSchedule.ProviderName = ConfigurationManager.ConnectionStrings["DB.MIS.WhoCo.lan"].ProviderName;
                dsSchedule.ConnectionString = ConfigurationManager.ConnectionStrings["DB.MIS.WhoCo.lan"].ConnectionString.Replace( "initial catalog=_mis", "initial catalog=" + dbcc );
             //    Logger.Application.DebugFormat( "dsSchedule.ConnectionString == {0}", dsSchedule.ConnectionString );

                Scheduler.Culture = Thread.CurrentThread.CurrentUICulture;
            //    Scheduler.SelectedDate = DateTime.Now;
                Scheduler.SelectedDate = DateTime.Parse( "2009-08-12 17:00:00" );
                Scheduler.DayStartTime = new TimeSpan( 8, 0, 0 );
                Scheduler.DayEndTime = new TimeSpan( 20, 0, 0 );
            //    Scheduler.TimeZoneOffset = new TimeSpan( 7, 0, 0 );
            }
        }

        #endregion Page Events

        #region [ Component Events ]

        protected void OnRefresh( object sender, EventArgs args ) {
            Scheduler.Rebind();
        }

        protected void Scheduler_FormCreated(object sender, SchedulerFormCreatedEventArgs e) {
            RadScheduler scheduler = (RadScheduler)sender;

            switch( e.Container.Mode ) {
                case SchedulerFormMode.AdvancedInsert:
                    break;

                case SchedulerFormMode.AdvancedEdit:
                    break;

                default:
                    // LOG!!!
                    break;
            }
        }

        protected void Scheduler_AppointmentDataBound( object sender, Telerik.Web.UI.SchedulerEventArgs e ) {
            Telerik.Web.UI.Appointment a = e.Appointment;
        }

        protected void Scheduler_AppointmentCreated( object sender, AppointmentCreatedEventArgs e ) {
            Telerik.Web.UI.Appointment a = e.Appointment;
            ScheduledAppointment sa = (ScheduledAppointment)e.Container.FindControl( "Appointment" );
        }

        #endregion Component Events
    }
}
[END]

Thanks in advance!

Nick Yearwood
Nick
Top achievements
Rank 1
 asked on 01 Sep 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?