Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
240 views

My application uses master pages, I have a Prometheus RadGrid on my content page along with an asp:Image control that, when you mouseover it, displays a RadContextMenu with options for exporting grid data (Excel, PDF, etc.).  I have the RadContextMenu controlling the grid via RadAjaxManagerProxy:

<telerik:AjaxSetting AjaxControlID="RadContextMenuExport">
    <UpdatedControls>
        <telerik:AjaxUpdatedControl ControlID="radgRoles" LoadingPanelID="RadAjaxLoadingPanel1" />
    <telerik:AjaxUpdatedControl ControlID="RadContextMenuExport" LoadingPanelID="RadAjaxLoadingPanel1" />
    </UpdatedControls>
</telerik:AjaxSetting>

And I am handling the "AjaxRequestStart" event of the master page RadAjaxManager with the following script (as found on a telerik code library project):

function
OnAjaxManagerRequestStart(ajaxManager, eventArgs)
{
    var arg = eventArgs.EventTarget;

    // If the object initiating this request was an "Export" button (for exporting RadGrid data)
    // cancel the Ajax request so a normal postback occurs. This is required for RadGrid 
    // export functionality to work.
    if (arg.substring(arg.length - 6) == 'Export') eventArgs.EnableAjax = false;
}

It works just fine but, after doing an export, the next time I click to expand/collapse a grouping in my grid, the OnAjaxManagerRequestStart  function continues to recognize the control requesting the AjaxRequest as the RadContextMenu.  As soon as I sort on the grid (or any other action), expand/collapse functionality returns to normal.  Any ideas?

Steve
Top achievements
Rank 2
 answered on 30 Jan 2008
2 answers
101 views
I create RadTreeView and add a context menu
and the handle on context menu click event.

If I put it in an update panel I get java script errors when I use the context menu.
mark
Top achievements
Rank 1
 answered on 30 Jan 2008
2 answers
89 views
Hey there,

I am really new to the RadControls community. I have a Community Server 2007 installation. I would like to replace my current default menu with the RadMenu, but I am having some difficulties. Has anyone here used the RadMenu in CS2007?

I would really appreciate any help you could give me. I have already looked at the demo's but they really don't apply. I need some assistance.

TIA,

John Valentine
John Valentine
Top achievements
Rank 2
 answered on 30 Jan 2008
6 answers
396 views
Hi,

I am using the Prometheus RadComboBox in a custom web control, to display and select place names (with a corresponding place id). In once instance I am using the control on a user profile page to show the user's hometown.

On the custom control I have a public attribute of 'SelectedId' which I use to populate the RadComboBox when the page loads - the id and place name of the user's hometown are turned into a RadComboBoxItemData and is added to the control. This works fine.
public string SelectedId 
        { 
            get 
            { 
                int result; 
                if( !int.TryParse(_RadGroupBox.SelectedValue, out result)) 
                { 
                    result = 0; 
                } 
                return result.ToString(); 
            } 
            set 
            { 
 
                // Place is just a custom object with a name and id.   
                Place place = new Place(Convert.ToInt32(value)); 
                place.PlaceId = Convert.ToInt32(value); 
 
                RadComboBoxItemData itemData = new RadComboBoxItemData(); 
                itemData.Value = value; 
                itemData.Text = GroupFormatter.GetLongDisplayName(place); 
                RadComboBoxItem item = new RadComboBoxItem(itemData.Text, itemData.Value); 
                item.Selected = true; 
                 
                _RadGroupBox.Items.Add(item); 
                _RadGroupBox.SelectedIndex = 0; 
            } 
        } 

My problem when you try use the combobox on the page to change the user's hometown. Using LoadOnDemand, the combox successfully lets you select another place. Debugging client side before posting back the update to the profile, I can confirm that the selected value of the combox is the id of the new place selected.

However, when I postback to the server to try and save the changes, the SelectedId of my custom control always returns the original value, instead of the newly selected value.

In the get section
get 
            { 
                int result; 
                if( !int.TryParse(_RadGroupBox.SelectedValue, out result)) 
                { 
                    result = 0; 
                } 
                return result.ToString(); 
            } 

My _RadGroupBox.SelectedValue always holds onto the original value. The setter is not being hit, so I know that the control is not being repopulated from the database. At the same time, the _RadGroupBox.Text correctly contains the new selected place name. It is just the SelectedValue that is not being passed in.

Hopefully this makes some sense to you. I understand its hard to follow unless you can see the whole project, but hopefully you might be able to offer some advice.

Thanks,
Martin


Martin
Top achievements
Rank 2
 answered on 30 Jan 2008
