Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
44 views
I have a RadScheduler which will display the appointments.And on right clicking this appointment will show the details in a RadWindow.In order to show the radwindow i have used the OnFormCreating event where i check whether it is AdvancedEdit or Edit.If it is Edit or AdvancedEdit the details are populated in RadWindow.The problem is that after any Appointment is shown in Radwindow clicking on Day or Week or Month will display the RadWindow with the earlier selected Appointmnet's details.So what to do?

Thanks in Advance
Deepak
deepak
Top achievements
Rank 2
 answered on 15 Jun 2011
1 answer
85 views
Hi,
I am using telerik RAD Editor 5.6.0.0, when I am trying to check or uncheck auto update option in reusable content list no matter what, it is always getting reflected in the RAD Editor box, means auto update is not working. Can you please help me.

Regards
Islam
Stanimir
Telerik team
 answered on 15 Jun 2011
6 answers
302 views
HI I have problem with ajax request. On my developer server from visual studio 2008 working all ajax correctly. After upload my procjet to online server ajax not working correctly. Some ajax request is not ajax and page is reloaded example: Sorting in grid or LinkButton in Grid CommandItemTemplate. I use AjaxManager.  I add my web.config code. Thanks you for  helping.
<?xml version="1.0"?> 
<!--  
    Note: As an alternative to hand editing this file you can use the  gfdgfd fdg dgfd  dfds df sfds f 
    web admin tool to configure settings for your application. Use were rw r fgfdg sadsad dsfdsf  retr re trt re t 
    the Website->Asp.Net Configuration option in Visual Studio. d dsf dsfsf ds f jkfhjjkfds jhjk dsfsfds 
    A full list of settings and comments can be found in  sad sad reewrew  rerer dsf ds fd gdfg dsfdsfd dsfds 
    machine.config.comments usually located in  dsfdfds fdgf f  r rew 4r kokgofdgd f ds fdsds f ds 
    \Windows\Microsoft.Net\Framework\v2.x\Config  
