| <telerik:RadWindowManager |
| ID="RadWindowManager1" ShowContentDuringLoad="false" |
| VisibleStatusbar="false" ReloadOnShow="true" runat="server"> |
| <Windows> |
| <telerik:RadWindow ID="RadWindow1" Width="350px" Height="450px" Title="Choose Assignees" |
| Behaviors="Close" OnClientClose="OnClientClose" |
| NavigateUrl="/UserControls/ProposalTasks/PeoplePickerDialog.aspx" Modal="True"> |
| </telerik:RadWindow> |
| </Windows> |
| </telerik:RadWindowManager> |
| <telerik:GridTemplateColumn HeaderText="Assigned To" UniqueName="ASSIGNED_TO" |
| SortExpression="ASSIGNED_TO" DataField="ASSIGNED_TO"> |
| <EditItemTemplate> |
| <script type="text/javascript"> |
| registeredTbAssignedElements.push('<%# Container.FindControl("rtbAssigned").ClientID %>'); |
| </script> |
| <telerik:RadTextBox ID="rtbAssigned" runat="server" Rows="1" Columns="50" |
| Text='<%#Bind("ASSIGNED_TO")%>' TextMode="MultiLine" > |
| </telerik:RadTextBox> |
| <asp:Button ID="btnGetNames" runat="server" Text="^" /> |
| </EditItemTemplate> |
| <ItemTemplate> |
| <asp:Label ID="lblAssignees" runat="server" |
| Text='<%# Eval("ASSIGNED_TO") %>'></asp:Label> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <script type="text/javascript"> |
| //global DOM ID registry for our rtbAssigned control. filled up by scripts rendered from template fields. |
| var registeredTbAssignedElements = []; |
| // Rad Window functionality (for selecting assignees) |
| //<![CDATA[ |
| function openWin(radindex) { |
| var tbAssignedclientID = registeredTbAssignedElements[radindex]; |
| var currText = $get(tbAssignedclientID); |
| var oWnd = radopen("/UserControls/ProposalTasks/PeoplePickerDialog.aspx?rowIndex=" + radindex + "¤tText=" + currText.value, "RadWindow1"); |
| } |
| function OnClientClose(oWnd, args) { |
| //get the transferred arguments |
| var arg = args.get_argument(); |
| if (arg) { |
| var radIndex = arg.indexID; |
| var assignees = arg.assignees; |
| var existingAssignees = $find(registeredTbAssignedElements[radIndex]); |
| existingAssignees.set_value(assignees); |
| } |
| } |
| //]]> |
| </script> |
| <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PeoplePickerDialog.aspx.cs" Inherits="Proposal_Tasks.UserControls.ProposalTasks.PeoplePickerDialog" %> |
| <%@ 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" > |
| <script type="text/javascript"> |
| function GetCurrentItemRequesting(sender, eventArgs) { |
| var context = eventArgs.get_context(); |
| context["FilterString"] = eventArgs.get_text(); |
| } |
| function GetRadWindow() { |
| var oWindow = null; |
| if (window.radWindow) oWindow = window.radWindow; |
| else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; |
| return oWindow; |
| } |
| function returnToParent() { |
| //create the argument that will be returned to the parent page |
| var oArg = new Object(); |
| // get the Row ID |
| var textRowID = document.getElementById('txtRowID'); |
| //get the names |
| var textbox = document.getElementById("<%=rtbStart.ClientID %>"); |
| oArg.indexID = textRowID.value; |
| oArg.assignees = textbox.value; |
| //get a reference to the current RadWindow |
| var oWnd = GetRadWindow(); |
| //Close the RadWindow and send the argument to the parent page |
| if (oArg.assignees) { |
| oWnd.close(oArg); |
| } |
| } |
| </script> |
| <head runat="server"> |
| <title></title> |
| </head> |
| <body > |
| <form id="form1" runat="server"> |
| <telerik:RadScriptManager ID="RadScriptManager1" Runat="server"> |
| </telerik:RadScriptManager> |
| <telerik:RadFormDecorator ID="RadFormDecorator1" Runat="server" /> |
| <fieldset id="fld1" > |
| <legend style="text-align:center" >Choose Assignees</legend> |
| <div style="margin: 5px 0 10px 0px; text-align:center;" > |
| <telerik:RadTextBox ID="rtbStart" runat="server" Rows="3" Columns="35" |
| TextMode="MultiLine" > |
| </telerik:RadTextBox> |
| <telerik:RadComboBox ID="rcbAssigned" Runat="server" AccessibilityMode="True" |
| Width="250px" MaxHeight="225px" ShowMoreResultsBox="True" EnableLoadOnDemand="True" |
| OnSelectedIndexChanged="rcbAssigned_SelectedIndexChanged" |
| OnClientItemsRequesting="GetCurrentItemRequesting" |
| AutoPostBack="True" > |
| <WebServiceSettings Method="ListADUsers" Path="/UserControls/WebServices/WSADUsers.asmx" /> |
| </telerik:RadComboBox> |
| <input id="txtRowID" type="hidden" runat="server" /> |
| </div> |
| </fieldset> |
| <div style="margin-top: 4px; text-align:right;"> |
| <button title="Submit" style="margin-top: 26px;" id="close" onclick="returnToParent(); return false;"> |
| Submit</button> |
| </div> |
| </form> |
| </body> |
| </html> |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| if (!IsPostBack) |
| { |
| if (Request["currentText"] != null) |
| { |
| rtbStart.Text = Request["currentText"]; |
| } |
| if (Request["rowIndex"] != null) |
| { |
| txtRowID.Value = Request["rowIndex"]; |
| } |
| } |
| } |
| protected void rcbAssigned_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e) |
| { |
| string newval = rcbAssigned.Text; |
| // add the selected user to the listing |
| string textboxValue = rtbStart.Text; |
| if (textboxValue.Trim() == "") |
| textboxValue = newval; |
| else |
| textboxValuetextboxValue = textboxValue + "; " + newval; |
| rtbStart.Text = textboxValue; |
| } |
| ConfigureGrid() |
| { |
| ... OrenGrid.MasterTableView.Columns.Add(CreateItemTemplateColumn("Oren2")); |
| ... |
| } |
| private GridColumn CreateItemTemplateColumn(string fieldName) |
| { |
| GridTemplateColumn templateColumn = new GridTemplateColumn(); |
| templateColumn.ItemTemplate = new MyEditTempate(fieldName); |
| templateColumn.HeaderText = fieldName; |
| templateColumn.DataField = fieldName; |
| return (templateColumn); |
| } |
| internal class MyEditTempate : IBindableTemplate |
| { |
| private const string m_MyEditTemplateId = "MyEditTemplateTextBox"; |
| private readonly string m_FieldName; |
| public MyEditTempate(string fieldName) |
| { |
| m_FieldName = fieldName; |
| } |
| public void InstantiateIn(Control container) |
| { |
| Control control = container.Page.LoadControl(typeof(PerformanceObjectiveControl), new object[] { }); |
| control.ID = m_MyEditTemplateId; |
| control.DataBinding += DataBindControl; |
| container.Controls.Add(panel); |
| panel.Controls.Add(control); |
| } |
| private void DataBindControl(object sender, EventArgs e) |
| { |
| PerformanceObjectiveControl control = (PerformanceObjectiveControl)sender; |
| GridDataItem namingContainer = (GridDataItem)control.NamingContainer; |
| control.Text = ((DataRowView)namingContainer.DataItem)[m_FieldName].ToString(); |
| } |
| public IOrderedDictionary ExtractValues(Control container) |
| { |
| PerformanceObjectiveControl control = (PerformanceObjectiveControl)container.FindControl(m_MyEditTemplateId); |
| IOrderedDictionary dictionary = new OrderedDictionary(); |
| dictionary[m_FieldName] = control.Text; |
| return (dictionary); |
| } |
| } |
We need to generate columns for grid dynamicaly.We are thinking of using this grid. Just I want to confirm that after creating the grid dynamically(ItemTemplate and EditItemtemplate) in code, can we refer this grid object from client side, because our client wants sorting, paging and filtering functionality on client side.
If your answer is yes then please let me know how to do it. It would be great help if you can provide us some sample application.
if your answer is No then please let me know some other way to achieve this.
Apart from this we also want below functionality .Please check if this is possible or not with this grid.If possible please provide some sample application or reference.
Quick reply would be appreciated as we need to provide the client estimate and cost as early as possible.