| <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> |
| <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> |
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head runat="server"> |
| <title>Untitled Page</title> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <asp:ScriptManager ID="ScriptManager1" runat="server" /> |
| <asp:UpdatePanel ID="UpdatePanel1" runat="server"> |
| <ContentTemplate> |
| <asp:Panel ID="TitlePanel" runat="server" Height="23px" Width="825px" style="background-color:Black;color:GrayText; vertical-align:middle;font-size:10pt;font-family:Arial;"> |
| <asp:ImageButton ID="ImageButton1" ImageUrl="images/minussign.gif" runat="server" Height="20px" Width="25px" AccessKey="1" style="position:relative;top:2px;" /> |
| <asp:Label ID="TitleLabel" runat="server" style="position:relative;top:-4px;"></asp:Label> |
| </asp:Panel> |
| <asp:Panel ID="ContentPanel" runat="server" style="background-color:Gray;width:825px;"> |
| <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AutoGenerateEditColumn="True" GridLines="None" OnNeedDataSource="RadGrid1_NeedDataSource" OnDeleteCommand="RadGrid1_DeleteCommand" OnInsertCommand="RadGrid1_InsertCommand" OnItemCommand="RadGrid1_ItemCommand" OnUpdateCommand="RadGrid1_UpdateCommand" Width="825px" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" AutoGenerateColumns="False" AutoGenerateDeleteColumn="True"> |
| <MasterTableView CommandItemDisplay="Top"> |
| <Columns> |
| <telerik:GridBoundColumn UniqueName="SID" HeaderText="SID" DataField="SID"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn UniqueName="Title" HeaderText="Title" DataField="TITLE"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn UniqueName="Name" HeaderText="Name" DataField="NAME"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn UniqueName="Product" HeaderText="Product" DataField="PRODUCT"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn UniqueName="SubmitDate" HeaderText="Submit Date" DataField="SUBMITDATE"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn UniqueName="Story" HeaderText="Story" DataField="STORY"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| <RowIndicatorColumn Visible="False"> |
| <HeaderStyle Width="20px" /> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn Resizable="False" Visible="False"> |
| <HeaderStyle Width="20px" /> |
| </ExpandCollapseColumn> |
| <EditFormSettings EditFormType="WebUserControl" UserControlName="EditForm.ascx"> |
| <PopUpSettings ScrollBars="None" /> |
| </EditFormSettings> |
| </MasterTableView> |
| </telerik:RadGrid> |
| </asp:Panel> |
| <cc1:CollapsiblePanelExtender ID="CollapseEx" runat="server" CollapseControlID="TitlePanel" CollapsedImage="images/plussign.gif" ExpandControlID="TitlePanel" ExpandedImage="images/minussign.gif" TextLabelID="TitleLabel" TargetControlID="ContentPanel" ImageControlID="ImageButton1" CollapsedText="Click or press Alt-1 to expand<br />" ExpandedText="Click or press Alt-1 to collapse<br />"> |
| </cc1:CollapsiblePanelExtender> |
| </ContentTemplate> |
| </asp:UpdatePanel> |
| <br /> |
| |
| <div> |
| </div> |
| </form> |
| </body> |
| </html> |
| using System; |
| using System.Data; |
| using System.Collections; |
| using System.Configuration; |
| using System.Web; |
| using System.Web.Security; |
| using System.Web.UI; |
| using System.Web.UI.WebControls; |
| using System.Web.UI.WebControls.WebParts; |
| using System.Web.UI.HtmlControls; |
| using System.Data.SqlClient; |
| using System.Data.OracleClient; |
| using Telerik.Web.UI; |
| public partial class _Default : System.Web.UI.Page |
| { |
| OracleConnection ociConn = new OracleConnection("Data Source=localhost;Persist Security Info=True;User ID=system;Password=testdb;Unicode=True"); |
| protected void RadGrid1_PreRender(object sender, System.EventArgs e) |
| { |
| if (!this.IsPostBack) |
| { |
| this.RadGrid1.MasterTableView.Items[1].Edit = true; |
| this.RadGrid1.MasterTableView.Rebind(); |
| } |
| } |
| protected DataTable GetDataTable(string query) { |
| ociConn.Open(); |
| OracleCommand cmd = new OracleCommand("Select SID, Title, Name, Product, SubmitDate, Story from Stories", ociConn); |
| DataTable temp = new DataTable(); |
| OracleDataAdapter da = new OracleDataAdapter(cmd); |
| try { |
| da.Fill(temp); |
| } |
| finally { |
| ociConn.Close(); |
| } |
| return temp; |
| } |
| private DataTable Stories |
| { |
| get |
| { |
| object obj = this.Session["Stories"]; |
| if ((!(obj == null))) |
| { |
| return ((DataTable)(obj)); |
| } |
| DataTable myDataTable = new DataTable(); |
| myDataTable = GetDataTable(""); |
| this.Session["Stories"] = myDataTable; |
| return myDataTable; |
| } |
| } |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| } |
| protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) |
| { |
| RadGrid1.DataSource = this.Stories; |
| } |
| protected void RadGrid1_InsertCommand(object source, GridCommandEventArgs e) |
| { |
| GridEditableItem editedItem = e.Item as GridEditableItem; |
| UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID); |
| //Create new row in the DataSource |
| DataRow newRow = this.Stories.NewRow(); |
| //Insert new values |
| Hashtable newValues = new Hashtable(); |
| newValues["SID"] = Int32.Parse((userControl.FindControl("TextBox1") as TextBox).Text); |
| //newValues["Region"] = (userControl.FindControl("TextBox3") as TextBox).Text; |
| newValues["Title"] = (userControl.FindControl("TextBox2") as TextBox).Text; |
| newValues["Name"] = (userControl.FindControl("TextBox3") as TextBox).Text; |
| newValues["Product"] = ""; |
| newValues["SubmitDate"] = DateTime.Now; |
| newValues["Story"] = ""; |
| //newValues["City"] = (userControl.FindControl("TextBox2") as TextBox).Text; |
| //newValues["Region"] = (userControl.FindControl("TextBox3") as TextBox).Text; |
| try |
| { |
| foreach (DictionaryEntry entry in newValues) |
| { |
| newRow[(string)entry.Key] = entry.Value; |
| } |
| this.Stories.Rows.Add(newRow); |
| this.Stories.AcceptChanges(); |
| } |
| catch (Exception ex) |
| { |
| RadGrid1.Controls.Add(new LiteralControl("Unable to update/insert Employees. Reason: " + ex.Message)); |
| e.Canceled = true; |
| } |
| } |
| protected void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e) |
| { |
| GridEditableItem editedItem = e.Item as GridEditableItem; |
| UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID); |
| //Prepare new row to add it in the DataSource |
| DataRow[] changedRows = this.Stories.Select("SID = " + editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["SID"]); |
| if (changedRows.Length != 1) |
| { |
| RadGrid1.Controls.Add(new LiteralControl("Unable to locate the Story for updating.")); |
| e.Canceled = true; |
| return; |
| } |
| //Update new values |
| Hashtable newValues = new Hashtable(); |
| newValues["SID"] = (userControl.FindControl("TextBox1") as TextBox).Text; |
| newValues["Title"] = (userControl.FindControl("TextBox2") as TextBox).Text; |
| newValues["Name"] = (userControl.FindControl("TextBox3") as TextBox).Text; |
| newValues["Product"] = (userControl.FindControl("TextBox4") as TextBox).Text; |
| newValues["SubmitDate"] = (userControl.FindControl("TextBox5") as TextBox).Text; |
| newValues["Story"] = (userControl.FindControl("TextBox6") as DropDownList).Text; |
| changedRows[0].BeginEdit(); |
| try |
| { |
| foreach (DictionaryEntry entry in newValues) |
| { |
| changedRows[0][(string)entry.Key] = entry.Value; |
| } |
| changedRows[0].EndEdit(); |
| this.Stories.AcceptChanges(); |
| } |
| catch (Exception ex) |
| { |
| changedRows[0].CancelEdit(); |
| RadGrid1.Controls.Add(new LiteralControl("Unable to update Stories. Reason: " + ex.Message)); |
| e.Canceled = true; |
| } |
| } |
| protected void RadGrid1_DeleteCommand(object source, GridCommandEventArgs e) |
| { |
| string ID = (e.Item as GridDataItem).OwnerTableView.DataKeyValues[e.Item.ItemIndex]["SID"].ToString(); |
| DataTable employeeTable = this.Stories; |
| if (employeeTable.Rows.Find(ID) != null) |
| { |
| employeeTable.Rows.Find(ID).Delete(); |
| employeeTable.AcceptChanges(); |
| } |
| } |
| protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) |
| { |
| if (e.CommandName == RadGrid.InitInsertCommandName) |
| { |
| e.Canceled = true; |
| RadGrid1.EditIndexes.Clear(); |
| e.Item.OwnerTableView.EditFormSettings.UserControlName = "AddForm.ascx"; |
| e.Item.OwnerTableView.InsertItem(); |
| } |
| else if (e.CommandName == RadGrid.EditCommandName) |
| { |
| e.Item.OwnerTableView.IsItemInserted = false; |
| e.Item.OwnerTableView.EditFormSettings.UserControlName = "EditForm.ascx"; |
| } |
| } |
| } |
| protected void ibtExportCSV_Click(object sender, ImageClickEventArgs e) |
| { |
| RadGrid grid = (RadGrid)Place_Grilla.FindControl("Grilla"); |
| grid.Columns[0].Display = false; |
| grid.Columns[1].Display = false; |
| //grid.ExportSettings.Csv.ColumnDelimiter = GridCsvDelimiter.Tab; |
| grid.ExportSettings.Csv.RowDelimiter = GridCsvDelimiter.NewLine; |
| grid.ExportSettings.IgnorePaging = true; |
| grid.ExportSettings.ExportOnlyData = true; |
| grid.ExportSettings.OpenInNewWindow = true; |
| grid.MasterTableView.ExportToCSV(); |
| } |
| <%-- |
| $Date$ |
| $Author$ |
| $Revision$ |
| (C)2008 CGI, Inc. |
| THIS PROGRAM IS PROPRIETARY AND IS THE PROPERTY OF: CGI, INC |
| COPYING OR USE OF THIS PROGRAM, EXCEPT AS SPECIFICALLY PROVIDED FOR IN A |
| LICENSE AGREEMENT CONTROLLING SUCH USE, IS PROHIBITED. |
| This program is designated as CONFIDENTIAL and is a trade secret under |
| applicable laws. Unauthorized copying or disclosure is prohibited and is |
| subject to criminal and civil penalties, including fines and imprisonment. |
| --%> |
| <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="ReachMasterPage" %> |
| <%@ 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" id="HeadMaster"> |
| <title></title> |
| <link href="Styles/StyleSheet.css" rel="stylesheet" type="text/css" /> |
| </head> |
| <body> |
| <form id="form1" runat="server" method="post"> |
| <asp:ScriptManager ID="ScriptManager1" runat="server"> |
| </asp:ScriptManager> |
| <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> |
| </telerik:RadAjaxManager> |
| <div id="master_page"> |
| <div id="master_header_top"> |
| <div id="master_icon"> |
| <asp:Image ID="imgCgiLogo" runat="server" ImageUrl="~/Images/cgilogo.gif" /> |
| </div> |
| <div id="master_login" style="height: 22px"> |
| <span style="font-size: 11pt; font-weight:bold; color: red; font-family: 'Times New Roman';">Welcome Paul!</span> <span style="font-size: 8pt; color: blue; font-family: 'Times New Roman'; text-decoration: underline">Logout</span> |
| </div> |
| <div id="master_header_right"> |
| <asp:SiteMapPath ID="SiteMapPath1" runat="server" CssClass="Breadcrumb" PathSeparator=" : " > |
| <PathSeparatorStyle Font-Bold="True" ForeColor="#FFFFFF" /> |
| <CurrentNodeStyle ForeColor="#FFFFFF" /> |
| <NodeStyle Font-Bold="True" ForeColor="#FFFFFF" CssClass="Breadcrumb" /> |
| <RootNodeStyle Font-Bold="True" ForeColor="#FFFFFF" CssClass="Breadcrumb" /> |
| </asp:SiteMapPath> |
| </div> |
| </div> |
| <div id="master_middle"> |
| <telerik:RadSplitter id="RadSplitter1" runat="server" Height="100%" Width="1500px" VisibleDuringInit="false" ResizeMode="EndPane" ResizeWithParentPane="true" ResizeWithBrowserWindow="true" Skin="Office2007"> |
| <telerik:RadPane id="Radpane1" runat="server" Width="22px" Scrolling="None" Height="800px"> |
| <telerik:RadSlidingZone id="SlidingZone1" runat="server" width="22px" DockedPaneId="Nav" ExpandedPaneId="Nav" SlideDirection="Right"> |
| <telerik:RadSlidingPane id="Nav" Height="800px" title="Navigation" runat="server" Width="173px" Scrolling="Both" CssClass="slideContainer"> |
| <telerik:RadAjaxPanel ID="NavRadAjaxPanel" runat="server"> |
| <div> |
| <div style="float:right; padding-right:2px;"> |
| <asp:LinkButton ID="lnkbtnExpandAll" runat="server" CssClass="TreeNodeLinkButton" OnClick="lnkbtnExpandAll_Click">Expand All</asp:LinkButton> |
| <asp:LinkButton ID="lnkbtnCollapseAll" runat="server" CssClass="TreeNodeLinkButton" OnClick="lnkbtnCollapseAll_Click">Collapse All</asp:LinkButton> |
| </div> |
| <div style="clear:both; overflow:hidden;"> |
| <telerik:RadTreeView ID="RadTreeView1" runat="server" DataSourceID="SiteMapDS" DataFieldID="Title" DataNavigateUrlField="Url" DataTextField="Title" SingleExpandPath="False" CssClass="TreeNode" Width="100%" style="white-space:normal;" BackColor="White" Font-Size="8pt" Skin="Outlook"> |
| <CollapseAnimation Duration="100" Type="OutQuint" /> |
| <ExpandAnimation Duration="100" /> |
| </telerik:RadTreeView> |
| </div> |
| </div> |
| </telerik:RadAjaxPanel> |
| </telerik:RadSlidingPane> |
| </telerik:RadSlidingZone> |
| </telerik:RadPane> |
| <telerik:RadSplitBar id="Radsplitbar3" runat="server" CollapseMode="Forward" /> |
| <telerik:RadPane ID="MasterPageRadContentPane" runat="server" MinHeight="1000" MinWidth="800" Scrolling="None"> |
| <div id="master_contenttitle"> |
| <asp:Label ID="lblContentTitle" runat="server" Font-Bold="True" Font-Size="12pt"></asp:Label> |
| </div> |
| <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"> |
| </asp:ContentPlaceHolder> |
| </telerik:RadPane> |
| </telerik:RadSplitter> |
| </div> |
| <div id="master_footer"> |
| Copyright CGI 2008 |
| </div> |
| </div> |
| <asp:SiteMapDataSource ID="SiteMapDS" runat="server" SiteMapProvider="REACHSiteMap" /> |
| </form> |
| </body> |
| </html> |
| body, p, h1, h2, h3, h4, table |
| { |
| font-size:10pt; |
| font-family:Tahoma, Arial; |
| margin:0; |
| padding:0; |
| border:none; |
| } |
| body |
| { |
| /*background: #B4B4B4 url(images/body_bg.gif) repeat left top;*/ |
| height:100%; |
| width:100%; |
| font-size:10pt; |
| font-family:Arial; |
| } |
| #master_page |
| { |
| height:100%; |
| } |
| /* Header Layout */ |
| #master_header_top |
| { |
| background-color: #110E93; |
| width:100%; |
| border-bottom:solid 1px Gray; |
| } |
| #master_header_left |
| { |
| height:100%; |
| width:250px; |
| float:left; |
| } |
| #master_icon |
| { |
| clear:both; |
| width: 100%; |
| height: 55px; |
| background-color:White; |
| } |
| #master_header |
| { |
| background-color: #C8D6E6; |
| } |
| #master_header_right |
| { |
| padding-top: 3px; |
| height: 22px; |
| padding-bottom: 0px; |
| } |
| #master_header_right_top |
| { |
| width:100%; |
| height:55px; |
| background-color:White; |
| } |
| #master_login |
| { |
| background-color: #C8D6E6; |
| padding-top:2px; |
| padding-left:5px; |
| width: 200px; |
| height:22px; |
| float:left; |
| clear:both; |
| } |
| /* Middle Section Layout */ |
| #master_middle |
| { |
| } |
| #master_menu |
| { |
| /*float:left;*/ |
| } |
| .master_contentbody |
| { |
| } |
| #master_contenttitle |
| { |
| width:70%; |
| margin-left:10px; |
| border-bottom: solid 2px #888888; |
| } |
| /* Footer */ |
| #master_footer |
| { |
| background-color: #110E93; |
| font-size:8pt; |
| width:100%; |
| height:18px; |
| padding-top:2px; |
| padding-left:45%; |
| clear:both; |
| color:White; |
| } |
| /* Tree style RadGrid styles */ |
| .OutlookTopBar |
| { |
| background-color: white; |
| background-repeat: repeat-x; |
| padding-top: 3px; |
| border: 1px solid #002D96; |
| width: 180px; |
| font-size: 11px; |
| padding-left: 4px; |
| } |
| .TreeviewGrid Table |
| { |
| margin-top: 7px; |
| border:0px; |
| } |
| .TreeviewGrid a |
| { |
| color: #000000; |
| text-decoration: underline; |
| } |
| .TreeviewGrid td |
| { |
| font-size: 11px; |
| border:0px; |
| } |
| .SelectedFolder |
| { |
| font-weight: bold; |
| } |
| .OutlookTable |
| { |
| background-color:#c4dafa; |
| margin-top:4px; |
| } |
| .MailSubject |
| { |
| color: #808080; |
| } |
| .SelectedRow_Outlook .MailSubject |
| { |
| color: white; |
| } |
| /* Styles for the Treeview on the master page */ |
| .TreeMenu |
| { |
| font-family:Arial; |
| background-color:White; |
| color:#678CB9; |
| width:210px; |
| } |
| .TreeNodeLinkButton |
| { |
| color:#15428B; |
| text-decoration:none; |
| font-size:7pt; |
| } |
| .TreeNode |
| { |
| color:#15428b; |
| } |
| .TreeNode a |
| { |
| color:#15428b; |
| background-color:White; |
| } |
| .TreeNode a:visited |
| { |
| color:#15428b; |
| background-color:White; |
| } |
| .TreeNode a:hover |
| { |
| text-decoration:none; |
| color:Red; |
| background-color:White; |
| } |
| .TreeNode a:active |
| { |
| color:Red; |
| background-color:White; |
| } |
| .slideContainer { |
| border:0px solid #073b96; |
| border-collapse:collapse; |
| background-color:White; |
| } |
| #master_content |
| { |
| width:100%; |
| height:80%; |
| float:left; |
| clear:both; |
| margin-left:10px; |
| } |
| .master_menu |
| { |
| } |
| div.menuTables |
| { |
| font-size:10pt; |
| font-family:Arial; |
| font-weight:bold; |
| } |
| table.menuTables |
| { |
| margin-left:20px; |
| margin-top:20px; |
| border:0; |
| } |
| table.menuTables td |
| { |
| width:615px; |
| } |
| table.useHeaderMenu |
| { |
| margin-left:10px; |
| } |
| table.useHeaderMenu td |
| { |
| vertical-align:top; |
| font-size:7pt; |
| } |
| table.useHeaderMenu a |
| { |
| text-decoration:none; |
| } |
| table.formFields |
| { |
| } |
| .collapsible |
| { |
| font-size:8pt; |
| font-family:Arial; |
| vertical-align:middle; |
| margin-top:10px; |
| margin-left:10px; |
| margin-bottom:10px; |
| margin-right:10px; |
| whitewhite-space: normal !important; |
| } |
| .collapsible img.handle |
| { |
| text-align:rightright; |
| MARGIN-TOP: 5px; |
| margin-right:20px; |
| margin-left:300px; |
| position:relative; |
| } |
| .invisible |
| { |
| display:none; |
| visibility:hidden; |
| } |
| .visible |
| { |
| visibility:visible; |
| } |
| .TabStrip |
| { |
| border:solid 1px Gray; |
| } |
| .PageView |
| { |
| vertical-align:middle; |
| padding-top:10px; |
| margin-left:10px; |
| margin-bottom:10px; |
| margin-right:10px; |
| whitewhite-space: normal !important; |
| } |
| .Breadcrumb |
| { |
| font:bold 11px Arial, Verdana, Sans-serif; |
| padding-left: 5px; |
| margin-top: 2px; |
| } |
| .Breadcrumb a |
| { |
| text-decoration:none; |
| } |
| .Breadcrumb a:hover |
| { |
| text-decoration:underline; |
| } |
| ThresholdLabel |
| { |
| font-weight:bold; |
| } |

Using Q2, whenever I place a basic RadUpload control into a DIV that have "position: relative" in the style, the Select button will not open the Choose File dialog.
This happens on Vista x64 IE 7 (7.0.6000.16681). Here is the code (there is no other code except this in the page.
<div style="position: relative;">
<
Telerik:RadUpload ID="TelerikUpload" InputSize="60" Skin="Vista" InitialFileInputsCount="1" MaxFileInputsCount="1" ControlObjectsVisibility="None" runat="server" />
</
div>

If I have radpanel control and am using radgrid inside a radpanelitem, I have to reference the radgrid as such, to get a reference:
Telerik.Web.UI.
RadGrid gvSiteRef = (Telerik.Web.UI.RadGrid)RadPanelBar1.FindItemByValue(PANEL_SITE_HEADER).FindControl("gvSite");
That is correct right???
So, how do I use grid events now since 'eventargs' param won't work since I can't directly reference the grid anymore (since its in a radpanel)?:
protected
void gvSite_ColumnCreated(object sender, gvSiteColumnCreatedEventArgs e)
{
.....
}
Thanks for help..