--> 
<configuration> 
    <configSections> 
        <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" requirePermission="false"/> 
        <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
            <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
                <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> 
                <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
                    <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/> 
                    <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> 
                    <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> 
                    <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> 
                </sectionGroup> 
            </sectionGroup> 
        </sectionGroup> 
        <sectionGroup name="telerik.web.ui"
        </sectionGroup> 
    </configSections> 
    <telerik.web.ui> 
    </telerik.web.ui> 
    <log4net> 
        <appender name="InfoAppender" type="log4net.Appender.FileAppender"
            <file value="Logs\\Log4net.txt"/> 
            <appendToFile value="true"/> 
            <layout type="log4net.Layout.PatternLayout"
                <conversionPattern value="%d [%t] %-5p %c [%x] - %m%n"/> 
            </layout> 
        </appender> 
        <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"
            <file value="Logs\\log"/> 
            <appendToFile value="true"/> 
            <rollingStyle value="Date"/> 
            <datePattern value="yyyyMMdd"/> 
            <layout type="log4net.Layout.PatternLayout"
                <conversionPattern value="[%date] %-5level - %message%newline"/> 
            </layout> 
        </appender> 
        <logger name="_Default"
            <level value="NONE"/> 
            <appender-ref ref="RollingLogFileAppender"/> 
        </logger> 
    </log4net> 
    <appSettings> 
        <add key="ApplicationName" value="BezKauce"/> 
        <add key="log4net.Internal.Debug" value="true"/> 
        <add key="log4net.Internal.Quiet=" value="false="/> 
        <add key="Telerik.Skin" value="Sunset"/> 
    </appSettings> 
    <connectionStrings> 
        <add name="sql_conn" .....  /> 
    </connectionStrings> 
    <location path="App_Themes"
        <system.web> 
            <authorization> 
                <allow users="*"/> 
            </authorization> 
        </system.web> 
    </location> 
    <location path="Default.aspx"
        <system.web> 
            <authorization> 
                <allow users="*"/> 
            </authorization> 
        </system.web> 
    </location> 
    <system.web> 
        <httpRuntime maxRequestLength="102400" executionTimeout="3600"/> 
        <customErrors defaultRedirect="Error.aspx" mode="Off"></customErrors> 
        <!--AUTHENTIFIKACE--> 
        <authentication mode="Forms"
            <forms name=".ASPXAUTH" protection="All" timeout="1200" path="/" requireSSL="false" slidingExpiration="true" cookieless="UseCookies" loginUrl="Default.aspx"/> 
        </authentication> 
        <membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="15"
            <providers> 
                <add name="SqlProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="sql_conn" applicationName="BezKauce" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="true" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" passwordAttemptWindow="10"/> 
            </providers> 
        </membership> 
        <roleManager defaultProvider="SqlProvider" enabled="true" cacheRolesInCookie="true" cookieName=".ASPROLES" cookieTimeout="30" cookiePath="/" cookieRequireSSL="true" cookieSlidingExpiration="true" cookieProtection="All"
            <providers> 
                <add name="SqlProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="sql_conn" applicationName="BezKauce"/> 
            </providers> 
        </roleManager> 
        <!--AUTHENTIFIKACE--> 
        <!--  
            Set compilation debug="true" to insert debugging  
            symbols into the compiled page. Because this  
            affects performance, set this value to true only  
            during development. 
        --> 
        <compilation debug="true"
            <assemblies> 
                <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
                <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
                <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
                <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
                <add assembly="System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
                <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> 
                <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
                <add assembly="System.Drawing.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> 
                <!--<add assembly="CrystalDecisions.CrystalReports.Engine, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/> 
                <add assembly="CrystalDecisions.ReportSource, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/> 
                <add assembly="CrystalDecisions.Shared, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/> 
                <add assembly="CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/> 
                <add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/> 
                <add assembly="CrystalDecisions.Enterprise.Framework, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/> 
                <add assembly="CrystalDecisions.Enterprise.InfoStore, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/> 
                <add assembly="Microsoft.Office.Interop.Excel, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C"/>--> 
                <add assembly="System.Web.Extensions.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></assemblies> 
        </compilation> 
        <!-- 
    <add assembly="Microsoft.Office.Interop.Outlook, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C"/> 
    <add assembly="Microsoft.Office.Interop.Outlook, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C"/> 
            The <authentication> section enables configuration  
            of the security authentication mode used by  
            ASP.NET to identify an incoming user.  
        --> 
        <sessionState mode="InProc" cookieless="false" timeout="30"/> 
        <browserCaps> 
            <case>RequiresControlStateInSession=true</case
        </browserCaps> 
        <pages> 
            <controls> 
                <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
                <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
                <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI, Version=2010.1.316.35"/> 
                <add tagPrefix="mycontrol" namespace="MyControls"/> 
            </controls> 
        </pages> 
        <httpHandlers> 
            <remove verb="*" path="*.asmx"/> 
            <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
            <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
            <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/> 
            <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false"/> 
            <add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false"/> 
            <add path="ChartImage.axd" verb="*" type="Telerik.Web.UI.ChartHttpHandler, Telerik.Web.UI, Version=2010.1.309.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" validate="false"/> 
        </httpHandlers> 
        <httpModules> 
            <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
        </httpModules> 
    </system.web> 
    <system.codedom> 
        <compilers> 
            <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
                <providerOption name="CompilerVersion" value="v3.5"/> 
                <providerOption name="WarnAsError" value="false"/> 
            </compiler> 
            <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
                <providerOption name="CompilerVersion" value="v3.5"/> 
                <providerOption name="OptionInfer" value="true"/> 
                <providerOption name="WarnAsError" value="false"/> 
            </compiler> 
        </compilers> 
    </system.codedom> 
    <!--  
        The system.webServer section is required for running ASP.NET AJAX under Internet 
        Information Services 7.0.  It is not necessary for previous version of IIS. 
    --> 
    <system.webServer> 
        <validation validateIntegratedModeConfiguration="false"/> 
        <modules> 
            <remove name="ScriptModule"/> 
            <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
            <add name="RadUploadModule" preCondition="integratedMode" type="Telerik.Web.UI.RadUploadHttpModule"/> 
        </modules> 
        <handlers> 
            <remove name="WebServiceHandlerFactory-Integrated"/> 
            <remove name="ScriptHandlerFactory"/> 
            <remove name="ScriptHandlerFactoryAppServices"/> 
            <remove name="ScriptResource"/> 
            <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
            <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
            <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
            <add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource"/> 
            <add name="Telerik_RadUploadProgressHandler_ashx" verb="*" preCondition="integratedMode" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler"/> 
        </handlers> 
    </system.webServer> 
</configuration> 

