<telerik:RadGrid runat="server" Skin="360Core" EnableEmbeddedSkins="false" ></telerik:RadGrid>
Hello.
I have a problem with RadAutoCompleteBox.EntryAdded server event. I created a user control (.ascx) called PeopleAndMachinesPicker with RadAutoCompleteBox (InputType="Token") in it.
RadAutoCompleteBox causes full page postback when server-side EntryAdded event handler is set. I tried to wrap my PeopleAndMachinesPicker control with UpdatePanel, but it causes JavaScript error:
"Microsoft JScript runtime error: Sys.InvalidOperationException: Two components with the same id 'PeopleAndMachinesPicker1_RadAutoCompleteBox2' can't be added to the application."
How can I process server-side EntryAdded event without full page postback? I tried __doPostBack() to update other controls on the page on ClientEntryAdded javascript event handler, but it's not suitable for my PeopleAndMachinesPicker control isolation.
Browser used: IE9 (9.0.8112.16421) 64 bit
Telerik.Web.UI assembly version: 2012.2.1002.35

Imports System.DataImports Telerik.Web.UIPublic Class TestPage Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then Dim dt As New DataTable("MyData") Dim i As Integer = 1 dt.Columns.Add("Key", GetType(Integer)) dt.Columns.Add("Description", GetType(String)) Dim dr As DataRow = dt.NewRow dr("Key") = 1 dr("Description") = "My Data Row" dt.Rows.Add(dr) Me.MyList.DataSource = dt Me.MyList.DataBind() End If End Sub Public Sub MyList_ItemCommand(ByVal sender As Object, ByVal e As GridCommandEventArgs) If (e.CommandName = RadGrid.ExpandCollapseCommandName) Then If Not e.Item.Expanded Then AdjustPageAvailability(False) End If End If End Sub Public Sub MyList_ItemDataBound(ByVal sender As Object, ByVal e As GridItemEventArgs) If (TypeOf e.Item Is GridDataItem) Then Dim item = CType(e.Item, GridDataItem) Dim column = item("ExpandColumn") If (column IsNot Nothing) Then column.Controls(0).Visible = True End If End If End Sub Protected Sub Cancel_Click(ByVal sender As Object, ByVal e As EventArgs) For Each item As GridDataItem In MyList.Items If item.Expanded Then item.Expanded = False End If Next Me.AdjustPageAvailability(True) End Sub Protected Sub Save_Click(ByVal sender As Object, ByVal e As EventArgs) Page.Validate(CType(sender, IButtonControl).ValidationGroup) If (Not Page.IsValid) Then Return End If For Each item As GridDataItem In MyList.Items If item.Expanded Then item.Expanded = False End If Next Me.AdjustPageAvailability(True) End Sub Private Sub AdjustPageAvailability(ByVal visible As Boolean) Dim column As TableCell For Each item As GridDataItem In Me.MyList.Items column = item("ExpandColumn") If (column IsNot Nothing) Then column.Controls(0).Visible = visible End If Next End SubEnd Class<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="TestPage.aspx.vb" Inherits="Telerik2014Q2Issue.TestPage" %><!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"> <div> <tel:RadScriptManager ID="sm" runat="server" ClientIDMode="Static" > </tel:RadScriptManager> <tel:RadTabStrip ID="DetailsTabs" runat="server" SelectedIndex="0" MultiPageID="DetailsPages"> <Tabs> <tel:RadTab runat="server" Text="Details" /> <tel:RadTab runat="server" Text="History" /> </Tabs> </tel:RadTabStrip> <tel:RadMultiPage ID="DetailsPages" runat="server" SelectedIndex="0"> <tel:RadPageView ID="RadPageView1" runat="server"> <asp:Panel runat="server" ID="DetailsForm"> <h3>DEP Well Details</h3> <p> <tel:RadGrid ID="MyList" runat="server" OnItemDataBound="MyList_ItemDataBound" OnItemCommand="MyList_ItemCommand"> <MasterTableView AutoGenerateColumns="False" AllowPaging="False" AllowSorting="False" AllowCustomPaging="False" HierarchyLoadMode="ServerOnDemand" DataKeyNames="Key"> <Columns> <tel:GridBoundColumn HeaderText="Description" DataField="Description" /> </Columns> <NestedViewTemplate> <asp:Panel ID="Panel1" runat="server"> <h3>More Details</h3> <div> <asp:ValidationSummary ID="MyValidationSummary" runat="server" HeaderText="The following errors have occurred:" /> <table> <thead></thead> <tbody> <tr> <td> <tel:RadTextBox ID="txtNotes" runat="server" TextMode="MultiLine" Rows="4" Columns="60" CssClass="MultiLineTextBox" /> </td> </tr> <tr> <td> <asp:RequiredFieldValidator ID="NotesRequired" runat="server" ControlToValidate="txtNotes" Text="* Required" ErrorMessage="Please enter a something in the box." /> </td> </tr> </tbody> </table> </div> <div> <ul class="inline"> <li> <tel:RadButton ID="Save" runat="server" Text="Save" CausesValidation="true" OnClick="Save_Click" /> </li> <li> <tel:RadButton ID="Cancel" runat="server" Text="Cancel" CausesValidation="false" OnClick="Cancel_Click" /> </li> </ul> </div> </asp:Panel> </NestedViewTemplate> </MasterTableView> </tel:RadGrid> </p> </asp:Panel> </tel:RadPageView> <tel:RadPageView ID="RadPageView2" runat="server"> <div> <p>History</p> </div> </tel:RadPageView> </tel:RadMultiPage> </div> </form></body></html>
Hi-
In our project we need to provide functionality to print the RAD Grid, the printed output should support the following features
1. Print all records, not just the first page ignoring Pagination
2. Print output should preserve and show the layout changes applied to grid i.e. If user has grouped the data by one or more columns print output should show the grouping
3. Print output should not show the quick filters on the grid
4. Add custom header and footer both of which would have dynamic contents including page number
5. At beginning of every printed page column headers of the grid should be displayed followed by data
6. Change the look and feel to be suitable for printing- Apply different CSS for printing
7. Have the option export the printed output to a PDF document
I would appreciate any help on solving these requirements.
Thanks,
Steve
| <telerik:RadGrid ID="RadGrid1" runat="server" |
| AllowSorting="true" ShowGroupPanel="True" |
| OnNeedDataSource="RadGrid1_NeedDataSource" |
| AllowMultiRowSelection="false" |
| Skin="Vista" |
| > |
| <ClientSettings AllowDragToGroup="True" EnablePostBackOnRowClick="true"> |
| </ClientSettings> |
| <MasterTableView GroupLoadMode="Server" > |
| <GroupByExpressions> |
| <telerik:GridGroupByExpression> |
| <GroupByFields> |
| <telerik:GridGroupByField FieldName="Group" /> |
| </GroupByFields> |
| <SelectFields> |
| <telerik:GridGroupByField FieldName="Group" /> |
| </SelectFields> |
| </telerik:GridGroupByExpression> |
| </GroupByExpressions> |
| </MasterTableView> |
| </telerik:RadGrid> |
| <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /> |
| protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) |
| { |
| DataTable tbl = new DataTable(); |
| DataColumn col = new DataColumn("ID"); |
| col.DataType = typeof(int); |
| tbl.Columns.Add(col); |
| col = new DataColumn("Name"); |
| col.DataType = typeof(string); |
| tbl.Columns.Add(col); |
| col = new DataColumn("Group"); |
| col.DataType = typeof(string); |
| tbl.Columns.Add(col); |
| int size = 15; |
| int maxLen = size.ToString().Length; |
| for (int i = 1; i <= size; i++) |
| { |
| tbl.Rows.Add(new object[] { i, "Name" + i.ToString("D" + maxLen), "Group" + i % 5 }); |
| } |
| RadGrid1.DataSource = tbl; |
| } |
| protected void Button1_Click(object sender, EventArgs e) |
| { |
| /*RadGrid1.Rebind();*/ |
| } |