Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
185 views
I have an ASP DetailsView with a RadGrid in one of the Template Columns. What I would like to do is when I put my DetailsView into edit mode to add the edit and delete columns to the RadGrid. Right now I have it so in the DataBound event for the DetailsView I check if it's in edit mode and then add the "Add New Record" button. I have tried adding code to turn on the edit column but it doesn't work. See the code example below. Any help would be appreciated.

if(((DetailsView)sender).CurrentMode== DetailsViewMode.Edit)
            {
                DropDownList ddl = (DropDownList)((DetailsView)sender).FindControl("DevicesLocation");
                Label lbl = (Label)((DetailsView)sender).FindControl("lblLocationID");
 
                LocationDropDown(ddl);
                ddl.SelectedValue = lbl.Text;
 
    // Show the command display on edit
                ipAddressRadGrid.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top;

      // Add edit column
                ipAddressRadGrid.AutoGenerateEditColumn = true;
 
                ipAddressRadGrid.Rebind();
            }
Antonio Stoilkov
Telerik team
 answered on 05 Mar 2012
2 answers
153 views
Hi everyone,

I am having a problem refreshing a node after saving changes on the server side.  A summary:

I have an ASP.NET Ajax RadTreeView within an UpdatePanel.  A user selects a node and clicks an Edit button.  This opens a jQuery dialog in which node data can be changed, such as the description (not the value!).  After clicking the Save button in the dialog, a piece of JavaScript triggers a button, which has been registered for AsyncPostBack.  On the server side, the node data is saved, and execution returns to a JavaScript method on the page.  I then want to refresh the node that has been edited, in order to display, for instance, the new description for the node.  I might be going about this the wrong way, but I thought I would be able to accomplish this by refreshing the node's parent, and then re-selecting the node itself.  Everything works, accept re-selecting the node that had been edited. 

I write the following code:

var tree = FindTree();
var currentNodeValue = tree.get_selectedNode().get_value();
RefreshParentNode();
var currentNode = tree.findNodeByValue(currentNodeValue);
// TODO: why is this node not found?!?
// For now, after update, the parent is selected because the child node is not found, even though it is there...
if (currentNode) {
    currentNode.select();
}

The RefreshParentNode function simply finds the parent node of the selected node, and then refreshes it using the following code:

function RefreshNode(node) {
    if (node) {
        node.collapse();
        node.get_treeView().trackChanges();
        node.get_nodes().clear();
        node.set_expandMode(Telerik.Web.UI.TreeNodeExpandMode.WebService);
        node.get_treeView().commitChanges();
        node.expand();
    }
}

All nodes are now displayed correctly, including the updated node with its new description.  However, as the comments in the code fragment at the top show, the findNodeByValue function fails to find the node that had been edited, so I can't re-select it.

So, I basically, have two questions:

1) Is there an easier way to get the edited node to display its new description?
2) If not: why is the node not found by findNodeByValue after refreshing the parent, and how can I fix this?

By the way, in case this is not clear from the code fragments above: I am using a LoadOnDemand scenario.  Root nodes are loaded immediately, child nodes are loaded using a webservice.

UPDATE: Yes, the FindTree method uses $find and not $get.  The tree reference is not the problem...

Regards,
Inge
Inge
Top achievements
Rank 1
 answered on 05 Mar 2012
3 answers
140 views
<telerik:RadToolTipManager ID="RadToolTipManager1" runat="server" Position="BottomCenter"
                RelativeTo="Element" Width="400" Height="400" Animation="Resize" HideEvent="LeaveTargetAndToolTip"
                OnAjaxUpdate="OnAjaxUpdate" OnClientHide="OnClientHide" RenderInPageRoot="true" AnimationDuration="200">
              
<TargetControls>
<telerik:ToolTipTargetControlTargetControlID="Complain_btn" IsClientID="true"/>
</TargetControls>
</telerik:RadToolTipManager>
<Columns>
       <telerik:GridTemplateColumn  HeaderText="Complains"   UniqueName="TemplateColumn1">
        <ItemTemplate>
        <telerik:RadButton ID="Complain_btn"  Text="Complain Details"  runat="server" >
        </telerik:RadButton>
          </ItemTemplate>
          </telerik:GridTemplateColumn>
</Columns>
 
 protected void OnAjaxUpdate(object sender, ToolTipUpdateEventArgs args)
        {
            this.UpdateToolTip(args.Value, args.UpdatePanel);
        }
 
        private void UpdateToolTip(string elementID, UpdatePanel panel)
        {
            Control ctrl = Page.LoadControl("Complains.ascx");
            panel.ContentTemplateContainer.Controls.Add(ctrl);
            Complains c = (Complains)ctrl;
             c.CompID = elementID;
        }
I have a radgrid with a radbuttons added to the master table view. And I want to use tooltip manager and add tooltips from the database dynamically. Can any one tell me how to add tooltips step by step . This is my radgrid code. Please help Me!


 


Marin Bratanov
Telerik team
 answered on 05 Mar 2012
5 answers
118 views

Do you have to have a DataSource defined in the .aspx for htis to work ? 

What i was doing initially was databinding a list to my combobox in the code behind (page load)

I'm trying to get this working with automaticloadondemand but failing. 

I've tried adding it into itemsrequested as well but no luck. I was hoping i'd be able to do this automatically rather than have to handle the request each time and have to calculate how many items are returned and what other ones need to display (showmoreresults box)

etc etc.

Regards,

Alan

Dimitar Terziev
Telerik team
 answered on 05 Mar 2012
6 answers
82 views
Hi,

I am using RadAjaxPanel in my DotNetNuke Application, I'm trying to do a RadAjaxPanel ajaxRequest (invoked on the client) to call the server event-handler. I do have a server-side AjaxRequest handler defined but it never gets call because of something with the request. What do I have to do to figure this out?