Travis
Top achievements
Rank 1
 answered on 15 Jun 2011
2 answers
62 views
I custom set my scheduler to display 4 weeks (day by day) from current date. e.g. today is June 14 2011, when i open the scheduler page the scheduler automatically shows 4 weeks from June 14 2011, ends on July 13 2011.

I setup an appointment to start from July 12 2011 till July 15 2011, which is cross 2 period. It shows fine when  June-July period is shown. However if I change to next period which starts from July 14 2011, the date July 14 and July 15 shows no appointment......

Is there any settings to quickly fix this issue?

thanks in advance
sf
Top achievements
Rank 1
 answered on 15 Jun 2011
6 answers
206 views
Hi,

I need help regarding my scenario. I have a link button inside the Radgrid that opens a RadWindow. At first I have problem regarding the passing of value (primarykey) of the selected row to the new page inside the RadWindow but I manage to fix it. But now my Radwindow is immediately closing after poping out.
Here's my code:

HTML
<telerik:GridTemplateColumn>
                    <ItemTemplate>
                        <asp:LinkButton ID="lnkEdit" runat="server" CssClass="styleMain" OnClientClick='<%#Eval("BillingID", "return editbilling({0})") %>'>Edit</asp:LinkButton>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>

<telerik:RadWindowManager ID="Singleton" runat="server"
        Behavior="Close, Reload" Height="250px" InitialBehavior="None"
        KeepInScreenBounds="true" Modal="true" Skin="Outlook" VisibleStatusbar="False"
        Width="450px">
        <Windows>
            <telerik:RadWindow ID="frm2" runat="server" InitialBehavior="None"
                OnClientClose="closeRadwindow" Title="Edit Billing">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>

JAVASCRIPT

function editbilling(BillingID) {
            var oWnd
            oWnd = radopen("addbilling.aspx?je=" + BillingID, "frm2");
            //oWnd.center();
            //response.redirect in javascript
            //window.open("addbilling.aspx?je=" + BillingID, "frm2");
            
        }
Samantha
Top achievements
Rank 1
 answered on 15 Jun 2011
1 answer
173 views
Hi All,

 I really need help with this one, I am trying to use hierarchial radgrid, but my ondetailtabledatabind event is not firing. Below is my code

<table>
                                                                <tr>
                                                                    <td>
                                                                        <telerik:RadGrid ID="RadGrid_versions" AllowSorting="True" PageSize="100" AllowPaging="True"
                                                                            runat="server" GridLines="None" Width="900px" Visible="true" ShowHeader="true" ondetailtabledatabind="RadGrid_versions_DetailTableDataBind">
                                                                            <SelectedItemStyle BackColor="Fuchsia" BorderColor="Purple" BorderStyle="Dashed" 
                                                                                BorderWidth="1px" />
                                                                            <MasterTableView Width="100%" Summary="RadGrid table" ShowHeader="false" />
                                                                            <MasterTableView RetrieveAllDataFields="true" AutoGenerateColumns="false" DataKeyNames="UpdateNumber1"
                                                                                AllowMultiColumnSorting="true">
                                                                                <DetailTables>
                                                                                    <telerik:GridTableView DataKeyNames="UpdateNumber" Name="RadGrid_PartsVersions" Width="100%">
                                                                                        <Columns>
                                                                                            <telerik:GridBoundColumn DataField="UpdateNumber" HeaderText="UpdateNumber">
                                                                                            </telerik:GridBoundColumn>
                                                                                              
                                                                                            <telerik:GridBoundColumn DataField="UnitOfIssue" HeaderText="UI">
                                                                                            </telerik:GridBoundColumn>
                                                                                              
                                                                                        </Columns>
                                                                                    </telerik:GridTableView>
                                                                                </DetailTables>
                                                                                <Columns>
                                                                                    <telerik:GridTemplateColumn ItemStyle-BackColor="#E6E6E6">
                                                                                        <ItemTemplate>
                                                                                            <table>
                                                                                                <tr>
                                                                                                    <td>
                                                                                                        Update Date:
                                                                                                    </td>
                                                                                                    <td>
                                                                                                        <asp:Label ID="lblUpdateDate" runat="server" Text='<%#Bind("UpdateDate") %>'></asp:Label>
                                                                                                    </td>
                                                                                                    <td>
                                                                                                        Update Number:
                                                                                                    </td>
                                                                                                    <td>
                                                                                                        <asp:Label ID="lblUpdateNumber" runat="server" Text='<%#Bind("UpdateNumber") %>'></asp:Label>
                                                                                                    </td>
                                                                                                     
                                                                                                    <td>
                                                                                                        Severity:
                                                                                                    </td>
                                                                                                    <td>
                                                                                                        <asp:Label ID="Label1" runat="server" Text='<%#Bind("Severity") %>'></asp:Label>
                                                                                                    </td>
                                                                                                </tr>
                                                                                                  
                                                                                                <tr>
                                                                                                    <td align="left" colspan="30">
                                                                                                        <table cellpadding="0" cellspacing="0">
                                                                                                            <tr>
                                                                                                                <td>
                                                                                                                </td>
                                                                                                            </tr>
                                                                                                        </table>
                                                                                                    </td>
                                                                                                </tr>
                                                                                            </table>
                                                                                        </ItemTemplate>
                                                                                    </telerik:GridTemplateColumn>
                                                                                </Columns>
                                                                            </MasterTableView>
                                                                            <PagerStyle Mode="NextPrev" />
                                                                        </telerik:RadGrid>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                    </Columns>
                                </MasterTableView>
                            </telerik:RadGrid>

