Telerik Forums
UI for ASP.NET AJAX Forum
8 answers
237 views
I'm in the process of upgrading my controls to the newest release, but I noticed on my menu at the bottom of the page there is a Sys.Application.add_init function that wasn't there before, and it seems to be iterating through all the navigation items again! it has already rendered them to the page so why does it add all that stuff at the bottom again?

thanks!
SelAromDotNet
Top achievements
Rank 2
 answered on 11 Jun 2009
2 answers
160 views
Hello,

I could use a little assistance here since I can't seem to figure this out. Here's what I'm trying to achieve...

I have a RadMultiPage with 2 pages inside a .NET LoginView control. In the AnonymousView, PageView1 has a link called Login. When clicked, I need to switch to PageView2 using JavaScript. I need to do it this way instead of an AJAX callback because I want to set a timer to switch back to PageView1 after a certain amount of time.

My issue right now is that I can't seem to figure out how to access the RadMultiPage in JavaScript when it's inside the LoginView control.

Can someone explain to me how to do that? Thanks in advance!
Philip Senechal
Top achievements
Rank 1
 answered on 11 Jun 2009
3 answers
150 views
I am aware this is not the first thread about this subject, still the other ones didn't solve my problem and the posts have been "out of date"...
Also, the manual doesn't gimme a hint what I am doing wrong...

However, I simply try to modify/translate the PagerTextFormat of a grid in a NumericPages mode. All I get is the "standard" text, and no, that doesn't help me in any way. Everything works as expected, except the PagertextFormat.
Maybe someone can point me into the right direction, cheers in advance.

sample ascx:
<telerik:RadGrid ID="RadGridSearchResult" runat="server" 
  OnNeedDataSource="RadGridSearchResult_NeedDataSource" AllowPaging="True" 
  PageSize="5" GridLines="None" AutoGenerateColumns="False" > 
    <MasterTableView> 
      <NoRecordsTemplate>No record was found!</NoRecordsTemplate> 
         <Columns> 
            . 
            . 
            . 
         </Columns> 
    </MasterTableView> 
</telerik:RadGrid> 

sample.ascx.cs
            RadGridSearchResult.MasterTableView.NoRecordsTemplate = new namicsNoRecordsTemplate(GetGlobalResourceObject("NATITitles", "NATIPSNoRecordsMessage").ToString()); 
            RadGridSearchResult.MasterTableView.PagerStyle.Mode = GridPagerMode.NumericPages; 
            RadGridSearchResult.MasterTableView.PagerStyle.Position = GridPagerPosition.TopAndBottom; 
            RadGridSearchResult.MasterTableView.PagerStyle.PageButtonCount = 5; 
            RadGridSearchResult.MasterTableView.PagerStyle.NextPagesToolTip = GetGlobalResourceObject("NATITitles", "NATIPSPagerStyleNextPagesToolTip").ToString(); 
            RadGridSearchResult.MasterTableView.PagerStyle.PrevPagesToolTip = GetGlobalResourceObject("NATITitles", "NATIPSPagerStylePrevPagesToolTip").ToString(); 
            RadGridSearchResult.PagerStyle.PagerTextFormat = "Seite {0} von {1}, Person {2} von {3} von gesamt {5}."; 
 

Pavlina
Telerik team
 answered on 11 Jun 2009
5 answers
100 views
Hi,

I would like to know if it is possible to set appointement template according to a datasource field...
For example :

I have a datasource selecting current day appointements, with id, start, end, subject...
I want to add a field "type" that will be used to select rendering template. And each template will contain different controls that will show data according to "type"... Type 1 => template 1, showing appointement fields "fieldone", "fieldtwo"... Type 2 => Template 2, showing appointement fields "fieldthree"... And so on...

Thanks
Peter
Telerik team
 answered on 11 Jun 2009
1 answer
113 views
Hi Telerik Team,

 

     I open a popup by using code shown below and want to close it and send notification back to the original page once a user clicks on the save button within this popup.

    Original Page Code:

<telerik:radwindowmanager id="RadWindowManager1" runat="server" skin="Office2007">

<Windows>

<telerik:RadWindow ID="rwHazard" runat="server" Height="500px" Width="700px" Left="300px"> </telerik:RadWindow>

</Windows>

</telerik:radwindowmanager>

Page_Load()

