
| function ShowHideGanttDock(docName) |
| { |
| var dock = $find(docName); |
| var isClosed = dock.get_closed(); |
| dock.set_closed(!isClosed); |
| } |
Probably easy for you to fix, seems to be something with encoding of spaces. I'm using IE7.
I have a rad window that calls another aspx page with a control attached to it and I would like to pass info to the control with in that rad window. Is this possible. I have tried something like this, but am getting an "Object reference not set to an instacne of an object" error.
cntl_add_note.ascx User Control code:
<table style="width: 575px; height: 175px;">
<tr>
<td>
Add Notes Section: <asp:Label ID="lblProjectID" runat="server" Text=""></asp:Label>
</td>
</tr>
</table>
This is the server side code that is calling the rad window:
RadWindow1.NavigateUrl = "~/note.aspx"
RadWindow1.Visible = True
RadWindow1.VisibleOnPageLoad = True
RadWindow1.Left = Unit.Percentage(50)
RadWindow1.Top = Unit.Percentage(50)
RadWindow1.Enabled = True
RadWindow1.Width = Unit.Pixel(600)
RadWindow1.Height = Unit.Pixel(300)
Dim lblProjectID As Label = DirectCast(RadWindow1.FindControl("lblProjectID"), Label)
lblProjectID.Text = "Test"
The 2 lines above are where I tried to insert "Test" into the label on the cntl_add_note.ascx User Control, but got the error. Is it possible to pass the info to that control?
Thanks
<%
@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>
<%@ 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></title></head>
<body>
<form id="form1" runat="server" >
<telerik:RadScriptManager ID="RadScriptManager1" runat="server" LoadScriptsBeforeUI="true">
</telerik:RadScriptManager>
<table cellpadding="0" cellspacing="0" border="1"bordercolor="red" width="100%" height="100%">
<tr><td valign="top" height="99%">
<telerik:RadGrid EnableEmbeddedSkins="false" ID="RadGrid1" ImagesPath="~/App_Themes/Theme1/Grid"
AllowPaging="true" AllowSorting="true" runat="server"
DataSourceID="XmlDataSource1" Skin="Sunset"
PageSize="5" PagerStyle-Position="Bottom" PagerStyle-AlwaysVisible="true" ><ClientSettings><Resizing EnableRealTimeResize="true" /></ClientSettings><MasterTableView Width="100%" Height="100%" ></MasterTableView></telerik:RadGrid></td></tr></table></form><asp:XmlDataSource ID="XmlDataSource1" DataFile="~/XMLFile1.xml" runat="server"></asp:XmlDataSource></body></html>
html
,body,form{height:100%;width:100%;margin:0px;padding:0px;font-family: Verdana, Arial, sans-serif;color: #666666;background-color: #E5E5E5;}
/*paging*/
.GridPager_Sunset{background:#ded6c6;line-height:20px;height:100%;vertical-align:bottom;}
Any xml datasource will recreate the problem.
When this page loads...I have a scroll bar on the right hand said that is proportional to the amound of data in the grid. So if the grid had 10 records the browser right scroll shows and the page is about 30% longer then it shoudl be at. The paging is displayed off the screen.
Now I'm running at 1600X1200 RES so there is no reason there should be any scrolling on this page to show 10 records.

| Imports System |
| Imports System.Data |
| Imports System.Configuration |
| Imports System.Web |
| Imports System.Web.Security |
| Imports System.Web.UI |
| Imports System.Web.UI.WebControls |
| Imports System.Web.UI.WebControls.WebParts |
| Imports System.Web.UI.HtmlControls |
| Imports System.Data.OleDb |
| Imports System.IO |
| Imports Telerik.Web.UI |
| Partial Public Class sermons1 |
| Inherits System.Web.UI.Page |
| Private Shared _connectionString As String = Nothing |
| Dim RandomClass As New Random() |
| Dim RandomNumber As String = RandomClass.Next().ToString |
| Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) |
| If Not IsPostBack Then |
| RadGrid1.MasterTableView.DataKeyNames = New String() {"ID"} |
| End If |
| End Sub 'Page_Load |
| Protected Sub RadGrid1_InsertCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.InsertCommand |
| If IsValid Then |
| Dim uploader As RadUpload = e.Item.FindControl("RadUpload1") |
| Dim uploader2 As RadUpload = e.Item.FindControl("RadUpload2") |
| Dim description As TextBox = e.Item.FindControl("txtDescription") |
| Dim datecreated As TextBox = e.Item.FindControl("txtdate") |
| Dim DropDownList1 As RadComboBox = e.Item.FindControl("DropDownList1") |
| '/// Pass sql statement to connection module for execution |
| Dim stridcreated As String |
| Dim imagename As String = "" |
| Dim imagename2 As String = "" |
| Dim filename As UploadedFile = Nothing |
| stridcreated = insertqry("INSERT INTO sermons ( [description], [datecreated],[cat]) VALUES ( '" & description.Text & "', '" & datecreated.Text & "q', '" & DropDownList1.SelectedValue.ToString & "'); ", ) |
| Dim targetFolder As String = Server.MapPath("~/uploads/") |
| Try |
| filename = uploader.UploadedFiles(0) |
| SaveFile(filename, targetFolder & stridcreated & filename.GetExtension()) |
| imagename = stridcreated & filename.GetExtension() |
| Catch ex As Exception |
| End Try |
| Try |
| filename = uploader2.UploadedFiles(0) |
| SaveFile(filename, targetFolder & stridcreated & "_2" & filename.GetExtension()) |
| imagename2 = stridcreated & "_2" & filename.GetExtension() |
| Catch ex As Exception |
| End Try |
| If uploader.UploadedFiles.Count > 0 And uploader2.UploadedFiles.Count > 0 Then |
| updateqry("update sermons SET [file]='" & imagename & "' WHERE [id] = " & stridcreated, ) |
| updateqry("update sermons SET [flier]='" & imagename2 & "' WHERE [id] = " & stridcreated, ) |
| ElseIf uploader.UploadedFiles.Count > 0 Then |
| updateqry("update sermons SET [file]='" & imagename & "' WHERE [id] = " & stridcreated, ) |
| ElseIf uploader2.UploadedFiles.Count > 0 Then |
| updateqry("update sermons SET [flier]='" & imagename2 & "' WHERE [id] = " & stridcreated, ) |
| Else |
| End If |
| SetMessage(stridcreated & " was the id created") |
| End If |
| RadGrid1.Rebind() |
| End Sub 'RadGrid1_InsertCommand |
| Protected Sub RadGrid1_UpdateCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.UpdateCommand |
| Dim uploader As RadUpload = e.Item.FindControl("RadUpload1") |
| Dim uploader2 As RadUpload = e.Item.FindControl("RadUpload2") |
| Dim description As TextBox = e.Item.FindControl("txtDescription") |
| Dim datecreated As TextBox = e.Item.FindControl("txtdate") |
| Dim DropDownList1 As RadComboBox = e.Item.FindControl("DropDownList1") |
| Dim id As Integer = CInt(RadGrid1.MasterTableView.DataKeyValues(e.Item.ItemIndex)("ID")) |
| Dim imagename As String = "" |
| Dim imagename2 As String = "" |
| Dim filename As UploadedFile = Nothing |
| Try |
| filename = uploader.UploadedFiles(0) |
| SaveFile(filename, Server.MapPath("~/uploads/") & id & filename.GetExtension()) |
| imagename = id & filename.GetExtension() |
| Catch ex As Exception |
| End Try |
| Try |
| filename = uploader2.UploadedFiles(0) |
| SaveFile(filename, Server.MapPath("~/uploads/") & id & "_2" & filename.GetExtension()) |
| imagename2 = id & "_2" & filename.GetExtension() |
| Catch ex As Exception |
| End Try |
| If uploader.UploadedFiles.Count > 0 And uploader2.UploadedFiles.Count > 0 Then |
| DeleteFile(id) |
| updateqry("UPDATE sermons SET [description]='" & description.Text & "', [cat]='" & DropDownList1.SelectedValue.ToString & "', [datecreated]='" & datecreated.Text & "' WHERE [id] = " & id) |
| updateqry("update sermons SET [file]='" & imagename & "' WHERE [id] = " & id, ) |
| updateqry("update sermons SET [flier]='" & imagename2 & "' WHERE [id] = " & id, ) |
| ElseIf uploader.UploadedFiles.Count > 0 Then |
| updateqry("UPDATE sermons SET [description]='" & description.Text & "', [cat]='" & DropDownList1.SelectedValue.ToString & "', [datecreated]='" & datecreated.Text & "' WHERE [id] = " & id) |
| updateqry("update sermons SET [file]='" & imagename & "' WHERE [id] = " & id, ) |
| ElseIf uploader2.UploadedFiles.Count > 0 Then |
| updateqry("UPDATE sermons SET [description]='" & description.Text & "', [cat]='" & DropDownList1.SelectedValue.ToString & "', [datecreated]='" & datecreated.Text & "' WHERE [id] = " & id) |
| updateqry("update sermons SET [flier]='" & imagename2 & "' WHERE [id] = " & id, ) |
| Else |
| updateqry("UPDATE sermons SET [description]='" & description.Text & "', [cat]='" & DropDownList1.SelectedValue.ToString & "', [datecreated]='" & datecreated.Text & "' WHERE [id] = " & id) |
| End If |
| SetMessage("Record " & id & " was updated") |
| RadGrid1.Rebind() |
| End Sub |
| Protected Sub RadGrid1_DeleteCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.DeleteCommand |
| Dim id As Integer = CInt(RadGrid1.MasterTableView.DataKeyValues(e.Item.ItemIndex)("ID")) |
| ' Dim ID As String = CType(e.Item, GridDataItem)("CustomerID").Text |
| updateqry("DELETE FROM sermons WHERE [ID]= " & id, ) |
| RadGrid1.Rebind() |
| End Sub |
| Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) |
| If TypeOf e.Item Is Telerik.Web.UI.GridEditableItem And e.Item.IsInEditMode Then |
| End If |
| End Sub |
| Function SaveFile(ByVal Filetobesaved As UploadedFile, ByVal id As String) |
| Filetobesaved.SaveAs(id, True) |
| Return id |
| End Function |
| Protected Sub DeleteFile(ByVal id As String) |
| Try |
| Dim Filetobedeleted As String |
| For Each Filetobedeleted In Directory.GetFiles(Server.MapPath("~/upload") & id) |
| File.Delete(Filetobedeleted) |
| Next Filetobedeleted |
| Catch ex As Exception |
| SetMessage("image could not be deleted, but it worked") |
| End Try |
| End Sub |
| Private Sub SetMessage(ByVal message As String) |
| gridMessage = message |
| End Sub |
| Private gridMessage As String = Nothing |
| Protected Sub RadGrid1_DataBound(ByVal sender As Object, ByVal e As EventArgs) Handles RadGrid1.DataBound |
| If Not String.IsNullOrEmpty(gridMessage) Then |
| DisplayMessage(gridMessage) |
| End If |
| End Sub |
| Private Sub DisplayMessage(ByVal text As String) |
| RadGrid1.Controls.Add(New LiteralControl(String.Format("<span style='color:red'>{0}</span>", text))) |
| End Sub |
| End Class |
| <%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/admin/admin.Master" CodeBehind="sermons.aspx.vb" Inherits="blackmansgrove.org.sermons1" %> |
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
| <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> |
| <telerik:RadGrid runat="server" ID="RadGrid1" Skin="Vista" |
| EnableOutsideScripts="true" EnableAJAX="true" AllowPaging="True" |
| AllowSorting="True" AutoGenerateColumns="False" Width="97%" |
| DataSourceID="AccessDataSource1" AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True" |
| OnUpdateCommand="RadGrid1_UpdateCommand" OnInsertCommand="RadGrid1_InsertCommand" |
| OnDeleteCommand="RadGrid1_DeleteCommand" OnItemDataBound="RadGrid1_ItemDataBound" |
| ShowStatusBar="True" GridLines="None"> |
| <PagerStyle Mode="NextPrevAndNumeric" /> |
| <MasterTableView DataSourceID="AccessDataSource1" DataKeyNames="ID" |
| commanditemdisplay="Top"> |
| <Columns> |
| <telerik:GridTemplateColumn UniqueName="TemplateColumn" SortExpression="ID"> |
| <HeaderTemplate> |
| <table> |
| <tr> |
| <td style="width: 144px; height: 21px"> |
| ID |
| </td> |
| <td style="width: 198px; height: 21px"> |
| datecreated |
| </td> |
| <td style="height: 21px; width: 85px;"> |
| description |
| </td> |
| <td style="height: 21px; width: 85px;"> |
| Cat |
| </td> |
| <td style="height: 21px; width: 75px;"> |
| File |
| </td> |
| <td style="height: 21px; width: 75px;"> |
| Flier |
| </td> |
| </tr> |
| </table> |
| </HeaderTemplate> |
| <ItemTemplate> |
| <table> |
| <tr> |
| <td style="width: 144px; height: 21px"> |
| <%#Eval("id")%> |
| </td> |
| <td style="width: 198px; height: 21px"> |
| <%#Eval("datecreated")%> |
| </td> |
| <td style="height: 21px; width: 85px;"> |
| <%#Eval("description")%> |
| </td> |
| <td style="height: 21px; width: 85px;"> |
| <%#Eval("cat")%> |
| </td> |
| <td style="height: 21px; width: 75px;"> |
| <a target="_blank" href="../uploads/<%# Eval("file") %>"> |
| <asp:Image runat="server" ID="Image1" AlternateText="Click here to open" |
| ImageUrl='../userimages/video.jpg' Style="border-width: 0px; height: 50px; Width: 50px;" /> |
| </td> |
| <td style="height: 21px; width: 75px;"> |
| <a target="_blank" href="../uploads/<%# Eval("flier") %>"> |
| <asp:Image runat="server" ID="ImageThumbnail" AlternateText="Click here to open" |
| ImageUrl='../userimages/pdf.gif' Style="border-width: 0px; height: 50px; Width: 50px;" /> |
| </td> |
| </tr> |
| </table> |
| </ItemTemplate> |
| <ItemStyle HorizontalAlign="Left" /> |
| </telerik:GridTemplateColumn> |
| </Columns> |
| <EditFormSettings EditFormType="Template"> |
| <FormTemplate> |
| <table> |
| <tr> |
| <td> |
| <table> |
| <tr> |
| <td style="width: 14px"> |
| </td> |
| <td> |
| ID: </td> |
| <td> |
| <asp:Label ID="lblid" runat="server" Text='<%# Eval("ID") %>'></asp:Label></td> |
| <td style="width: 19px"> |
| </td> |
| </tr> |
| <tr> |
| <td style="width: 14px"> |
| </td> |
| <td> |
| Date: </td> |
| <td> |
| <asp:TextBox ID="txtdate" Text='<%# Eval("datecreated") %>' runat="server"></asp:TextBox></td> |
| <td style="width: 19px"> |
| </td> |
| </tr> |
| <tr> |
| <td style="width: 14px"> |
| </td> |
| <td> |
| Description : |
| </td> |
| <td> |
| <asp:TextBox ID="txtdescription" Text='<%# Eval("description") %>' runat="server" |
| Height="150px" TextMode="MultiLine" Width="400px"></asp:TextBox></td> |
| <td style="width: 19px"> |
| </td> |
| </tr> |
| <tr> |
| <td style="width: 14px"> |
| </td> |
| <td> |
| Category : |
| </td> |
| <td> |
| <telerik:RadComboBox ID="DropDownList1" runat="server" SelectedValue='<%# Eval("Cat") %>' Skin="Vista" > |
| <Items> |
| <telerik:RadComboBoxItem Text="adultsermons" Value="adultsermons" /> |
| <telerik:RadComboBoxItem Text="childsermons" Value="childsermons" /> |
| <telerik:RadComboBoxItem Text="teensermons" Value="teensermons" Selected="true" /> |
| </Items> |
| </telerik:RadComboBox> |
| </td> |
| <td style="width: 19px"> |
| </td> |
| </tr> |
| <tr> |
| <td style="width: 14px"> |
| </td> |
| <td> |
| Flier:</td> |
| <td> |
| <telerik:radupload id="RadUpload2" runat="server" skin="Web20" initialfileinputscount="1" |
| maxfileinputscount="1" controlobjectsvisibility="None" maxfilesize="1000000" |
| /> |
| </td> |
| <td style="width: 19px"> |
| </td> |
| </tr> |
| <tr> |
| <td style="width: 14px"> |
| </td> |
| <td> |
| File:</td> |
| <td> |
| <telerik:radupload id="RadUpload1" runat="server" skin="Web20" initialfileinputscount="1" |
| maxfileinputscount="1" controlobjectsvisibility="None" maxfilesize="1000000" |
| /> |
| <telerik:radprogressmanager id="Radprogressmanager1" skin="Web20" runat="server" /> |
| <telerik:radprogressarea id="RadProgressArea1" skin="Web20" runat="server"></telerik:radprogressarea> |
| </td> |
| <td style="width: 19px"> |
| </td> |
| </tr> |
| </table> |
| </td> |
| </tr> |
| </table> |
| <asp:Button ID="btnUpdate" Text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "Insert", "Update") %>' runat="server" CommandName='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "PerformInsert", "Update")%>' /> |
| <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel" /> |
| </FormTemplate> |
| <PopUpSettings ScrollBars="None"></PopUpSettings> |
| </EditFormSettings> |
| <ExpandCollapseColumn Resizable="False" Visible="False"> |
| <HeaderStyle Width="20px" /> |
| </ExpandCollapseColumn> |
| <RowIndicatorColumn Visible="False"> |
| <HeaderStyle Width="20px" /> |
| </RowIndicatorColumn> |
| </MasterTableView> |
| <ExportSettings> |
| <Pdf PageBottomMargin="" PageFooterMargin="" PageHeaderMargin="" PageHeight="11in" |
| PageLeftMargin="" PageRightMargin="" PageTopMargin="" PageWidth="8.5in" /> |
| </ExportSettings> |
| </telerik:RadGrid> |
| <asp:AccessDataSource ID="AccessDataSource1" runat="server" |
| DataFile="~/App_Data/website.mdb" SelectCommand="SELECT * FROM [sermons]"> |
| </asp:AccessDataSource> |
| </asp:Content> |