and my code behind code is like below

private void RadGrid_versions_Bind(List<CisHeader> HeaderList)
{
    RadGrid RadGrid_versions = (RadGrid)RadGrid_DetailsView.MasterTableView.Items[0].FindControl("RadGrid_versions");
    List<CISVersion> version = new List<CISVersion>();
    foreach (CisHeader Header in HeaderList)
    {
        foreach (CISVersion Version in Header.Version)
        {
            version.Add(Version);
        }
    }
    RadGrid_versions.DataSource = version;
}
protected void RadGrid_versions_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e)
{
    string x = "test";
}

now my debugger is never stopping at RadGrid_versions_DetailTableDataBind.

I really need help with this.

Any help will be highly appreciated.
Anjali
Top achievements
Rank 1
 answered on 14 Jun 2011
2 answers
271 views
Hi,
obnoxious question....
I have a RadGrid bound to a SQL data source. 
If I use GridBoundColumn to bind datas everything works fine, but if I use GridTemplateColumn with (i.e.) asp:label o asp:literal it does not boud !

See attached code and attached image of the result.

<telerik:RadGrid ID="RadG_Operators" runat="server" AutoGenerateColumns="False" CssClass="RadGridCompact"
                       DataSourceID="SDS_Operators" GridLines="None" Width="100%" style="outline:none;border:0px;">
                    
                       <clientsettings>
                           <selecting allowrowselect="true" />
                       </clientsettings>
                        
                       <HeaderStyle HorizontalAlign="Center" />
                        
                       <MasterTableView cssclass="RadGridCompact" datakeynames="IdOperator" DataSourceID="SDS_Operators" style="outline:none;border:0px;">
                        
                           <Columns>
                            
                           <telerik:GridTemplateColumn DataField="OpName" HeaderText='<%$ Resources:WebRes, Operator_Text %>'>
                               <ItemTemplate>
                                    
                                   <asp:Label ID="Label1" runat="server" Text='<%# Eval("OpName") %>)'></asp:Label>                                      
                                    
                               </ItemTemplate>
 
                           </telerik:GridTemplateColumn>
                            
                           <telerik:GridBoundColumn DataField="OpName" HeaderText='<%$ Resources:WebRes, Operator_Text %>'>
                            
                           </telerik:GridBoundColumn>
                            
                           <telerik:GridBoundColumn DataField="OpRoleName" HeaderText='<%$ Resources:WebRes, Role_Text %>'
                               SortExpression="OpRoleName" UniqueName="OpRoleName">
                                
                               <HeaderStyle HorizontalAlign="Center" />
                           </telerik:GridBoundColumn>
                            
                           <telerik:GridTemplateColumn>
                               <ItemTemplate>
                               <asp:Label ID="Label2" runat="server" Text='<%# Eval("OpName") %>)'></asp:Label>
                               </ItemTemplate>
                                
                                
                           </telerik:GridTemplateColumn>
                            
                           </Columns>
                        
                       </MasterTableView>
                   </telerik:RadGrid>
 
                   <asp:SqlDataSource ID="SDS_Operators" runat="server"
                           ConnectionString="<%$ ConnectionStrings:DBConn %>"
                           SelectCommand="SELECT Operators.IdOperator, Operators.OpSurname + ' ' + Operators.OpName As OpName, OperatorsRoles.OpRoleName
                               FROM Operators INNER JOIN
                                   OperatorsRoles ON Operators.IdOpRole = OperatorsRoles.IdOpRole
                               WHERE (Operators.IdCompany = @IdCompany)">
                           <SelectParameters>
                               <asp:QueryStringParameter Name="IdCompany" QueryStringField="IdCompany" />
                           </SelectParameters>
                    
                   </asp:SqlDataSource>