{

Response.Redirect("~/IH_Module/Assessment_Dashboard.aspx?Module_ID=22&HazardIDType=" + HazardIDType);

}

Popup page code:

ASPX

<script type="text/javascript">

function GetRadWindow()

{

var oWindow = null;

if (window.radWindow) oWindow = window.radWindow;

else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;

return oWindow;

}

function CallParentWindow()

{

var oWindow = GetRadWindow();

CloseWindow()

}

function CloseWindow()

{

var oWindow = GetRadWindow();

oWindow.BrowserWindow.location.reload();

oWindow.Close();

}

function Close()

{

var oWindow = GetRadWindow();

oWindow.Close();

}

</script>

<asp:Label ID="InjectScriptLabel" runat="server" Text=""></asp:Label>

protected void btnSelect_Click(object sender, EventArgs e)

{

try

{

string sHazardName = string.Empty;

string sHazardType = string.Empty;

string sHazardIDType = string.Empty;

 

foreach (Telerik.Web.UI.GridDataItem dataItem in rdHazard.SelectedItems)

{

if ((sHazardIDType.Trim().Length == 0))

{

sHazardIDType = dataItem.Cells[3].Text.ToString();

}

else

{

sHazardIDType = sHazardIDType + "^" + dataItem.Cells[3].Text.ToString();

}

}

if (sHazardIDType == "")

{

throw new Exception("Please select a hazard");

}

Response.Redirect("~/IH_Module/Assessment_Dashboard.aspx?Module_ID=22&HazardIDType=" + HazardIDType);

InjectScriptLabel.Text = "<script>CallParentWindow()</" + "script>";

}

catch (Exception ex)

{

PMAP_Common_Methods.DisplayUserMessage(ex.Message);

}

}



Fiko
Telerik team
 answered on 11 Jun 2009
1 answer
116 views
I encounter the following error when i try to add skins to the entire web page by makings modifications in the web config file, The addititional code for the web config file is ;

<

 

appSettings>

 

<!--

 

Sets the skin for all RadControls to Hay -->

 

<

 

add key="Telerik.Skin" value="Hay"/>

 

</

 

appSettings>

 


which i have added in the <configuration> tag

The errors which i encounter are:

1.Error 84 D:\TrainingScheduler\Default.aspx: ASP.NET runtime error: Sections must only appear once per config file.  See the help topic <location> for exceptions. (D:\TrainingScheduler\web.config line 150) D:\TrainingScheduler\Default.aspx 1 1 D:\TrainingScheduler\
2.Error 85 Sections must only appear once per config file.  See the help topic <location> for exceptions. D:\TrainingScheduler\Web.Config 150 

Please help,

Thanks
Manan Podar
Kamen Bundev
Telerik team
 answered on 11 Jun 2009
4 answers
83 views
When you cick a date in the month view, it always goes to the day view. I'd like it to goto the timeline view and select the appropiate day. How can I accomplish this?
Troy
Top achievements
Rank 1
 answered on 11 Jun 2009
1 answer
185 views
Hi Telerik,
I need help:
I have a rad grid with edit form and bunch of text boxes and buttons in it.
inside edit form I am trying to load user controls into RadToolTip dinamicly based on clicked button.
When I click first link button lnkEditSupplierSearch ==> everything works fine;  however if I click
after this the another link button (lnkEditProductrSearch and only after clicking lnkEditSupplierSearch)
I am receiving following error:

Failed to load viewstate.  The control tree into which viewstate is being loaded must match the control
tree that was used to save viewstate during the previous request.  For example, when adding controls
dynamically, the controls added during a post-back must match the type and position of
the controls added during the initial request.

Here is the code WEB USER CONTROL:
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server"> 
    <AjaxSettings>     
        <telerik:AjaxSetting AjaxControlID="RadAjaxManagerProxy1">         
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="RadGrid1"/> 
                
            </UpdatedControls> 
        </telerik:AjaxSetting> 
        <telerik:AjaxSetting AjaxControlID="RadGrid1"> 
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="RadGrid1"/> 
                <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                <telerik:AjaxUpdatedControl ControlID="RadToolTipManager1" />                
            </UpdatedControls> 
        </telerik:AjaxSetting>         
    </AjaxSettings> 
</telerik:RadAjaxManagerProxy> 
 