1 answer
143 views
Could you please provide me a solution to reorder Treeview nodes, e.g. move up , move down solution between nodes using Linq and Sql server.

Thank you.
Nikolay
Telerik team
 answered on 30 Jan 2008
3 answers
180 views
Do you have, or could you post a simple example that uses code behind instead of sqldatasource object for data access/updates? Something like the example here would be great.

Thanks!
Peter
Telerik team
 answered on 30 Jan 2008
6 answers
490 views
Hi, I'm facing a really weird problem and I need some help.  Here's what I'm trying to do:  I have a main page containing user controls.  On my main page, when I click a button I display the content of one of my user control that contains a king of popup window with a combobox in it (combo box populated by a call to a distant server).  Until then everything works fine.  In this same popup, I have a button that is once clicked, a call to a web service is done so I retrieve the selected item in the combobox and I do some operations on it.  Again, until then everything's fine. 

The problem is that after the call to the server, the combo box stops working.  I do not reload the page, I use a RadAjaxManager in my main page to manage what is supposed to be updated in the page, so the main page and the user controls are not reloaded after the server call.  My popup window remains displayed and absolutely nothing happens when I click on the combobox.  I tried to use the ComboBox from RadControls for ASP.NET (not Prometheus), and it seems to be working.  The problem is that I cannot use it because of a bug with safari (reported by mathieu last monday).


Here's some code example to help understand the problem:

MainPage.aspx

<html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Bidon</title>
        <link rel="stylesheet" type="text/css" href="css/main.css" media="all" />
        <link rel="stylesheet" type="text/css" href="css/input.css" media="all" />
        <link rel="stylesheet" type="text/css" href="Prometheus/Vista/ComboBox.Vista.css" />
        <script src="js/input.js" type="text/javascript"></script>
        <script src="js/validation.js" type="text/javascript"></script>
    </head>
    <body>
        <form id="form1" runat="server">
            <radA:RadAjaxManager ID="RadAjaxManager1" runat="server">
            </radA:RadAjaxManager>
            <div>
                <button id="Button1" onclick="document.getElementById('healthQuestionnaire_mhContainer').style.display='block'; return false;" >Button</button>
                <div id="divHQ" runat="server" ><questionnaire id="healthQuestionnaire" runat="server"></questionnaire></div>
            </div>
        </form>
    </body>
</html>

MainPage.aspx.cs (I initilialize the radajaxmanager dynamicaly)

protected void Page_Load(object sender, EventArgs e)
        {
                //Get the WebUserControl
                UserControl MyControl = (UserControl)Page.FindControl("healthQuestionnaire");

                //Get user control's button and label
                Button MyButton = (Button)MyControl.FindControl("btnOk");
                HtmlGenericControl MyDiv = (HtmlGenericControl)MyControl.FindControl("mhContainer");

                //Add the necessary AJAX setting programmatically
                RadAjaxManager1.AjaxSettings.AddAjaxSetting(MyButton, MyDiv);
              
        }


UserControl.ascx

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="healthQuestionnaire.ascx.cs" Inherits="doctorPhone.signup.healthQuestionnaire" %>
<%@ Register Assembly="RadGrid.Net2" Namespace="Telerik.WebControls" TagPrefix="radG" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI" TagPrefix="asp" %>