What am I doing Wrong ?

Thanks Lorenzo
Lorenzo
Top achievements
Rank 1
 answered on 14 Jun 2011
1 answer
124 views
I have a page that has two RadComboBoxes and a button inside an UpdatePanel.  The first combo box is populated server-side, the second is populated client-side, when a selection is made on the first.

That's not my problem.  It's working fine.

My problem is that the button does a partial postback.  I'm calling .trackChanges() and .commitChanges on the second combo box as I populate it, so the values in the dropdowns are preserved across the partial postback.  But when I change the selected value in the first combo box, I get errors when I try to manipulate the second combo box.

Note - I don't get errors initially, I only get errors after the partial postback,

Currently, I'm getting the error in .disable(), which I call prior to making the ajax call that gets the data.  But if I don't call disable, I get the same error in .clearItems(), etc.  The second box seems to be confused about how many items are actually in the list. 

The error is: Microsoft JScript runtime error: 'this.get_element()' is null or not an object

I'm calling ddLevel2.disable(), where ddLevel2 is my second RadComboBox, as returned by $find().  The javascript for RadComboBox.disable() is:

disable:function()
{
    var e=this.get_tableElement();
    if (e!=null)
    {
        e.className="rcbDisabled";
    }
    this.set_enabled(false);
    this.get_inputDomElement().disabled="disabled";
    this.disableEvents();
    var d=this.get_items().get_count();
    for (var c=0; c<d; c++)
    {
        this._children.getItem(c).disable();
    }
}

Prior to the partial postback, the second dropdown had five items.  After the partial postback there are five items in the list.  And in this code, 'd' has the value 5.

disable:function()
{
    this.set_enabled(false);
    this.get_element().className="rcbDisabled";
}

And here, this.get_element() is not defined.

I've created a simple example page that demonstrates the problem.  Load the page, select an item from the first combo box.  Wait a bit, then select an item from the second combo box.  Try this a few times.

Then click on "Go", to generate the partial postback.

Try selecting a different item from the second combo box.  You'll see that it contains the same items as prior to the postback.

Then try selecting a different item from the first combo box.  That's when I get the error.

I'm using version number 2010.1.519.35 of the Telerik.Web.UI.dll.

My example page:

<%@ Page Language="C#" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
 
<script runat="server">
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            populateLevel1();
            connectEvents();
        }
    }
 
    protected void Page_PreRender(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            initJavascript();
        }
    }
 
    protected void btnRun_Click(object sender, EventArgs e)
    {
    }
 
    private void populateLevel1()
    {
        ddLevel1.Items.Add(new RadComboBoxItem("", ""));
        for (var i = 1; i <= 4; i++)
        {
            string name = String.Format("Item {0}", i);
            string value = String.Format("{0}", i);
            ddLevel1.Items.Add(new RadComboBoxItem(name, value));
        }
 
        ddLevel1.SelectedIndex = 0;
    }
 
    protected virtual void connectEvents()
    {
        ddLevel1.OnClientSelectedIndexChanged = "ddLevel1SelectedIndexChanged";
    }
 
    protected virtual void initJavascript()
    {
        string script = @"
Sys.UI.DomEvent.addHandler(window, 'load',
    function()
    {{
        initJavascript('{0}');
    }}
);";
 
        script = String.Format(script, ddLevel2.ClientID);
 
        ClientScript.RegisterStartupScript(this.GetType(), this.ClientID + "_initJavascript", script, true);
    }  