<telerik:RadScriptBlock ID="rdScriptBlockCloseSearchWindow" runat="server"> 
    <script language="javascript" type="text/javascript"> 
        function CloseActiveSuppliersSearchGridToolTip(selectedSupplierID)  
        { 
            var controller = Telerik.Web.UI.RadToolTipController.getInstance(); 
            var tooltip = controller.get_activeToolTip(); 
            if (tooltip) tooltip.hide();            
         
        } 
 
        function CloseActiveProductSearchGridToolTip(selectedproductID)  
        { 
            var controller = Telerik.Web.UI.RadToolTipController.getInstance(); 
            var tooltip = controller.get_activeToolTip(); 
            if (tooltip) tooltip.hide(); 
        } 
    </script> 
</telerik:RadScriptBlock> 
 
<asp:Panel ID="pnlOrderlineItems" runat="server"> 
<asp:UpdatePanel ID="LineItemsGridPanel" runat="server" UpdateMode="Conditional"> 
        <ContentTemplate> 
            <telerik:RadGrid .................. OnItemCreated="RadGrid1_ItemCreated"> 
                <MasterTableView> 
                    ............ 
                    <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>            
 
                            <telerik:RadTextBox ID="txtEditProduct" runat="server" Skin="Office2007">                                                                                     
                            </telerik:RadTextBox> 
                            <asp:LinkButton ID="lnkEditProductrSearch" runat="server" Skin="Office2007"> 
                                <img style="border:0px;vertical-align:middle;" src="<%= ResolveUrl("~") %>Images/Details.gif" alt="Search Supplier" /> 
                            </asp:LinkButton> 
                            ................... 
                        </FormTemplate> 
                    </EditFormSettings> 
                </MasterTableView> 
            </telerik:RadGrid>  
            <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" 
                ShowEvent="OnClick" HideEvent="FromCode"> 
            </telerik:RadToolTipManager>             
       </ContentTemplate>        
</asp:UpdatePanel>           
 
    <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> 
     

protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    { 
        if (e.Item is GridEditFormItem && e.Item.IsInEditMode) 
        { 
            GridEditFormItem editFormItem = (GridEditFormItem)e.Item; 
            SetSupplierSearch(editFormItem); 
            SetProductSearch(editFormItem); 
        } 
    } 
     
    private void SetSupplierSearch(GridEditFormItem editFormItem) 
    { 
        LinkButton lnkbtnSupplierSearch = (LinkButton)editFormItem.FindControl("lnkEditSupplierSearch"); 
 
        if (lnkbtnSupplierSearch != null) 
        { 
            RadToolTipManager1.TargetControls.Add(lnkbtnSupplierSearch.ClientID, "lnkbtnSupplierSearch", true); 
        } 
 
        RadTextBox txtEditSupplier = (RadTextBox)editFormItem.FindControl("txtEditSupplier"); 
        if (txtEditSupplier != null) 
        { 
            string s = "AssignHdnSupplierSearchText($get('" + txtEditSupplier.ClientID + "'))"; 
            lnkbtnSupplierSearch.Attributes.Add("onclick", s); 
        } 
    } 
     
    private void SetProductSearch(GridEditFormItem editFormItem) 
    { 
        LinkButton lnkbtnProdNumSearch = (LinkButton)editFormItem.FindControl("lnkEditProdNumberSearch"); 
        LinkButton lnkbtnProdDescSearch = (LinkButton)editFormItem.FindControl("lnkEditProdDescSearch"); 
        if (lnkbtnProdNumSearch != null) 
        { 
            RadToolTipManager1.TargetControls.Add(lnkbtnProdNumSearch.ClientID, "lnkbtnProdNumSearch", true); 
        } 
 
        if (lnkbtnProdDescSearch != null) 
        { 
            RadToolTipManager1.TargetControls.Add(lnkbtnProdDescSearch.ClientID, "lnkbtnProdDescSearch", true); 
        } 
 
        RadTextBox txtEditProdNumber = (RadTextBox)editFormItem.FindControl("txtEditProdNumber"); 
        RadTextBox txtEditProdDesc = (RadTextBox)editFormItem.FindControl("txtEditProductDesc"); 
 
        if (txtEditProdNumber != null) 
        { 
            string s = "AssignHdnProdNumSearchText($get('" + txtEditProdNumber.ClientID + "'))"; 
            lnkbtnProdNumSearch.Attributes.Add("onclick", s); 
        } 
 
        if (txtEditProdDesc != null) 
        { 
            string s = "AssignHdnProdDescSearchText($get('" + txtEditProdDesc.ClientID + "'))"; 
            lnkbtnProdDescSearch.Attributes.Add("onclick", s); 
        } 
 
 
    } 
     
    protected void RadToolTipManager1_AjaxUpdate(object sender, ToolTipUpdateEventArgs args) 
    {       
        this.UpdateToolTip(args.Value, args);             
    } 
 
    private void UpdateToolTip(string elementID, ToolTipUpdateEventArgs args) 
    {  
        if (elementID.ToUpper() == "LNKBTNSUPPLIERSEARCH") 
        { 
            UpdateSupplierToolTip(elementID, args);             
        } 
        else if (elementID.ToUpper() == "LNKBTNPRODNUMSEARCH" || elementID.ToUpper() == "LNKBTNPRODDESCSEARCH") 
        { 
            UpdateProductToolTip(elementID, args); 
        } 
    } 
 
    private void UpdateSupplierToolTip(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; 
        supplierResultsCntrl.ParentControl = panel; 
        supplierResultsCntrl.ParentControlName = "LINEITEMSEDITFORM"; 
        panel.ContentTemplateContainer.Controls.Add(cntrl); 
    } 
 
    private void UpdateProductToolTip(string elementID, ToolTipUpdateEventArgs args) 
    { 
        UpdatePanel panel = args.UpdatePanel; 
        List<Product> listPrds = DoProductSearch(elementID); 
 
        Control cntrl = this.LoadControl("ProductSearchResults.ascx"); 
        panel.ContentTemplateContainer.Controls.Add(cntrl); 
        ProductSearchResults productResultsCntrl = (ProductSearchResults)cntrl; 
        productResultsCntrl.ProductList = listPrds; 
        productResultsCntrl.ParentControl = panel; 
        productResultsCntrl.ParentControlName = "LINEITEMSEDITFORM"; 
        panel.ContentTemplateContainer.Controls.Add(cntrl); 
    } 
 
