| <telerik:RadListView ID="AListGrid" runat="server" AllowPaging="true" PageSize="10" |
| AllowCustomPaging="True" ItemPlaceholderID="PropertiesContianer"> |
| <LayoutTemplate> |
| <fieldset id="RadListView1"> |
| <div class="proGridTopPager"> |
| <telerik:RadDataPager ID="RadDataPager2" runat="server" Style="border: none;" SkinID="ListViewSkin" |
| AllowSEOPaging="true" SEOPagingQueryPageKey="Page"> |
| <Fields> |
| <telerik:RadDataPagerButtonField FieldType="FirstPrev" /> |
| <telerik:RadDataPagerButtonField FieldType="Numeric" /> |
| <telerik:RadDataPagerButtonField FieldType="NextLast" /> |
| </Fields> |
| </telerik:RadDataPager> |
| </div> |
| <asp:PlaceHolder ID="PropertiesContianer" runat="server" /> |
| <telerik:RadDataPager ID="RadDataPager1" runat="server" Style="border: none;" SkinID="ListViewSkin" |
| AllowSEOPaging="true" SEOPagingQueryPageKey="Page"> |
| <Fields> |
| <telerik:RadDataPagerButtonField FieldType="FirstPrev" /> |
| <telerik:RadDataPagerButtonField FieldType="Numeric" /> |
| <telerik:RadDataPagerButtonField FieldType="NextLast" /> |
| </Fields> |
| </telerik:RadDataPager> |
| </fieldset> |
| </LayoutTemplate> |
| <ItemTemplate> |
| <osl:descContent ID="lbltest" runat="server" Text="" /> |
| </ItemTemplate> |
| </telerik:RadListView> |
| Private Sub AListGrid_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadListViewItemEventArgs) Handles AListGrid.ItemDataBound |
| If (TypeOf (e.Item) Is RadListViewDataItem) Then |
| Dim dataBoundItem = DirectCast(e.Item, RadListViewDataItem) |
| Dim atest = DirectCast(dataBoundItem.FindControl("lbltest"), descContent) |
| atest.Text = "test" |
| End If |
| End Sub |
I have a page that has a RadWindowManager on it.
I have a button on that page and below is the code in the Click event of that button.
It opens the page EmailSend.aspx in a RadWindow.
RadWindow window = new RadWindow();
window.ID = "EmailSend";
window.NavigateUrl = "/EmailSend.aspx";
window.VisibleOnPageLoad = true;
window.Behaviors = Telerik.Web.UI.WindowBehaviors.Close;
window.Height = 800;
window.Width = 960;
RadWindowManager1.VisibleOnPageLoad = true;
window.Title = "Email Release";
RadWindowManager1.Windows.Add(window);
Page EmailSend.aspx is a form the user types all the information into that they want emailed.
When the user clicks the Send Button on this form, I have code that inserts the email information into the database.
After this code executes, I have the following line: (I want the window to close when the User clicks Send)
ScriptManager.RegisterStartupScript(this, GetType(), "EmailSend", "CloseRadWindow();", true);
In the Source of EmailSend.aspx, I have the following in the Send button.
<asp:Button ID="btnSend" runat="server" Text="Send" OnClick="btnSend_Click" OnClientClick="CloseWnd();return false;" />
I also have the following function in the Source of EmailSend.aspx
<script type="text/javascript">
function GetRadWindow() {
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow;
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
return oWindow;
}
function CloseWnd() {
GetRadWindow().close();
}
</script>
This kind of works but I must be missing something. I read that RadWindows don't close, they just hide themselves. I think this is the problem I am having. The first time I click the button that opens EmailSend.aspx in a RadWindow, I click Send and it runs my code and closes. If I open it a second time, I have to click Send twice for it to close. If I open it a third time, i have to click Send three times for it to close. What am I doing wrong?????
How do display multiple columns in the load by demand example?
The following code from the multi-col does not display the data.
Do I have to bind the datatable to the combox for this to work.
It seems the databinding to the radcombo takes a while.. thanks in advance.
<
HeaderTemplate>
<table style="width: 100%; text-align: left">
<tr>
<td style="width: 125px;">
Company Name
</td>
<td style="width: 125px;">
City
</td>
<td style="width: 125px;">
Title
</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table style="width: 100%; text-align: left">
<tr>
<td style="width: 125px;">
<%
# DataBinder.Eval(Container.DataItem, "CompanyName") %>
</td>
<td style="width: 125px;">
<%
# DataBinder.Eval(Container.DataItem, "City") %>
</td>
<td style="width: 125px;">
<%
# DataBinder.Eval(Container.DataItem, "ContactTitle") %>
</td>
</tr>
</table>
</ItemTemplate>
| <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="RadAjaxManagerProxy1"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="ARGrid1" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| <telerik:AjaxSetting AjaxControlID="rcbCodeList"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="rcbListType" |
| LoadingPanelID="RadAjaxLoadingPanel1" /> |
| <telerik:AjaxUpdatedControl ControlID="rtbCode" /> |
| <telerik:AjaxUpdatedControl ControlID="btnAddCode" /> |
| <telerik:AjaxUpdatedControl ControlID="rlbCodes" |
| LoadingPanelID="RadAjaxLoadingPanel1" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| <telerik:AjaxSetting AjaxControlID="rcbListType"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="rtbCode" /> |
| <telerik:AjaxUpdatedControl ControlID="btnAddCode" /> |
| <telerik:AjaxUpdatedControl ControlID="rlbCodes" |
| LoadingPanelID="RadAjaxLoadingPanel1" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| <telerik:AjaxSetting AjaxControlID="btnAddCode"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="rtbCode" |
| LoadingPanelID="RadAjaxLoadingPanel1" /> |
| <telerik:AjaxUpdatedControl ControlID="rlbCodes" |
| LoadingPanelID="RadAjaxLoadingPanel1" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| <telerik:AjaxSetting AjaxControlID="ARGrid1"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="ARGrid1" |
| LoadingPanelID="RadAjaxLoadingPanel1" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManagerProxy> |
| <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default"> |
| </telerik:RadAjaxLoadingPanel> |
| <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> |
| </telerik:RadCodeBlock> |
| <script type="text/javascript"> |
| function ClientResized(sender, eventArgs) { |
| alert('in resize'); |
| var test = $find("<%= RadAjaxManagerProxy1.ClientID %>"); |
| alert('found proxy'); |
| $find("<%= RadAjaxManagerProxy1.ClientID %>").ajaxRequest('ChangePageSize'); |
| alert('changed size'); |
| // if ($find("<%= RadAjaxManagerProxy1.ClientID %>").visible) |
| // { |
| //$find("<%= RadAjaxManagerProxy1.ClientID %>").ajaxRequest('ChangePageSize'); |
| //} |
| } |
| </script>
<telerik:RadPane ID="gridPane" runat="server" Height="400px" Scrolling="None" OnClientResized="ClientResized">
<table border="0" width="986px" cellpadding="0" cellspacing="0" style="background-color:White;table-layout:fixed">
<tr valign="top">
<td width="15px"><img src="images/spacer.gif" width="15px" alt="" /></td>
<td style="height:400px;">
<table border="0" cellpadding="0" cellspacing="0" width="986px" style="background-color:White;table-layout:fixed" >
<tr>
<td>
<telerik:RadGrid ID="ARGrid1" runat="server" Width="95%" GridLines="None"
PageSize="50" AllowSorting="True" AllowPaging="True" Visible="false"
OnNeedDataSource="ARGrid1_NeedDataSource" ShowStatusBar="true" ShowGroupPanel="true" Skin="Outlook" >
<MasterTableView AllowFilteringByColumn="true" AllowMultiColumnSorting="true" Width="100%" CommandItemDisplay="None" AutoGenerateColumns="true">
<Columns>
</Columns>
</MasterTableView>
<ClientSettings AllowColumnsReorder="true" AllowDragToGroup="true" ColumnsReorderMethod="Reorder" >
<Scrolling AllowScroll="true" UseStaticHeaders="true" SaveScrollPosition="false" FrozenColumnsCount="1" ScrollHeight="100%" />
<Resizing ClipCellContentOnResize="false" AllowColumnResize="true" />
</ClientSettings>
<GroupingSettings ShowUnGroupButton="true" />
</telerik:RadGrid>
</td>
</tr>
</table>
</td>
</tr>
</table>
</telerik:RadPane>
|
| protected void RadAjaxManagerProxy1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e) |
| { |
| switch (e.Argument.ToString()) |
| { |
| case "ChangePageSize": |
| //Calculate the number of rows that fit in the RadPane. |
| //In this case 23 is the sum of the height of a single row and its upper border width. |
| //Depending on the paticular scenario this value may vary. |
| int rows = (Int32.Parse(this.gridPane.Height.Value.ToString()) - 60) / 23; |
| if (rows >= 1) |
| { |
| ARGrid1.PageSize = rows; |
| // Check whether the CurrentPageIndex is correct. |
| if (Session["itemsCount"] != null) |
| { |
| int itemsCount = (int)Session["itemsCount"]; |
| int pageCount = (int)Math.Ceiling(((double)itemsCount / rows)); |
| if (ARGrid1.MasterTableView.CurrentPageIndex > pageCount - 1) |
| { |
| ARGrid1.MasterTableView.CurrentPageIndex = pageCount - 1; |
| } |
| } |
| ARGrid1.Rebind(); |
| } |
| break; |
| } |
| } |
| public string RadGrid1PanelClientID; |
| protected void RadAjaxManagerProxy1_AjaxSettingCreated(object sender, AjaxSettingCreatedEventArgs e) |
| { |
| if (e.Initiator.ID == "ARGrid1") |
| { |
| this.RadGrid1PanelClientID = e.UpdatePanel.ClientID; |
| } |
| } |
| <telerik:RadGrid ID="RadGrid1" runat="server" |
| GridLines="None" AutoGenerateColumns="False" PageSize="20" |
| MasterTableView-Width="100%" |
| OnDetailTableDataBind="URLGrid_DetailTableDataBind" |
| Visible="True"> |
| <MasterTableView ItemStyle-Width="100%" NoMasterRecordsText="No Results Found" |
| NoDetailRecordsText="No ResultsFound" Visible="true" |
| datakeynames="SubmissionGroupID" ExpandCollapseColumn-ItemStyle-BackColor="#CCCCCC"> |
| <DetailTables> |
| <telerik:GridTableView DataKeyNames="SubmissionID" runat="server" Width="100%" Name="caseURLs"> |
| <DetailTables> |
| <telerik:GridTableView runat="server" Name="caseDetails"> |
| <expandcollapsecolumn visible="True"> |
| </expandcollapsecolumn> |
| <ParentTableRelation> |
| <telerik:GridRelationFields DetailKeyField="SubmissionID" MasterKeyField="SubmissionID" /> |
| </ParentTableRelation> |
| <Columns> |
| <telerik:GridBoundColumn DataField="SubmissionID" Visible="false"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn AllowSorting="false" DataField="SubmissionID" |
| HeaderText="ID" ShowSortIcon="false" UniqueName="column"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| </telerik:GridTableView> |
| </DetailTables> |
| <expandcollapsecolumn visible="True"></expandcollapsecolumn> |
| <Columns> |
| <telerik:GridBoundColumn AllowSorting="false" DataField="SubmissionID" |
| HeaderText="ID" ShowSortIcon="false" UniqueName="column"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn AllowSorting="false" DataField="AbsoluteUrl" |
| HeaderText="URL" ShowSortIcon="false" UniqueName="column"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| </telerik:GridTableView> |
| </DetailTables> |
| <expandcollapsecolumn visible="True"> |
| </expandcollapsecolumn> |
| <Columns> |
| <telerik:GridBoundColumn AllowSorting="false" DataField="SubmissionGroupID" |
| HeaderText="Group" ShowSortIcon="false" UniqueName="column"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn AllowSorting="false" DataField="Baseline" |
| HeaderText="Baseline" ShowSortIcon="false" UniqueName="column"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn AllowSorting="false" DataField="Description" |
| HeaderText="Description" ShowSortIcon="false" UniqueName="column"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| <NoRecordsTemplate><div align="center">No Results Found</div></NoRecordsTemplate> |
| <expandcollapsecolumn visible="True"> |
| <ItemStyle BackColor="#CCCCCC" /> |
| </expandcollapsecolumn> |
| <ItemStyle Width="100%" /> |
| </MasterTableView> |
| </telerik:RadGrid> |
| protected void URLGrid_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e) |
| { |
| GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; |
| switch (e.DetailTableView.Name) { |
| case "caseURLs": { |
| int groupID = (int)dataItem.GetDataKeyValue("SubmissionGroupID"); |
| submissionView = WebServiceClient.GetSubmissions(groupID); |
| e.DetailTableView.DataSource = submissionView; |
| break; |
| } |
| case "caseDetails": { |
| int detailsID = (int)dataItem.GetDataKeyValue("SubmissionID"); |
| submissionResults = WebServiceClient.GetSubmissionResults(detailsID, ResultType.Passed); |
| e.DetailTableView.DataSource = submissionResults; |
| break; |
| } |
| } |
| } |