</script>
 
 
<head runat="server">
 
    <script type="text/javascript">
        var ddLevel2 = null;
 
        function initJavascript(ddLevel2ClientID)
        {
            var foo = $find(ddLevel2ClientID);
 
            if (!foo)
            {
                window.setTimeout(function() { initJavascript(ddLevel2ClientID); }, 100);
                return;
            }
 
            ddLevel2 = $find(ddLevel2ClientID);
        }
 
        function ddLevel1SelectedIndexChanged(sender, eventArgs)
        {
            var item = eventArgs.get_item();
            var value = item.get_value();
 
            ddLevel2.disable();
            window.setTimeout(function() { getLevel2(value, ddLevel2); }, 1000);
        }
 
        function getLevel2(value, dd)
        {
            dd.trackChanges();
 
            dd.clearSelection();
            dd.clearItems();
 
            if (value)
            {
                var items = dd.get_items();
 
                var item = new Telerik.Web.UI.RadComboBoxItem();
                item.set_text("");
                item.set_value("");
                items.add(item);
                item.select();
 
                items.add(item);
                for (var i = 1; i <= 4; i++)
                {
                    item = new Telerik.Web.UI.RadComboBoxItem();
                    item.set_text("Item " + value + "." + i);
                    item.set_value(value + "." + i);
 
                    items.add(item);
                }
 
                dd.commitChanges();
            }
 
            dd.enable();
        }
 
    </script>
 
    <title>Testing RadComboBoxes</title>
 
</head>
 
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="scriptManager" runat="server"></asp:ScriptManager>
     
    <asp:UpdatePanel ID="updatePanel" runat="server">
        <ContentTemplate>
            <asp:Label ID="lblLevel1" runat="server">Level One:</asp:Label>
            <telerik:RadComboBox ID="ddLevel1" runat="server"></telerik:RadComboBox>
            <br />
            <asp:Label ID="lblLevel2" runat="server">Level Two:</asp:Label>
            <telerik:RadComboBox ID="ddLevel2" runat="server"></telerik:RadComboBox>
            <br />
            <asp:Button ID="btnRun" runat="server"
                 OnClick="btnRun_Click" Text="Go!" />
        </ContentTemplate>
    </asp:UpdatePanel>
 
    </form>
</body>
</html>
Jeff
Top achievements
Rank 1
 answered on 14 Jun 2011
2 answers
104 views
Hi,

I am new to ajax and I am having difficulty using radAjaxPanel.
I am using the following HTML:

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
     <telerik:RadGrid ID="grdFormList" runat="server" CssClass="RadGrid" GridLines="None"
         AllowPaging="false" AllowSorting="false" AutoGenerateColumns="False"
         ShowStatusBar="true" Height="100%" Width="100%" OnNeedDataSource="grdFormList_NeedDataSource" OnDataBound="grdFormList_DataBound">
         <MasterTableView CommandItemDisplay="None" DataKeyNames="ID">
             <NoRecordsTemplate>
                 No forms to review
             </NoRecordsTemplate>
             <Columns>
                 <telerik:GridBoundColumn DataField="ID" HeaderText="ID" Visible="false">
                 </telerik:GridBoundColumn>
                 <telerik:GridBoundColumn DataField="Title" HeaderText="Incentive Plan Form" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
                 </telerik:GridBoundColumn>
                 <telerik:GridTemplateColumn DataField="View" HeaderText="View" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                     <ItemTemplate>
                         <telerik:radbutton id="btnViewItem" runat="server" text="" style="background:url(/_layouts/MirandaImages/msinfopath.png); width:20px; height:20px;">
                             <Image EnableImageButton="true"  />
                         </telerik:radbutton>
                     </ItemTemplate>
                 </telerik:GridTemplateColumn>
                 <telerik:GridBoundColumn DataField="LastReviewDate" HeaderText="Last Review" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                 </telerik:GridBoundColumn>
                 <telerik:GridTemplateColumn DataField="Review" HeaderText="Review This Item" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                     <ItemTemplate>
                         <asp:CheckBox id="cbReview" checked="false" runat="server" />
                     </ItemTemplate>
                 </telerik:GridTemplateColumn>
             </Columns>
             </MasterTableView>
     </telerik:RadGrid>
 </telerik:RadAjaxPanel>
 </div>
<div id="divFooterButtons" style="text-align:right; width:800px; padding-top:5px;">
     <telerik:RadButton ID="btnSubmit" runat="server" Text="Done" OnClick="btnSubmit_Click" />
</div>

If I put the "divFooterButtons" inside the ajax panel I get an error: PageRequestManagerPerserErrorException: the message received from the server could not be parsed.

I do not have any response.write() in my code behind.