Svetlina Anati
Telerik team
 answered on 11 Jun 2009
1 answer
167 views
I have 3 levels of details tables within a rad grid.

The bottom details table contains a GridTemplateColumn with an image button which is linked to a RadToolTipManager.

On click, a Modal tooltip is displayed, but I need to access the datakeyvalues of the grid to send values to the Tooltip.

I can do this easily at a top level RadGrid table, but I cant seem to do it from a details table.

 

<DetailTables> 
<telerik:GridTableView Name="gtv_account2" runat="server" DataKeyNames="InvoiceNumber, InvoiceDate, Outstanding">   
.  
<telerik:GridTemplateColumn UniqueName="gtv_account2_buttons">   
<ItemTemplate>   
<asp:ImageButton ID="Invoice_Query" CommandName="Invoice_Query" ImageUrl="~/Images/Icons/invoice_query.gif" runat="server" AlternateText="Click to query invoice" CausesValidation="false" />   
.  
.  
.   
<telerik:RadToolTipManager ID="RadToolTipManager_Query_Invoice" HideEvent="ManualClose" Modal="true" runat="server" OnAjaxUpdate="OnAjaxUpdate_Query_Invoice" RelativeTo="BrowserWindow">   
   
</telerik:RadToolTipManager> 

 


Clicking the image button launches the tooltip, and the function in the definition above it hit (OnAjaxUpdate_Query_Invoice).

How can I access the datakeyvalues in the following function?  

 

Protected Sub OnAjaxUpdate_Query_Invoice(ByVal sender As Object, ByVal args As ToolTipUpdateEventArgs)  
.  
End Sub 

The following didn't work:

value = RadGrid1.MasterTableView.DetailTables(0).DataKeyValues(args.Value)("InvoiceNumber") 

Thanks for any help!

 

 

 

Veli
Telerik team
 answered on 11 Jun 2009
3 answers
259 views
Hi

I am getting  annoying error messages in design in VWD 2008.
I have a number of master pages with controls in and when I am in design view
of a new page, all the controls in the master page regions show the 'error creating control.. ' message
but the child page itself previews and runs correctly without any errors.

I feel I must have left something out to get these errors but everything runs fine so it is not
a show stopper.

What can I do to clean this up?

Thanks for your help

Clive
Pavlina
Telerik team
 answered on 11 Jun 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?