or
<%@ Page Title="" Language="C#" MasterPageFile="~/Default.Master" AutoEventWireup="true" CodeBehind="BulkLoad.aspx.cs" Inherits="MyProject.WebApp.BulkLoad" %><%@ Register TagPrefix="rad" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %><%@ Register Src="~/Controls/BulkUploadControl.ascx" TagName="BulkUpload" TagPrefix="cag" %><%@ Register Src="~/Controls/BulkUploadAuditControl.ascx" TagName="BulkUploadAudit" TagPrefix="cag" %><asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="BottomPane" runat="server"> <br /> <div class="level2_tabstrip"> <rad:RadTabStrip RegisterWithScriptManager="true" AutoPostBack="True" SelectedIndex="1" MultiPageID="RadMultiPage1" ID="rtsBulkLoad" runat="server" Skin="WebBlue"> <Tabs> <rad:RadTab Text="Upload" PageViewID="Upload" Selected="True"> </rad:RadTab> <rad:RadTab Text="Audit" PageViewID="Audit"> </rad:RadTab> </Tabs> </rad:RadTabStrip> </div> <div class="level2_content"> <rad:RadMultiPage RenderSelectedPageOnly="true" ID="RadMultiPage1" runat="server" SelectedIndex="1" Width="900"> <rad:RadPageView ID="Upload" runat="server" Selected="true"> <cag:BulkUpload runat="server" ID="BulkUpload1" BatchTypeDesc="" /> </rad:RadPageView> <rad:RadPageView ID="Audit" runat="server"> <cag:BulkUploadAudit runat="server" ID="BulkUploadAudit1" BatchTypeDesc="" /> </rad:RadPageView> </rad:RadMultiPage> </div></asp:Content><%@ Control Language="C#" AutoEventWireup="true" CodeBehind="BulkUploadControl.ascx.cs" Inherits="Myproject.WebApp.Controls.BulkUploadControl" %><%@ Register TagPrefix="rad" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %><script language='javascript' type='text/javascript'> function showLoading() { document.getElementById('blackOut').style.display = 'block'; document.getElementById('blackOut').style.height = '500px'; document.getElementById('blackOut').style.width = '942px'; }</script><rad:RadWindowManager ID="RadWindowManager1" runat="server" /><asp:Panel runat="server" ID="pnlAccessDenied" Visible="true"> You do not have permission for this function</asp:Panel><asp:Panel runat="server" ID="pnlAccessOk" Visible="false"> <br /> <asp:Label ID="lblTitle" Font-Bold="True" Font-Size="X-Large" runat="server" Font-Names="Arial"></asp:Label> <br /> <br /> <asp:Label ID="lblText" Font-Bold="False" Font-Size="Small" runat="server" Font-Names="Arial"></asp:Label> <br /> <br /> <div id="blackOut" style="display: none; z-index: 1000000; position: absolute; background-color: black; filter: alpha(opacity=70); -moz-opacity: 0.7; opacity: 0.7; top: -300px; left: -10px; height: 1000px; width: 1500px;"> <table width="1000px" style="height:1000px;"> <tr> <td align="center" valign="middle" > <h2 style="color: White; font-weight: bold"> Processing...</h2> </td> </tr> </table> </div> <table width="850" border="0" cellspacing="0" cellpadding="10" class="table_grid"> <tr> <td> <b>Upload</b> </td> <td> <asp:Label runat="server" ID="lblReportingPeriodStatus" ForeColor="Red" Visible="false"></asp:Label> </td> </tr> <tr> <td colspan="100%"> <input class="textbox" size="100" type="file" id="File1" runat="server" name="File1" /> <asp:Button ID="buttonSubmit" class="button" runat="server" OnClick="btnSubmit_OnClick" OnClientClick="showLoading();" Text="Upload" Height="23px" /> <br /> <br /> <table width="850" class="table_grid3"> <tr> <td width="200"> Local Path </td> <td class="td_clear"> <asp:Label runat="server" ID="lblLocalPath"></asp:Label> </td> </tr> <tr> <td> Batch ID </td> <td class="td_clear"> <asp:Label runat="server" ID="lblBatchID"></asp:Label> </td> </tr> <tr> <td> Loaded to Staging </td> <td class="td_clear"> <asp:Image ID="Image2a" runat="server" ImageUrl="~/Images/gtick01.gif" Visible="false" /> <asp:Image ID="Image2b" runat="server" ImageUrl="~/Images/gcross01.gif" Visible="false" /> </td> </tr> <tr> <td> Status Message </td> <td class="td_clear"> <asp:Label runat="server" ID="lblStatusMessage"></asp:Label> </td> </tr> </table> <asp:Label runat="server" ID="lblSaveResults"></asp:Label><br /> <asp:Label runat="server" ID="lblLoadResults"></asp:Label><br /> </td> </tr> </table> <br /> <rad:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" AllowAutomaticDeletes="false" AllowAutomaticInserts="false" AllowAutomaticUpdates="false" OnItemDataBound="RadGrid1_ItemDataBound" EnableAJAX="True" Width="850px" AllowPaging="True" PageSize="50" Skin="WebBlue" Visible="false"> <PagerStyle AlwaysVisible="true" Mode="NumericPages" /> <SelectedItemStyle CssClass="selectedItem" /> <EditItemStyle CssClass="selectedItem" /> <ExportSettings IgnorePaging="true" /> <MasterTableView CommandItemDisplay="Top" GridLines="Horizontal" EditMode="EditForms" TableLayout="Auto" AutoGenerateColumns="False"> <CommandItemSettings ShowExportToCsvButton="true" /> <Columns> <rad:GridBoundColumn Visible="false" UniqueName="field1" HeaderText="field1" DataField="field1" /> <rad:GridBoundColumn HeaderStyle-Width="50px" UniqueName="Row" HeaderText="Row" DataField="Row" /> <rad:GridBoundColumn HeaderStyle-Width="50px" UniqueName="Column" HeaderText="Column" DataField="Column" /> <rad:GridBoundColumn HeaderStyle-Width="100px" UniqueName="ColumnName" HeaderText="Column Name" DataField="columnName" /> <rad:GridBoundColumn HeaderStyle-Width="100px" UniqueName="ColumnType" HeaderText="Column Type Expected" DataField="columnType" /> <rad:GridBoundColumn HeaderStyle-Width="100px" UniqueName="ColumnValue" HeaderText="Column Value" DataField="columnValue" /> <rad:GridBoundColumn UniqueName="ErrorText" HeaderText="Error" DataField="ErrorText" /> </Columns> </MasterTableView> </rad:RadGrid></asp:Panel>
function returnValue(){ //get the RadComboBox's selected item's text var combo = $find("<%= RadComboBox1.ClientID %>"); var selectedCapital = combo.get_text(); //Get a reference to the parent page (Default.aspx) var oWnd = GetRadWindow(); //get a reference to the second RadWindow var dialog1 = oWnd.get_windowManager().getWindowByName("RadWindow1"); // Get a reference to the first RadWindow's content var contentWin = dialog1.get_contentFrame().contentWindow //Call the predefined function in Dialog1 contentWin.populateCityName(selectedCapital); //Close the second RadWindow oWnd.close();}contentWin.populateCityName(selectedCapital);contentWin.document.getElementById("cityName").value = "hello";<telerik:RadDataPagerTemplatePageField> <PagerTemplate> <asp:DropDownList ID="DropDownList1" runat="server"> </asp:DropDownList> <asp:Label ID="lblTimeAmount" runat="server" Text="..." ></asp:Label> </PagerTemplate> </telerik:RadDataPagerTemplatePageField>protected void Page_Load(object sender, EventArgs e) { //How to Get or Set Control's Value to Any in DropDownList1 or lblTimeAmount }<telerik:RadToolBarButton runat="server" Text="SearchBox"> <ItemTemplate> <telerik:RadComboBox ID="RadComboBox1" Runat="server"> <Items> <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem1" Value="RadComboBoxItem1" /> <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem2" Value="RadComboBoxItem2" /> <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem3" Value="RadComboBoxItem3" /> </Items> </telerik:RadComboBox> </ItemTemplate> </telerik:RadToolBarButton> <telerik:RadToolBarButton runat="server" Text="SearchCount"> <ItemTemplate> <asp:Label ID="lblTimeAmount" runat="server" Text="..." ></asp:Label> </ItemTemplate> </telerik:RadToolBarButton>protected void Page_Load(object sender, EventArgs e) { //How to Get or Set Control's Value to Any in DropDownList1 or lblTimeAmount }Hi there,
Thanking you for very quick responses,
What I am trying to do is for a grid
1. add template columns to the grid
2. display the grid in edit mode
3. when click "save all", update all edited rows
What I did
for 1
| GridTemplateColumn assResult = new GridTemplateColumn(); |
| this.RadGridGradingBatchEntry.MasterTableView.Columns.Add(assResult); |
| assResult.DataField = "UniqueDateField"; |
| assResult.UniqueName = "UniqueDateField"; |
| assResult.SortExpression = "UniqueDateField"; |
| assResult.HeaderText = "UniqueDateField"; |
| assResult.SortExpression = "UniqueDateField"; |
| assResult.DataType = System.Type.GetType("System.Int32"); |
| assResult.Resizable = true; |
| assResult.ItemStyle.Wrap = true; |
| assResult.ItemStyle.Width = 15; |
| assResult.ItemTemplate = new MyTemplate() // Mytemplate returns implements Itemplate and I created this class according to one of forums I found here. |
for 2
| protected void RadGridGradingBatchEntry_PreRender(object sender, System.EventArgs e) |
| { |
| foreach (GridDataItem item in RadGridGradingBatchEntry.Items) |
| { |
| item.Edit = true; |
| RadGridGradingBatchEntry.Rebind(); |
| } |
| } |
for 3
| protected override void RaisePostBackEvent(IPostBackEventHandler source, string eventArgument) |
| { |
| base.RaisePostBackEvent(source, eventArgument); |
| if (source is RadGrid) |
| { |
| string[] postBackEventArgumentData = eventArgument.Split(':'); |
| switch (postBackEventArgumentData[0]) |
| { |
| case "SaveAll": |
| foreach (string l_EachItem in postBackEventArgumentData[1].Split(',')) |
| { |
| if (!(l_EachItem == "")) |
| { |
| GridItem item = (GridItem)((Table)RadGridGradingBatchEntry.MasterTableView.Controls[0]).Rows[int.Parse(l_EachItem)]; |
| GridEditableItem editedItem = (GridEditableItem)item; |
| Hashtable newnewValues = new Hashtable(); |
| item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem); |
| } |
| } |
| break; |
| } |
| } |
| } |
Now problem is that when I look up newValues, all dynamically created columns are not visible but only columns that have been specified as bound column are available to access.
Your help will be appreciated as always,
Toby