This is a migrated thread and some comments may be shown as answers.

[Solved] RadGrid EditForm and ToolTipManager

5 Answers 362 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Zinoviy Margovskiy
Top achievements
Rank 1
Zinoviy Margovskiy asked on 08 Jun 2009, 06:46 PM
Hi Telerik,

I am trying to open a RadToolTip from Grid's Edit form.  The issue I am having is that my tool tip pop-up does not open
Here is the setup:
I have a web user control with the Grid and EditForm template

<asp:Panel ID="pnlOrderlineItems" runat="server">
    <asp:UpdatePanel ID="LineItemsGridPanel" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <table>
                <tr>
                    <td>
                        <telerik:RadGrid ID="RadGrid1" Width="1300px" runat="server" SortingSettings-EnableSkinSortStyles="true"
                            Skin="Office2007" GridLines="None" ShowStatusBar="true" AllowAutomaticInserts="true"
                            AllowAutomaticUpdates="true" AllowAutomaticDeletes="true" OnNeedDataSource="RadGrid1_NeedDataSource"
                            ShowFooter="True" OnItemDataBound="RadGrid1_ItemDataBound">
                              <MasterTableView Width="100%" CommandItemDisplay="Top" AutoGenerateColumns="true"
                                InsertItemDisplay="Top" InsertItemPageIndexAction="ShowItemOnFirstPage"                           
                                EditMode="EditForms">
<Columns>
................ some columns ............
</Columns>
<EditFormSettings EditFormType="Template">
<FormTemplate>
<telerik:RadTextBox ID="txtEditSupplier" runat="server" Skin="Office2007"></telerik:RadTextBox>
<asp:LinkButton ID="lnkEditSupplierSearch" runat="server" Skin="Office2007">
                 <img style="border:0px;vertical-align:middle;" src="<%= ResolveUrl("~") %>Images/Details.gif" alt="Search Supplier" />
</asp:LinkButton>
.................. Some other controls ...................
        </FormTemplate>
    </EditFormSettings>
</MasterTableView>
</telerik:RadGrid> </ContentTemplate>
</asp:UpdatePanel>

    <telerik:RadToolTipManager runat="server" ID="RadToolTipManager1" Width="800px" Height="500px"
        OnAjaxUpdate="RadToolTipManager1_AjaxUpdate" RelativeTo="Element" Animation="Slide"
        Position="MiddleRight" Modal="true" ContentScrolling="Auto" AutoTooltipify="false">
    </telerik:RadToolTipManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px"
        Width="75px" Transparency="1">
        <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'
            style="border: 0;" />
    </telerik:RadAjaxLoadingPanel>

And here is CS page:

    protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {   
 
      ................ Some stuff ...........................
        if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
        {
            GridEditFormItem editFormItem = (GridEditFormItem)e.Item;
            LinkButton lnkbtnSupplierSearch = (LinkButton)editFormItem.FindControl("lnkEditSupplierSearch");

            if (lnkbtnSupplierSearch != null)
            {
                RadToolTipManager1.ShowEvent = Telerik.Web.UI.ToolTipShowEvent.OnClick;
                RadToolTipManager1.HideEvent = Telerik.Web.UI.ToolTipHideEvent.FromCode;  
                RadToolTipManager1.TargetControls.Add(lnkbtnSupplierSearch.ClientID, true);
            }
        }
    }

  private void UpdateToolTip(string elementID, ToolTipUpdateEventArgs args)
    {
        UpdatePanel panel = args.UpdatePanel;
        List<ISupplier> listSuppliers = DoSupplierSearch();

        Control cntrl = this.LoadControl("SupplierSearchResults.ascx");
        panel.ContentTemplateContainer.Controls.Add(cntrl);
        SupplierSearchResults supplierResultsCntrl = (SupplierSearchResults)cntrl;
        supplierResultsCntrl.SuppliersList = listSuppliers;
        panel.ContentTemplateContainer.Controls.Add(cntrl);
        int suppID = supplierResultsCntrl.SelectedSupplierID;
    }


5 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 09 Jun 2009, 10:01 AM
Hello Zinoviy,

Does the behavior change when you place the tooltip manager inside the MS UpdatePanel's content template or by using RadAjaxManager instead as shown on this online demo? Additionally, you can remove temporary the update panel to see whether this produces different result.

Additionally, the more appropriate place to add the link button from the edit form to the TargetControls collection of RadToolTip manager is the ItemCreated event handler of the grid. More information about the major differences between the ItemCreated and ItemDataBound events of the control can be gathered from here.

Best regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Zinoviy Margovskiy
Top achievements
Rank 1
answered on 09 Jun 2009, 12:52 PM
Thank you Sebastian,

I fixed this issue.  IT looks like loading panel was the problem, so I am handling opening and closing of it with javascript.

Now, another issue I am having is updating controls inside Grid's Edit Form.  See, heading from the code that I've posted,
I have an update panel with the grid, these controls sit inside composite web user control.  Inside the grid's edit form I have a text box
with the link button.  Users can enter text into text box and then click Link button in order to do a search against entered text.  
If there are search results then, this should cause the tooltip to popup with search results.  
I have a web user control inside tooltip which shows these results in tabular form (using repeater).  
Then users can select a record that they like (inside tooltip window), and once record is selected then I WANT TO POPULATE GRID'S EDIT FORM
WITH SELECTED DATA.  I was successful in displaying the tooltip with search results,  however I do not know how to:
    1. Communicate selected data back to Grid's Edit form
    2. Refresh Edit Form so that returned data will be displayed
    
Can you please assist me with that issue?
0
Sebastian
Telerik team
answered on 09 Jun 2009, 01:27 PM
Hello Zinoviy,

I think that you can find the information you need in the following public forum thread on our site:

http://www.telerik.com/community/forums/aspnet-ajax/window/window-as-dialog-return-value-in-radgrid-edit-form-template.aspx

Feel free to modify/extend the solution to be in par with your custom project schema.

Best regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Zinoviy Margovskiy
Top achievements
Rank 1
answered on 09 Jun 2009, 01:31 PM
Sebastian,

this thread is about radwindow while I am using radToolTipManager?
0
Sebastian
Telerik team
answered on 09 Jun 2009, 02:15 PM
Hello Zinoviy,

I directed you to this thread because the logic to populate the grid editor (which is part of the edit form) would be quite similar. To fetch the selected data, consider intercepting the OnClientBeforeHide client event of RadToolTip and extract the values from the corresponding DOM elements inside the tooltip instance.

Best regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Zinoviy Margovskiy
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Zinoviy Margovskiy
Top achievements
Rank 1
Share this question
or