<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<div id="mhContainer" runat="server" class="entireErrMsg" style="display: none;" >
    <div id="mhBox" runat="server" class="errorMsgBox" style="height: 150px;">
        <img src="images/messageBox/CornerLeft.png" alt="img" />
        <div runat="server" id="mhTitleBar" class="msgBorderTop" ></div>
        <img src="images/messageBox/CornerRight.png" alt="img" />
        <div class="msgBorderLeft" ></div>
        <div class="msgBoxContentArea" >
            <table style="width: 100%; height: 100%;">
                <tr>
                    <td style="width: 25%;">
                        <div class="text13_383838" style="float: right; margin-top: 15px;">Condition</div>
                    </td>
                    <td style="width: 75%;" >
                        <div style="float: right; margin-top:15px;">
                            <img style="margin-left:10px;" src="Prometheus/Vista/ComboBox/dropBoxLeftOFF.gif" id="imgPatientConditions_Input"  />
                            <telerik:RadComboBox Width="239px"  EnableEmbeddedSkins="False"  Skin="Vista" ID="patientConditions"
                                runat="server" DataTextField="name" DataValueField="code" EnableLoadOnDemand="true" MarkFirstMatch="True" OnItemsRequested="patientConditions_ItemsRequested" >
                                <CollapseAnimation Duration="200" Type="OutQuint" />
                                <ExpandAnimation Type="OutQuart" />
                            </telerik:RadComboBox>
                        </div>
                    </td>
                </tr>
                <tr style="height: 40px;">
                    <td colspan="2" style="width: 395px; height: 40px; vertical-align:middle;" >
                        <div style="float: right;">
                            <div style="padding-right: 8px;" onmousedown="dpButtonMouseDown('btnCancelLeft','btnCancel','btnCancelRight')" onmouseup="dpButtonMouseUp('btnCancelLeft','btnCancel','btnCancelRight')" onmouseout="dpButtonMouseUp('btnCancelLeft','btnCancel','btnCancelRight')">
                                <img id="btnCancelLeft" src="images/buttons/btnLeftUp.png" alt="img" />
                                <button id="btnCancel" onclick="document.getElementById('healthQuestionnaire_mhContainer').style.display='none'; return false;" class="dpButton">Cancel</button>
                                <img id="btnCancelRight" src="images/buttons/btnRightUp.png" alt="img" />
                            </div>
                            <div onmousedown="dpButtonMouseDown('healthQuestionnaire_btnOkLeft','healthQuestionnaire_btnOk','healthQuestionnaire_btnOkRight')" onmouseup="dpButtonMouseUp('healthQuestionnaire_btnOkLeft','healthQuestionnaire_btnOk','healthQuestionnaire_btnOkRight')" onmouseout="dpButtonMouseUp('healthQuestionnaire_btnOkLeft','healthQuestionnaire_btnOk','healthQuestionnaire_btnOkRight')">
                                <img id="healthQuestionnaire_btnOkLeft" src="images/buttons/btnLeftUp.png" alt="img" />
                                <asp:Button id="btnOk" runat="server" CssClass="dpButton" Text="OK" OnClick="btnOk_Click" ></asp:Button>
                                <img id="healthQuestionnaire_btnOkRight" src="images/buttons/btnRightUp.png" alt="img" />
                            </div>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
        <div class="msgBorderRight" ></div>
        <img src="images/messageBox/FooterLeft.png" alt="img" />
        <div class="msgBorderBottom" ></div>
        <img src="images/messageBox/FooterRight.png" alt="img" />
    </div>
</div>



UserControl.ascx.cs

public partial class healthQuestionnaire : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
                conditionDTO[] dtos = searchConditions(null);

                //Bind to datagrid
                patientConditions.DataSource = dtos;
                patientConditions.DataBind();
        }

        public conditionDTO[] searchConditions(String searchCriteria)
        {
            //Bind to webservice
            HealthServiceWS myService = new HealthServiceWS();
            conditionDTO[] dtos = myService.getConditions(new appSessionDTO(), searchCriteria);

            return dtos;
        }

        protected void patientConditions_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
            RadComboBox combo = (RadComboBox)o;
            combo.Items.Clear();
            conditionDTO[] dtos = searchConditions(e.Text);

            foreach (conditionDTO dto in dtos)
            {
                RadComboBoxItem item = new RadComboBoxItem(dto.name);
                item.Value = dto.code.ToString();
                combo.Items.Add(item);
            }
        }

        protected void btnOk_Click(object sender, EventArgs e)
        {
            HttpCookie authCookie = Request.Cookies[CookieAttributes.COOKIE_NAME];
            HealthServiceWS myService = new HealthServiceWS();
            patientConditionDTO patientCondition = new patientConditionDTO();
            patientCondition.patientId = Int32.Parse(authCookie.Values.Get(CookieAttributes.ATT_PATIENT_ID));
            patientCondition.conditionId = Int32.Parse(patientConditions.SelectedItem.Value);
            myService.addPatientCondition(new appSessionDTO(), patientCondition);
            mhContainer.Style["display"] = "block";

           
        }
    }




Thx for the help
Phil
Tim
Top achievements
Rank 1
 answered on 30 Jan 2008
1 answer
181 views
We are unable to locate the photoshop files for the default 2006 menu skin. Can someone please post it or point me to the correct url to download.

Thanks,
Kevin
Alex Gyoshev
Telerik team
 answered on 30 Jan 2008
1 answer
118 views
I have a RadWindow that will display different content based on what the user selects from the parent window.  Therefore, I don't want the form to display what was shown before; I want to destroy the RadWindow and open it new each time.  However, after its first load and subsequent close, the next open of the window ignores the formatting that included in the RadWindowManager (size, skin, etc.).

Can I destroy the window on close and get it to display correctly again?

Thank You,

David Nowak.
Georgi Tunev
Telerik team
 answered on 30 Jan 2008
2 answers
670 views
My treeview uses skin = MAC. And, I changed the fore color = white. However, it does apply. How can I change the node's font color?
Fernandes
Top achievements
Rank 1
 answered on 30 Jan 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?