Please Help Me !!!

function chkBox_Click(chk)
            {
                
                var combo = $find("<%= cmbRoleName.ClientID %>");
                var text = "";             
               
                //get the collection of all items
                var items = combo.get_items();
                
                //enumerate all items
                for (var i = 0; i < items.get_count(); i++)
                {
                    var item = items.getItem(i);
                    
                    //get the checkbox element of the current item
                    var chkRole = $get(combo.get_id() + "_i" + i + "_chkRole");
                                        
                    if (chkRole.checked)
                    {
                        text = item.get_text()
                        var ajaxPanel = window['<%=rapUserJobMapping.ClientID %>'];
                        var ajaxValue = "ADDUSERS\r\n"+ text;   
                        alert(ajaxValue)
                        ajaxPanel.AjaxRequest(ajaxValue);
                            
                        

                    }                   

                }               
                
            }   
Maria Ilieva
Telerik team
 answered on 05 Mar 2012
1 answer
51 views
Hi,

  I am having a combobox and during itemsrequested e.Text always returns null..And after reaching end of the combobx the same data binds again....what i have to do in javascript?Help me..

Thnx in advance
:)
Dimitar Terziev
Telerik team
 answered on 05 Mar 2012
3 answers
175 views
Greetings,

I have in my grid a GridTemplateColumn which display "INDEF" or "MA". When it's "INDEF", i would like my row to change of color:


this is my try:

protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
    if (e.Item is GridDataItem)
    {
        GridDataItem item = (GridDataItem)e.Item;
 
        if (item["typedestickets"].Text == "INDEF")
        {
            item.BackColor = System.Drawing.Color.Red;
        }
    }
}
The column in question:


                <telerik:GridTemplateColumn  HeaderText="Type de tickets"
    UniqueName="typedestickets">
    <ItemTemplate><asp:Label id="test" runat="server"></asp:Label></ItemTemplate>
</telerik:GridTemplateColumn>


Thanks in advance for your help
Ronan BARRANGER
Top achievements
Rank 1
 answered on 05 Mar 2012
1 answer
110 views

Here is another issue with Telerik Control. Following is the scenario:

 

We have three panels on the form which is Ajax enabled:

1.       Panel 1 – where user enters information.

2.       Panel 2 – where user uploads document using Telerik RADAsyncUpload control.

3.       Panel 3 -  where user confirms his information and uploaded files before he submits.

 

Issue:                                      

 

The user has the option to go back and forth between above three panels to update any information. But the problem arises when user selects files in Telerik RADAsyncUpload control and he goes back to the Panel 1 and Comes back to the Panel 2 (or from Panel 3 to Panel 2). The files that the user is selected are lost. The telerik upload control doesn’t maintain the state of the selected files. Instead it goes back to the initial state.

 

We tried to use the “PostbackTriggers” property but it is not working.

 

Please assist us asap.

Thanks.
N
Dimitar Terziev
Telerik team
 answered on 05 Mar 2012
1 answer
126 views
Hi,

I have a radpanelbar in a RadAjaxUpdate panel . I need to post back the page when i click or expand  the radpanel item . But got an error.
System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).    at System.Web.UI.ControlCollection.AddAt(Int32 index, Control child)     at Telerik.Web.UI.RadAjaxControl.MoveUpdatePanel(Control initiator, Control updated)   

I have the following code
<telerik:RadAjaxPanel ID="DemoPanelBarPanel" runat="server" EnableAJAX="true">
 
    <telerik:RadPanelBar ID="uxProfileList" OnClientItemClicked="OnClientItemExpand" OnClientItemExpand="OnClientItemExpand" ExpandMode="FullExpandedItem" Width="100%" runat="server">
 
                            <Items>
                                <telerik:RadPanelItem runat="server" Text="Personal Info" Value="PersonalInfo" Font-Bold="true"  >
                                </telerik:RadPanelItem>
                                <telerik:RadPanelItem runat="server" Text="Profile Info" Value="ProfileInfo" Font-Bold="true" >
                                </telerik:RadPanelItem>
                                <telerik:RadPanelItem runat="server" Text="Education" Value="Education" Font-Bold="true" >
                                </telerik:RadPanelItem>
                                <telerik:RadPanelItem runat="server" Text="WorkExperience" Value="WorkExperience" Font-Bold="true" >
                                </telerik:RadPanelItem>
                            </Items>
 
                        </telerik:RadPanelBar>
</telerik:RadAjaxPanel>
<script  type="text/javascript" language="javascript">
 
    function OnClientItemExpand(sender, args) {
 
 
 
        $find("<%= DemoPanelBarPanel.ClientID%>").ajaxRequestWithTarget("<%= DemoPanelBarPanel.ClientID%>", args.get_item().get_value());
 
 
    }    
</script>
DemoPanelBarPanel.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(OnProfileAjaxPanelAjaxRequest);
void OnProfileAjaxPanelAjaxRequest(object sender, AjaxRequestEventArgs e)
       {
          if (e.Argument.Equals("PersonalInfo"))
           {
              RadPanelItem item = uxProfileList.Items.FindItemByValue(e.Argument);
           }
       }

Dimitar Terziev
Telerik team
 answered on 05 Mar 2012
1 answer
27 views
I have a radtextbox on an aspx page that renders correctly on all major desktop browsers. On the IPad with the latest browser it draws the top half of the textbox only. I can click in the textbox and it will redraw correctly, but on form load I get the top half only. Is this a known issue corrected with upgrades to the IPad browser or Telerik controls?

I am using v. 2011.2.712.40

Thanks,
Ben
Maria Ilieva
Telerik team
 answered on 05 Mar 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?