I'm trying to call some javascript which returns true/false depending if it passes a test. I want my page to post back when a button is clicked but it isn't posting back if I set the update control or if I return true/false in my javascript. here is sample of my code.
This is a user control which is part of page which has other user controls.
<
script type="text/javascript">
function ValidateWithRegEx()
{
var myRegxp =/^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))+(.pdf|.PDF|.doc|.DOC|.xls|.XLS|.jpeg|.JPEG|.gif|.GIF|.tiff|.TIFF|.jpg|.JPG|.fla|.FLA|.avi|.AVI|.mov|.MOV|.wma|.WMA|.wmv|.WMV|.docx|.DOCX|.xlsx|.XLSX|.vsd|.VSD|.txt|.TXT)/;
var fileUploaderValue = document.getElementById("ctl00_cphCenterPane_UxAttachments1_FIPSFileUploader").value;
if( myRegxp.test(fileUploaderValue) )
{
return true;
}
else
{
alert(
'File trying to upload is invalid');
return false;
}
}
</
script>
<
table runat="server" id="masterTable">
<tr>
<td style="width: 453px">
<asp:FileUpload ID="FIPSFileUploader" runat="server" Width="446px" /></td>
</tr>
<tr>
<td style="width: 453px">
<asp:Button ID="UploadFileButton" runat="server" Text="Upload File" OnClientClick="return ValidateWithRegEx();" OnClick="UploadFileButton_Click" />
<asp:Label ID="lblError" runat="server" ForeColor="Red" Width="422px"></asp:Label></td>
</tr>
</
table>
<
telerik:RadAjaxManagerProxy ID="AjaxManagerProxy" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="UploadFileButton">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="AttachmentsRadGrid" LoadingPanelID="UploadingPanel" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</
telerik:RadAjaxManagerProxy>
<br />
<
telerik:RadAjaxLoadingPanel ID="UploadingPanel" runat="server" Height="75px" Width="75px" InitialDelayTime="1">
<img alt="Loading..." src="../Images/animated_loading.gif" style="border-right: 0px;border-top: 0px; border-left: 0px; border-bottom:0px"/>
</
telerik:RadAjaxLoadingPanel>
<
telerik:RadGrid ID="AttachmentsRadGrid" runat="server" AutoGenerateColumns="False" GridLines="None" Skin="Forest">
<MasterTableView Caption="<b>Attachments</b>" CellSpacing="-1">
<Columns>
<telerik:GridBoundColumn DataField="InspectionAttachmentId" ReadOnly="True" UniqueName="InspectionAttachmentId" Visible="False">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="FileLocation" UniqueName="FileLocation" Visible="False">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="FileName" HeaderText="File Name" UniqueName="FileName">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Description" HeaderText="Description" UniqueName="Description">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="CreatedDate" HeaderText="Created Date" UniqueName="CreatedDate">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="ModifiedDate" HeaderText="Modified Date" UniqueName="ModifiedDate">
</telerik:GridBoundColumn>
<telerik:GridEditCommandColumn>
</telerik:GridEditCommandColumn>
<telerik:GridButtonColumn CommandArgument="Delete" CommandName="Delete" Text="Remove" UniqueName="column">
</telerik:GridButtonColumn>
</Columns>
<EditFormSettings>
<EditColumn UniqueName="EditCommandColumn1">
</EditColumn>
</EditFormSettings>
</MasterTableView>
</
telerik:RadGrid>