What I want to achieve is to refresh only the grid when I click the button.

Any help would be appreciated.
Thank you

Alex
Alexandre
Top achievements
Rank 1
 answered on 14 Jun 2011
4 answers
182 views

I could use some help/advice with creating a drop down button that posts back to the server when the contextmenu item is clicked.  Here are two different approaches.

The first simple example does this, but it doesn't refresh nicely.  When I click the contextmenu item, the menu begins to close back up and simultaneously the postback starts.  So what the user sees is the menu half-way closed as the browser is busy working on the postback.  It just doesn't look polished.  I'd like for the page to be in some kind of stable looking state at the time the postback initiates. 

<telerik:RadButton EnableSplitButton="true" ID="SplitButton3" AutoPostBack="false"
        runat="server" Text="Leave" OnClientClicked="OnClientSplitButton3Clicked">
    </telerik:RadButton>
    <div style="display: none;">
        <telerik:RadContextMenu ID="RadContextMenu3" runat="server" EnableRoundedCorners="false"
            OnItemClick="RadContextMenu3_Click">
            <Items>
                <telerik:RadMenuItem Text="Leave by Land" Value="LAND">
                </telerik:RadMenuItem>
                <telerik:RadMenuItem Text="Leave by Sea" Value="SEA">
                </telerik:RadMenuItem>
            </Items>
        </telerik:RadContextMenu>
    </div>
  
  
   function OnClientSplitButton3Clicked(sender, args) {
  
            var contextMenu = $find("<%=RadContextMenu3.ClientID%>");
            var currentLocation = $telerik.getLocation(sender.get_element());
            contextMenu.showAt(currentLocation.x, currentLocation.y + 28);
        }

The second approach is a little more complex.  It produces the sort of user experience I'm trying to achieve, but it doesn't work due to the issue I posted in another thread titled "Single Click Split Button?".  In the SplitButton1_Click server-side code, the SplitButton1.CommandName is always blank - it appears as though the set_enabled(false) javascript command is clearing it out.


<
telerik:RadButton EnableSplitButton="true" ID="SplitButton1" AutoPostBack="false"
        runat="server" Text="Assign" OnClientClicked="OnClientSplitButton1Clicked" EnableEmbeddedSkins="false"
        OnClick="SplitButton1_Click">
    </telerik:RadButton>
    <div style="display: none;">
        <telerik:RadContextMenu ID="RadContextMenu1" runat="server"             OnClientItemClicked="OnClientContextMenu1Clicked">
            <Items>
                <telerik:RadMenuItem Text="Assign and Return to List">
                </telerik:RadMenuItem>
                <telerik:RadMenuItem Text="Assign and Continue">
                </telerik:RadMenuItem>
            </Items>
        </telerik:RadContextMenu>
    </div>
  
  
function OnClientContextMenu1Clicked(sender, args) {
  
            // 2
            var itemText = args.get_item().get_text();
            var splitButton = $find("<%=SplitButton1.ClientID%>");
            if (itemText == "Assign and Return to List") {
                splitButton.set_commandName("AssignReturn");
            }
            else if (itemText == "Assign and Continue") {
                splitButton.set_commandName("AssignContinue");
            }
  
            splitButton.set_text("Assigning...");
  
            //allow context menu to finish hiding before doing postback
            setTimeout('executeButtonClick()', 200);
        }
  
        function executeButtonClick() {
            // 3
            var splitButton = $find("<%=SplitButton1.ClientID%>");
            splitButton.click();
        }
  
        function OnClientSplitButton1Clicked(sender, args) {
  
            var contextMenu = $find("<%=RadContextMenu1.ClientID%>");
  
            var btnText = sender.get_text();
  
            if (btnText == "Assign") {
                //text is still in initial state, so display the context menu.
                // 1
                var currentLocation = $telerik.getLocation(sender.get_element());
                contextMenu.showAt(currentLocation.x, currentLocation.y + 28);
            }
            else {
                // context menu has been clicked, so do a postback
                // 4
                sender.set_autoPostBack(true);
                sender.set_enabled(false);
            }
        }
  
protected void SplitButton1_Click(object sender, EventArgs e)
    {
        lblMessage.Text = "Assign with this command: " + SplitButton1.CommandName + " " + DateTime.Now.ToLongTimeString();
    }
Mike
Top achievements
Rank 1
 answered on 14 Jun 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?