Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
177 views
I have an application in SharePoint that contains a RadGrid whoe edit item calls a RadWindow to get some external information.  This works fine when I run through testing in my visual studio environment, but as soon as I move it it's SharePoint home, it no longer returns the data.   The main page with the RadGrid works fine, it calls the RadWindow fine (and everything in it works as expected), but once I hit the submit button, the RadWindow just closes and the data does not seem to go back to the Parent Window.  

Ive based my code on this demo, and a various other links within the documentation that I can't fnd atm.   Is there something different that needs to be done for the values to be returned to the parent window in SharePoint?  

I'll try to give the main pieces of code blow:
First, from the main form:  the RadWindow declaration:
<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> 

The field within the RadGrid that needs the data (note the inner Javascript is storing these clientIDs in an array for easy access) :
<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> 

The JavaScript related to the RadGrid on the arent page:
<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 + "&currentText=" + 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> 

The entier RadWindow Page that is called and it's Javascript:
<%@ 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> 
 
and that page's code behind, as it does a little bit of the setup work (although I don't think it's related to the problem).:
       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;  
        } 

I know it's a lot of code to digest at once, but I need help here.  As I said, all works perfect in the Visual Studio environment, but as soon as I move it to SharePoint the return variables don't work.   Anyone have any idea whats happening?

Thanks,
Russell.



Russ
Top achievements
Rank 1
 answered on 11 May 2009
1 answer
118 views
Hello,

I am working on a customers software and do replace his old grid with telerik rad grid. In his old grid, there was a filter that is new to me. There are two calender controls in a small pop-up window which opens on clicking on the filter. i choose a date on each calendar and all dates between these two dates were found.

is there any possibility to implement a feature like this on telerik rad grid?

thanks.
Sebastian
Telerik team
 answered on 11 May 2009
0 answers
75 views
I have a tree with three nodes: A, B, and C.  I click A so it is now selected. Now I drag B but the text under the cursor is still A. Then I drag C and the text under the cursor is B. This is a problem because the wrong nodes are being handled in the server-side NodeDrop event.

The demo online works fine (http://demos.telerik.com/aspnet-ajax/treeview/examples/functionality/draganddropnodes/defaultcs.aspx).  Is this a common/known issue, or does it sound like there's something else in my project influencing this behavior?


Edit: This was a known issue fixed in the latest release.  I'll upgrade later...
Kevin
Top achievements
Rank 1
 asked on 11 May 2009
2 answers
82 views
My client wants me to simulate a table of contents.  All nodes must be open initially without the ability to collapse them.  I need to hide the lines and "plus".  Each node will have context menus associated and must be clicable

I can accomplish most of this, but it seems dirty to me.

Is there a recommended way to make the treeview "fully expanded and non collapsible".  Hopefully I just missed a setting

Thanks
Tommy


Tommy
Top achievements
Rank 1
 answered on 11 May 2009
6 answers
141 views
Hi

I have a multiselect RadComboBox with a checkbox in the itemtemplate. The control is initially disabled but when I enable it the items stay disabled. Here is the code:-

function toggleFPs(chk)
{
var combo = $find("<%= cmbFPs.ClientID %>");
if (chk.checked)
combo.disable();
else
combo.enable();
}
...
<telerik:RadComboBox ID="cmbFPs" runat="server" Height="160px" Width="185px" 
Enabled="false" HighlightTemplatedItems="true" 
DataTextField="Username" DataValueField="UserID" 
OnClientLoad="selChange"
OnClientSelectedIndexChanged="selChange" 
EmptyMessage="Choose Finance partners">
<ItemTemplate>
<asp:CheckBox runat="server" ID="CheckBox" DataValueField="UserID" onclick="event.cancelBubble=true;" Text="" />
<%# Eval( "UserName") %>
</ItemTemplate>
</telerik:RadComboBox>
<asp:CheckBox ID="chkAllFPs" runat="server" Text=" All " Checked="true"
onclick="toggleFPs(this)" />
...

How do I enable the checkbox in the items? 

I also tried this and still couldnt check the boxes...

  var items = combo.get_items();
for (var i = 0; i < items.get_count(); i++) 
items.getItem(i).enable();

I am using ASP.NET Ajax Q2 2008.

Thanks.

Simon
Telerik team
 answered on 11 May 2009
1 answer
147 views
We dynamically create GridTemplateColumn with an inner usercontrol but my usercontrol does not get initialized so whenever I try to access the controls inside it, those are all null.

Is there something I miss??

Bellow is the page codebehind and the ItemTemplate class.

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); 
   } 
 
 

The usercontrol PerformanceObjectiveControl only contains a asp:TextBox control and has a property called Text which (for now) is only a façade to the TextBox.Text itself.

Thanks,

Hugues
Georgi Krustev
Telerik team
 answered on 11 May 2009
3 answers
301 views
I'm binding a datatable to a radgrid that has 2 consistant columns but there are then 1 to n number of columns that have integers in. I want to total these up in the footer (group and overall footers) and then have a column at the far right that also tallys them up (so I have totals for horizontal and vertical and overal total in the bottom right).
I've looked in pretty much every event (column creating / column created etc) to do this, but cannot find anyway sum up these values into the footer / dynamic column.

Does anyone have any ideas?
Thanks.
Sebastian
Telerik team
 answered on 11 May 2009
7 answers
161 views
I would like to know how to place a control in the menu.. I want to integrate a radcombobox.... sort of like you have the search bar integrated into your (telerik) navbar.

I know how to do it in photoshop :)

the skin is Black... and pretty much standard..

the combobox would be populated by a couple fields in a table.. (but I have all the data streams worked out) i just need to know how to seamlessly place a radcombobox on the right side inside of a radmenu strip, regardless of there only being 2 or 3 items in the menu...

here is a link to the site where the menu is... you will see that there is only 1 item in the menu.. and the menu stretches to the width of the page... (980px in this case)

http://giovanniscoalfirepizza.com






sircutbreaker
Top achievements
Rank 1
 answered on 11 May 2009
1 answer
93 views
Hi,
       

 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.

  • Bulk Update functionality.-: I guess AllowMultiRowEdit property serve this purpose.
  • Can we achieve Bulk upade functionality from client side with runtime column generation ?
  • Row should go to edit mode on click of row.
  • Excel like navigation in grid cells.
  • On click of tab in last cell of editable row the cursor should move to next row which is in edit mode.


Quick reply would be appreciated as we need to provide the client estimate and cost as early as possible.


Thanks
Mahesh
Sebastian
Telerik team
 answered on 11 May 2009
1 answer
189 views
Hi,

I have a grid with a DateTime column and I want to show the "__/__/____ __:__:__" Mask, be able to select the date and time with a DateTimePicker, validating Client-Side if the datetime format is good and the textbox is not empty, and if not, showing Client-Side the Alert Icon (/!\) in the textbox, without using neither requiredFieldValidators nor RegularExpressionValidators but only Telerik components.

In fact I want to combine the RadDateTimePicker, the RadMaskedTextBox and the RegExpTextBoxSetting.

Is it possible to combine all these options for a single textbox ?
Sebastian
Telerik team
 answered on 11 May 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?