Are there known problems of a RadListBox with transfer turned on working when in a RadXMLHttpPanel? Outside of the panel the transfer (Telerik's example) works fine, but, when I place it in a working RadXMLHttpPanel, it looses it's transfer functionality?
Note: The RadXMLHttpPanel that I'm putting the listbox control in works fine and is updating my controls asynch. It's the listbox transfer functionality that is not working.
Any ideas? I really need the list transfer functionality, I could use a JQuery one, but prefer to stick to the Telerik control.
Below is code example with html and javascript. Thanks much in advance...chris
***** Javascript ********
function
SecurityRowClick(sender, eventArgs)
{
try
{
var userId = eventArgs.getDataKeyValue(userIdFieldName);
var xmlPanel = $find(userDetailsXMLPanelClientId);
xmlPanel
.set_value(userId);
}
catch (e)
{
alert
(e.message);
}
}
******** HTML ***********
<
telerik:RadXmlHttpPanel
ID="ui_UserDetailsXMLPanel"
runat="server"
OnServiceRequest="UserXmlPanelBind"
OnClientResponseEnded="UserDetailsBound">
<div id="UserDetails">
<!-- command icons start -->
<div style="padding-top: 10px;">
<!-- edit icon start -->
<div id="EditUserAccount_Cmd" style="clear: both; width: 735px;">
<div id="UserRemove" onclick="DeleteUser()" style="float: right;">delete</div>
<div style="float: left; width: 15px; float: right;"> </div>
<div id="UserEdit" onclick="EditUser()" style="float: right;">edit</div>
</div>
<!-- edit icon end -->
<!-- save / cancel icon start -->
<div id="SaveUserAccount_Cmd" style="clear: both; width: 730px;">
<div id="Stop" onclick="CancelUpdate()" style="float: right;">cancel</div>
<div style="float: left; width: 15px; float: right;"> </div>
<div id="Save" onclick="UpdateUser()" style="float: right;">update</div>
</div>
<!-- save / cancel icon end -->
</div>
<!-- command icons end -->
<!-- user info start -->
<div style="clear: both;">
<!-- user details start -->
<div style="float: left; width: 360px;">
<div class="section_header">
User Details
</div>
<!-- full name start -->
<div id="FullName">
<div class="form_title_data_container">
<div class="form_field_title">
Name
</div>
<div style="float: left;">
<span id="ui_Name_valueContainer">
<div id="ui_Name_value" runat="server"></div>
</span>
</div>
</div>
</div>
<!-- full end -->
<!-- name details start -->
<div id="ui_NameDetails" runat="server">
<!-- first name start -->
<div class="form_title_data_container" style="padding-bottom: 5px;">
<div class="form_field_title">
First Name
</div>
<div style="float: left;">
<div id="ui_FirstName_value" runat="server"></div>
<input id="ui_FirstName_edit" type="text" class="textbox" runat="server" />
</div>
</div>
<!-- first name end -->
<!-- middle initial start -->
<div class="form_title_data_container">
<div class="form_field_title">
Middle Initial
</div>
<div style="float: left;">
<div id="ui_MiddleInitial_value" runat="server"></div>
<input id="ui_MiddleInitial_edit" type="text" class="textbox" runat="server" />
</div>
</div>
<!-- middle initial end -->
<!-- last name start -->
<div class="form_title_data_container">
<div class="form_field_title">
Last Name
</div>
<div style="float: left;">
<div id="ui_LastName_value" runat="server"></div>
<input id="ui_LastName_edit" type="text" class="textbox" runat="server"/>
</div>
</div>
<!-- last name end -->
</div>
<!-- name details end -->
<!-- email start -->
<div class="form_title_data_container">
<div class="form_field_title">
</div>
<div style="float: left;">
<div id="ui_Email_value" runat="server"></div>
<input id="ui_Email_edit" type="text" class="textbox" runat="server"/>
</div>
</div>
<!-- email end -->
<!-- username start -->
<div class="form_title_data_container">
<div class="form_field_title">
Username:
</div>
<div style="float: left;">
<div id="ui_Username_value" runat="server"></div>
<input id="ui_Username_edit" type="text" class="textbox" runat="server" />
</div>
</div>
<!-- username end -->
<!-- password start -->
<div class="form_title_data_container">
<div class="form_field_title">
Password
</div>
<div style="float: left;">
<div id="ui_Password_value" runat="server"></div>
<input name="ui_Password_edit" id="ui_Password_edit" type="text" class="textbox" runat="server" />
</div>
</div>
<!-- password end -->
<!-- account enabled start -->
<div class="form_title_data_container">
<div class="form_field_title">
Account Enabled
</div>
<div style="float: left;">
<div id="ui_Status_value" runat="server"></div>
<asp:DropDownList runat="server" ID="ui_Status_edit" CssClass="textbox">
<asp:ListItem Text="Enabled" Value="false"></asp:ListItem>
<asp:ListItem Text="Disabled" Value="true"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
<!-- account enabled end -->
<!-- last login start -->
<div class="form_title_data_container">
<div class="form_field_title">
Last Login
</div>
<div style="float: left;">
<div id="ui_LastLogin_value" runat="server"></div>
</div>
</div>
<!-- last login end -->
</div>
<!-- user details end -->
<!-- margin start -->
<div style="float: left; width: 20px;">
</div>
<!-- margin end -->
<!-- roles start -->
<div style="float: left; width: 360px;">
<div class="section_header">
Roles
</div>
<telerik:RadListBox runat="server" ID="RadListBoxSource" Height="200px" Width="150px"
AllowTransfer="true" TransferToID="RadListBoxDestination">
<Items>
<telerik:RadListBoxItem Text="Argentina" />
<telerik:RadListBoxItem Text="Australia" />
<telerik:RadListBoxItem Text="Brazil" />
<telerik:RadListBoxItem Text="Canada" />
<telerik:RadListBoxItem Text="Chile" />
<telerik:RadListBoxItem Text="China" />
<telerik:RadListBoxItem Text="Egypt" />
<telerik:RadListBoxItem Text="England" />
<telerik:RadListBoxItem Text="France" />
<telerik:RadListBoxItem Text="Germany" />
<telerik:RadListBoxItem Text="India" />
<telerik:RadListBoxItem Text="Indonesia" />
<telerik:RadListBoxItem Text="Kenya" />
<telerik:RadListBoxItem Text="Mexico" />
<telerik:RadListBoxItem Text="New Zealand" />
<telerik:RadListBoxItem Text="South Africa" />
<telerik:RadListBoxItem Text="USA" />
</Items>
</telerik:RadListBox>
<telerik:RadListBox runat="server" ID="RadListBoxDestination" Height="200px" Width="150px" />
</div>
<!-- roles end -->
</div>
<!-- user info end -->
</div>
</telerik:RadXmlHttpPanel>
HI,
1. I would like to refreshthe scheduler by Button click event
2. I am able to get the appointmentsfrom the database and bind to scheduler.
3. I got the java scrip error“ Sys.InvalidOperationException: A control is already associatedwith the element”.
4. I tried without updatepanel there is no issue its working fine
5. Any idea let me know.
Thanks
SabarishHierarchyDefaultExpanded = true.
When I do this, all the items are expanded but the child tables are empty. Not even the "No child records to display" is there, it's just plain empty.
If I remove the HierarchyDefaultExpanded = true it works as expected, I can manually expand each item of the mastertable, and the child records will display.
Does anyone know what more steps I have to take to have all subtables displayed with data on page load?
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
|
|
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
My code is as follows:
<?
xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<
configuration>
<
configSections>
<
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>
</
configSections>
<
appSettings />
<
connectionStrings />
<
system.web>
<!--
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, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<
add assembly="System.Data, 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="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<
add assembly="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<
add assembly="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<
add assembly="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<
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.Web.Extensions.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</
assemblies>
</
compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<
authentication mode="Windows" />
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
<
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" />
</
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" />
</
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" />
</
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" />
</
handlers>
</
system.webServer>
<
runtime>
<
assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<
dependentAssembly>
<
assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" />
<
bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
</
dependentAssembly>
<
dependentAssembly>
<
assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35" />
<
bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
</
dependentAssembly>
</
assemblyBinding>
</
runtime>
<
location path="Telerik.Web.UI.WebResource.axd">
<
system.web>
<
authorization>
<
allow users="*"/>
</
authorization>
</
system.web>
</
location>
</
configuration>
<%
@ Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" %>
<%
@ Register src="wucHeader.ascx" tagname="wucHeader" tagprefix="uc1" %>
<%
@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head runat="server">
<title>Untitled Page</title>
<link href="necaadmin.css" rel="stylesheet" type="text/css" />
</
head>
<
body>
<form id="form1" runat="server">
<div>
<table align="left" cellpadding="0" cellspacing="0" class="classTblMain">
<tr>
<td></td>
<td>
<telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
</telerik:RadScriptManager>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadGrid1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGrid1"
LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
</td>
<td></td>
</tr>
<tr>
<td class="classTblMain_TL"></td>
<td class="classTblMain_TC"></td>
<td class="classTblMain_TR"></td>
</tr>
<tr>
<td class="classTblMain_ML"></td>
<td class="classTblMain_MC">
<uc1:wucHeader ID="wucHeader1" runat="server" />
</td>
<td class="classTblMain_MR"></td>
</tr>
<tr>
<td class="classTblMain_ML"></td>
<td class="classTblMain_MC"></td>
<td class="classTblMain_MR"></td>
</tr>
<tr>
<td class="classTblMain_ML"></td>
<td class="classTblMain_MC">
<table align="left" cellpadding="0" cellspacing="0" class="classTblWork">
<tr>
<td class="classTblWork_TL"></td>
<td class="classTblWork_TC"></td>
<td class="classTblWork_TR"></td>
</tr>
<tr>
<td class="classTblWork_ML"></td>
<td class="classTblWork_MC">
<asp:Label ID="Label1" runat="server" CssClass="mytxt Large Bold" Text="Events"></asp:Label>
</td>
<td class="classTblWork_MR"></td>
</tr>
<tr>
<td class="classTblWork_ML"></td>
<td class="classTblWork_MC">
<telerik:RadGrid ID="RadGrid1" runat="server" AllowMultiRowSelection="True"
AllowSorting="True" GridLines="None" Height="350px" Skin="Gray" Width="900px">
<HeaderContextMenu>
<CollapseAnimation Duration="200" Type="OutQuint" />
</HeaderContextMenu>
<MasterTableView ClientDataKeyNames="id" CommandItemDisplay="Top"
DataKeyNames="id">
<CommandItemTemplate>
<asp:ImageButton ID="cmdSpace0" runat="server" CausesValidation="False"
Height="16px" ImageUrl="~/images/spacer_10.png" />
<asp:ImageButton ID="cmdNew" runat="server" CausesValidation="False"
CommandName="cmdNew" ImageUrl="~/images/page_white.png" ToolTip="New" />
<asp:ImageButton ID="cmdEdit" runat="server" CausesValidation="False"
CommandName="cmdEdit" Height="16px" ImageUrl="~/images/Edit.png"
ToolTip="Edit" />
<asp:ImageButton ID="cmdSpace2" runat="server" CausesValidation="False"
Height="16px" ImageUrl="~/images/spacer_10.png" />
<asp:ImageButton ID="cmdDelete" runat="server" CausesValidation="False"
CommandName="cmdDelete" Height="16px" ImageUrl="~/images/Delete.png"
ToolTip="Delete" />
</CommandItemTemplate>
</MasterTableView>
<HeaderStyle Font-Bold="True" Font-Names="Arial" Font-Size="8pt" />
<ClientSettings>
<Selecting AllowRowSelect="True" />
<Scrolling AllowScroll="True" UseStaticHeaders="True" />
</ClientSettings>
<FilterMenu>
<CollapseAnimation Duration="200" Type="OutQuint" />
</FilterMenu>
<CommandItemStyle Height="30px" />
</telerik:RadGrid>
</td>
<td class="classTblWork_MR"></td>
</tr>
<tr>
<td class="classTblWork_ML"></td>
<td class="classTblWork_MC">
<asp:LinkButton ID="btnDeleteHide" runat="server" CssClass="myhyp Small"
OnClick="btnDeleteHide_Click"></asp:LinkButton>
</td>
<td class="classTblWork_MR"></td>
</tr>
<tr>
<td class="classTblWork_ML"></td>
<td class="classTblWork_MC"></td>
<td class="classTblWork_MR"></td>
</tr>
<tr>
<td class="classTblWork_BL"></td>
<td class="classTblWork_BC"></td>
<td class="classTblWork_BR"></td>
</tr>
</table>
</td>
<td class="classTblMain_MR"></td>
</tr>
<tr>
<td class="classTblMain_ML"></td>
<td class="classTblMain_MC"></td>
<td class="classTblMain_MR"></td>
</tr>
<tr>
<td class="classTblMain_BL"></td>
<td class="classTblMain_BC"></td>
<td class="classTblMain_BR"></td>
</tr>
<tr>
<td></td>
<td>
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Behavior="Move"
Behaviors="None" Height="320px" Modal="True" onclientclose="closeRadWindow"
ReloadOnShow="True" ShowContentDuringLoad="False" Skin="Black"
VisibleStatusbar="False" Width="780px">
</telerik:RadWindowManager>
</td>
<td></td>
</tr>
<tr>
<td></td>
<td>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Runat="server"
BackColor="Yellow" height="75px" MinDisplayTime="500" Transparency="50"
width="75px">
<br />
<br />
<br />
<br />
<img alt="Loading..."
src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'
style="border:0px;" />
</telerik:RadAjaxLoadingPanel>
</td>
<td></td>
</tr>
</table>
</div>
</form>
</
body>
</
html>
Partial
Class Default2
Inherits Telerik.Web.UI.RadAjaxPage
Private MySess As New classSession
Private MySql As New classSql("necadata", "necadata", False)
Private MyUtil As New classUtil("necadata", "necadata")
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
MySess.SiteProcess(
"root", "eventgrid", True)
If Not Page.IsPostBack Then
GridDataLoad(
True)
End If
End Sub
Public Sub GridDataLoad(ByVal blnWantDataBind As Boolean)
MySess.SiteProcess(
"root", "eventgrid", True)
MySql.sSql =
"SELECT * FROM vNecaEventGrid; "
MySql.SqlSelect(
"griddata")
RadGrid1.DataSource = MySql.ds.Tables(
"griddata")
'If blnWantDataBind Then RadGrid1.DataBind()
End Sub
Protected Sub RadGrid1_ColumnCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridColumnCreatedEventArgs) Handles RadGrid1.ColumnCreated
Dim MyGridColumn As Object
Dim s As String
Select Case UCase(e.Column.ColumnType)
Case "GRIDEXPANDCOLUMN" : Exit Sub
Case "GRIDBOUNDCOLUMN" : MyGridColumn = New Telerik.Web.UI.GridBoundColumn
Case "GRIDDATETIMECOLUMN" : MyGridColumn = New Telerik.Web.UI.GridDateTimeColumn
Case "GRIDNUMERICCOLUMN" : MyGridColumn = New Telerik.Web.UI.GridNumericColumn
End Select
MyGridColumn = e.Column
With MyGridColumn
s = UCase(.UniqueName)
Select Case s
Case "ID"
.Visible =
False
Case "EDATE"
.DataType = System.Type.GetType(
"System.DateTime") : .DataFormatString = "{0:MM/dd/yyyy h:mmt}"
.ItemStyle.Width = 100 : .ItemStyle.HorizontalAlign = HorizontalAlign.Left
.HeaderStyle.Width = 100 : .HeaderStyle.HorizontalAlign = HorizontalAlign.Left
.HeaderText =
"Date"
Case "LOCATION"
.ItemStyle.HorizontalAlign = HorizontalAlign.Left
.HeaderStyle.HorizontalAlign = HorizontalAlign.Left
.HeaderText =
"Location"
Case "TOPIC"
.ItemStyle.HorizontalAlign = HorizontalAlign.Left
.HeaderStyle.HorizontalAlign = HorizontalAlign.Left
.HeaderText =
"Topic"
Case "SPEAKER"
.ItemStyle.HorizontalAlign = HorizontalAlign.Left
.HeaderStyle.HorizontalAlign = HorizontalAlign.Left
.HeaderText =
"Speaker"
Case "ATTACHFILE"
.ItemStyle.HorizontalAlign = HorizontalAlign.Left
.HeaderStyle.HorizontalAlign = HorizontalAlign.Left
.HeaderText =
"Attach"
Case Else
.ReadOnly =
True
.Visible =
False
End Select
End With
End Sub
Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand
Select Case UCase(e.CommandName)
Case "CMDEDIT"
'Session("sessJhaAdmin_contacts_code") = RadGrid1.SelectedItems(0).OwnerTableView.DataKeyValues(RadGrid1.SelectedItems(0).ItemIndex)("ID")
'Response.Redirect("contactsopen.aspx")
End Select
End Sub
Protected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
'GridDataLoad(False)
End Sub
Protected Sub RadGrid1_PageIndexChanged(ByVal source As Object, ByVal e As Telerik.Web.UI.GridPageChangedEventArgs) Handles RadGrid1.PageIndexChanged
'GridDataLoad(True)
End Sub
Protected Sub RadGrid1_SortCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridSortCommandEventArgs) Handles RadGrid1.SortCommand
'GridDataLoad(True)
End Sub
'Protected Sub RadAjaxPanel1_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs) Handles RadAjaxPanel1.AjaxRequest
' RadGrid1.Rebind()
'End Sub
Protected Sub btnDeleteHide_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDeleteHide.Click
'Dim iDataValue As Int32
'Dim i As Int32
'MySql.sSql = ""
'For i = 0 To RadGrid1.SelectedItems.Count - 1
' iDataValue = RadGrid1.SelectedItems(i).OwnerTableView.DataKeyValues(RadGrid1.SelectedItems(i).ItemIndex)("id")
' MySql.sSql &= "DELETE FROM Event WHERE id=" & iDataValue & "; "
'Next i
'If Len(MySql.sSql) > 0 Then MySql.ExecuteNonQuery()
'GridDataLoad(True)
End Sub
End
Class
The line that throws the error is: RadGrid1.DataSource = MySql.ds.Tables("griddata")
Thanks for any help
Ryan
protected void Swap_Click(object sender, EventArgs e)
{
DataSet ds1 = (DataSet)Cache[dKey];
DataView dv = ds1.Tables[0].DefaultView;
string preLink2 = "<A href='MainAction.aspx?mode=ComponentInfo&suppliedComponentID=" +suppliedComponentID.ToString() + "'>";
string postLink2 = "</A>";
dv.RowFilter =
string.Format("BlockID={0}", ProductID);
dv[0][
"SuppliedComponentID"] = suppliedComponentID;
dv[0][
"ReservationStatusID"] = reservationStatusID;
dv[0][
"ConfirmationSize"] = confirmedAllocation;
dv[0][
"SupplierPlain"] = AssociatesList.SelectedItem.Text;
dv[0][
"SupplierID"] = suppliedComponentID;
dv[0][
"SupplierName"] = preLink2 + AssociatesList.SelectedItem.Text + postLink2;
Cache[dKey] = ds1;
//Close the active ToolTip.
ScriptManager.RegisterClientScriptBlock(
this.Page,
this.GetType(),
"WebUserControlSript",
"CloseActiveToolTip('" + this.ProductID + "')",
true);
}
On Control Page :
/
SCRIPT>
<script type="text/javascript">
function CloseActiveToolTip(supplierID) {
var tooltip = Telerik.Web.UI.RadToolTip.getCurrent();
if (tooltip) tooltip.hide();
var grid = $find("<%=RadGrid1.ClientID %>").get_masterTableView();
grid.rebind();
}
</script>
protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
if (!e.IsFromDetailTable)
{
DataSet ds = new DataSet();
ds = (Cache[dKey] !=
null) ? (DataSet)Cache[dKey] : ds;
RadGrid1.DataSource = ds.Tables[0];
//DataTable ds = new DataTable();
//ds = (Cache[dKey] != null) ? (DataTable)Cache[dKey] : ds;
//RadGrid1.DataSource = ds;
}
}
<
telerik:RadProgressManager id="radProgressManager1" runat="server" RefreshPeriod="5" />
<telerik:RadProgressArea id="radProgressArea1" runat="server" DisplayCancelButton="False"
ProgressIndicators="TimeElapsed">
</telerik:RadProgressArea>
CodeBehind file:
--------------------------
public
void UpdateProgressContext(StringBuilder projectStatus)
{
RadProgressContext context = RadProgressContext.Current;
context.SecondaryTotal = 100;
for (int i = 1; i < 100; i++)
{
context.SecondaryValue = i;
context.SecondaryPercent = i;
context.CurrentOperationText = projectStatus;
if (!Response.IsClientConnected)
{
//Cancel button was clicked or the browser was closed, so stop processing
break;
}
// simulate a long time performing the current step
Thread.Sleep(100);
}
}