Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
89 views
Hello,

I need to do a real postback  from a DockCommand button with a response redirect, how to obtain this ?

Thanks
CS
Obi-Wan Kenobi
Top achievements
Rank 1
 answered on 09 Apr 2008
3 answers
289 views
Hello guys,


I have a problem with the Prometheus combobox when trying to set a datasource dynamically.  Here how I'm set up:  I have a combo box that is part of an update panel and the combo box list of items can be very very long (many thousands items).  Since I dont want to transfer all these items (accessed by web service) and set it to the combobox datasource, I'm trying to set the datasource in the OnItemsRequested server side method when the user type 3 or more charaters in the combobox (the allow custom text is set to true and when there is 3 characters or more that are typed, in the OnItemsRequested method I call the web service and set the datasource).

The server side code that set the datasource id very simple, it looks like this:

try
{
      RadComboBox combo = (RadComboBox)o;
      combo.Items.Clear();
      conditionDTO[] dtos = searchConditions(e.Text);
       if (dtos != null)
       {
            foreach (conditionDTO dto in dtos)
            {
                RadComboBoxItem item = new RadComboBoxItem(dto.name);
                item.Value = dto.code.ToString();
                combo.Items.Add(item);
              }
        }

        combo.DataSource = dtos;
        combo.DataBind();
        ((UpdatePanel)Page.FindControl("UpdatePanelPop")).Update();
}




I make a call to the web service, set the datasource to the combobox, call databind and update my update panel. On the UI, the dropdown contains the proper items, but if I select one from the list and do a callback,  the SelectedItem on the combobox is always null (and the combobox datasource also).

Here's what the combobox definition looks like:

<telerik:RadComboBox Width="239px" Height="200px" EnableEmbeddedSkins="False" ID="selNoBlankPatientConditions" AllowCustomText="true" runat="server" DataTextField="name" DataValueField="code" EnableLoadOnDemand="true" MarkFirstMatch="True" MaxLength="50" OnItemsRequested="conditions_ItemsRequested" Text="Type or select your condition here..." >
     <CollapseAnimation Duration="200" Type="OutQuint" />
     <ExpandAnimation Type="OutQuart" />
</telerik:RadComboBox>


I really need help on this one!

Thx,
Phil
Simon
Telerik team
 answered on 09 Apr 2008
2 answers
173 views

It only works in my javascript function - Telerik.Web.UI.InputErrorReason.OutOfRange.  But the actual calendar still let's me pick between 1980 and 2099. 

Even though the mindate is set to 01/01/2008 and the maxdate is set to 03/29/2008.  I'm passing 2 parameters/properties into the usercontrol.  

public
DateTime DateFrom

{

get { return this.RadDatePicker1.MinDate; }

set { this.RadDatePicker1.MinDate = value; }

}

public DateTime DateTo

{

get { return this.RadDatePicker1.MaxDate; }

set { this.RadDatePicker1.MaxDate = value; }

}




 

Maria Ilieva
Telerik team
 answered on 09 Apr 2008
5 answers
142 views
I am trying to get a node in a tree view to have a back color that spans all the way across the page. But when i applie the background color it only goes as far as the text. Is there a way to do this? I have also tried to change the size of the node but that seems to make no difference.
Nikolay
Telerik team
 answered on 09 Apr 2008
3 answers
275 views

I want to do this dynamically in the codebehind.  Is that possible?

<
HeaderTemplate>

<div>

<table style="width: 100%;" border="0" cellspacing="0" cellpadding="0">

<tr>

<td style="width: 25%;">

User Id

</td>

<td style="width: 25%;">

Name

</td>

<td style="width: 50%;">

Depart

</td>

</tr>

</table>

</div>

</HeaderTemplate>

<ItemTemplate>

<table style="width: 100%;" cellspacing="0" cellpadding="0">

<tr>

<td style="width: 25%;">

<div >

<%

# DataBinder.Eval(Container.DataItem, "id")%>

</div>

</td>

<td style="width: 25%;">

<div >

<%

# DataBinder.Eval(Container.DataItem, "name") %>

</div>

</td>

<td style="width: 50%;">

<div >

<%

# DataBinder.Eval(Container.DataItem, "dep")%>

</div>

</td>

</tr>

</table>

</ItemTemplate>

Rosi
Telerik team
 answered on 09 Apr 2008
3 answers
164 views
I have a RadComboBox control with some special logic in its ItemsRequested event. I would like to encapsulate this logic into a server control that I can reuse within my solution. If I simply derive from RadCombBox and wire up this event my custom logic, it clearly does not work as the ItemsRequested event never fires. How would I go about solving this one?
Rosi
Telerik team
 answered on 09 Apr 2008
1 answer
375 views
Hi,

For some reason, if an IFRAME is present on an ASPX page with a RadWindow declared, the window cannot be detected. This problem happens in both FF and IE7.

In the code below, oWnd always returns null. If the IFRAME line is commented out, the popup appears fine when the link is clicked on.

Any idea what might be the problem?


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="testradwindowiframe.aspx.cs" Inherits="Test_testradwindowiframe" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<html> 
<head> 
</head> 
<body> 
<form id="form1" runat="server"> 
    <script language="javascript" type="text/javascript"> 
        var oWnd; 
        function Test(wizardID) 
        { 
            oWnd = $find( '<%= TestPopupWindow.ClientID %>' ); 
             
            oWnd.setUrl('http://www.yahoo.com'); 
            oWnd.show();   
        }     
         
        function TestClientCallBack(radWindow, returnParameters) 
        { 
         
        } 
               
    </script> 
 
 
 
    <asp:ScriptManager ID="ScriptManager1" runat="server" />  
    <telerik:RadWindowManager id="Singleton" runat="server" Skin="Vista"> 
        <windows> 
            <telerik:RadWindow ID="TestPopupWindow" runat="server" Height="300" Width="300"  
                DestroyOnclose="false"     
                Modal="true" 
                VisibleStatusbar="false" 
                VisibleTitlebar = "true" 
                NavigateUrl=""     
                Title = "Test"          
                Behaviors="Close,Move" 
                ClientCallBackFunction="TestClientCallBack" 
            /> 
        </windows> 
         
         </telerik:RadWindowManager> 
 
    <a href="javascript:void(0)" onclick="javascript:Test(0)">Test(0)</a>   
 
    <iframe id="ViewWizardSummaryIFrame" width="20" height="20"/>  
 
    <p>Test Page</p> 
    </form> 
</body>         
 
</html> 




Georgi Tunev
Telerik team
 answered on 09 Apr 2008
1 answer
308 views
I am using a RadGrid that has up to 30 skinny columns with 3 characters each.  When I ExportToPDF() they overlap themselves and they appear stacked.  I read the documentation and altered the ItemStyle and AlternatingStyle but no change even with IgnorePaging set to true.  I am using a Skin on the Grid itself for appearance which is the Vista skin.  Is there anyway to have the export PDF use a small font for export purposes but still use skin for visual appearance?

Also.....can I force it to be landscape orientation?

Using Telerik.Web.UI 2007.3.1425.20

Thanks in advance.
Doug
Steve
Telerik team
 answered on 09 Apr 2008
4 answers
221 views
Hi,
I have created a menu and inserted separator items between each button item, but I want the space to be blank. I set
text = ""
isSeparator = True
width = 5

The menu renders as I had expected in IE7, with a gap between each button image, but in firefox and safari, the separator is ignored.
I have tried setting text = " " to no avail. Adding a character such as "|" does cause the separator to be rendered.

Is there a workaround for this?

Thanks

Rob
Veselin Vasilev
Telerik team
 answered on 09 Apr 2008
3 answers
515 views

I have a RadTextBox and an ASP checkbox. 
 
<telerik:RadTextBox ID="igcWebTxtEvent" runat="server" Skin="Outlook" Width = "530px"  CausesValidation="True" Font-Bold="False" ForeColor="DarkSlateGray" >
</telerik:RadTextBox>

<asp:CheckBox ID="chkOmitEvent" runat="server" TextAlign="Left" ToolTip="Omit" OnCheckedChanged="chkOmitEvent_CheckedChanged" />


The design time skin for the RadTextBox is "Outlook". Now when the user clicks on the textbox, the background color of the RadTextBox is changed to LemonChiffon. This is done on the client side through JAVASCRIPT which is attached to the checkbox in the behind code in the page load event.

Behined Code:
chkOmitEvent.Attributes.Add("OnClick", "javascript:  return setTextBoxBackgroundColor('" + igcWebTxtEvent.ClientID.ToString() + "','" + chkOmitEvent.ClientID.ToString() + "');");

Client side javascript:
var  originalStyle="";

function setTextBoxBackgroundColor(textBoxID, checkBoxID)
{
      
    var TextBox = $find(textBoxID); 
          
    var retVal = document.getElementById(checkBoxID).checked;
   
    if(retVal)  
    {
        originalStyle =   TextBox.get_styles().EnabledStyle[0];
        TextBox.get_styles().EnabledStyle[0] += "background-color: lemonchiffon;";
    }
    else
        TextBox.get_styles().EnabledStyle[0] = originalStyle;
   
    TextBox.updateCssClass();
    return true;           
}

On the client side everything works like it should, when the the RadTextbox is focused or hovered the color becomes white, which is due to the outlook skin, and otherwise its background color is lemon.

Since this happend at the client side, when the submit button is pressed, there is an event handler on the server side:

All the original values are obtained before postback in the page load event, which happen to be "None".

On Page load before postback:

 if (!Page.IsPostBack){
                    originalEnabledColor = igcWebTxtEvent.EnabledStyle.BackColor;                    originalFocusedColor = igcWebTxtEvent.FocusedStyle.BackColor ;
                    originalHoverColor=igcWebTxtEvent.HoveredStyle.BackColor ;
}

Check box server side event handler:

  protected void chkOmitEvent_CheckedChanged(object sender, EventArgs e)
        {

            if (chkOmitEvent.Checked)
            {                
                igcWebTxtEvent.EnabledStyle.BackColor=  
System.Drawing.Color.LemonChiffon;                                
                               igcWebTxtEvent.FocusedStyle.BackColor = originalFocusedColor;               
igcWebTxtEvent.HoveredStyle.BackColor = originalHoverColor;                
            }
            else
            {
                 igcWebTxtEvent.EnabledStyle.BackColor = originalEnabledColor;
                igcWebTxtEvent.FocusedStyle.BackColor = originalFocusedColor;
                igcWebTxtEvent.HoveredStyle.BackColor = originalHoverColor;

            }

        }

Now the problem is that after the server event is called after postback, all colors become lemon, when hovered/focused. And this behavior propogates since the client side function only sets the enabled color and not the focused/hovered colors. So even when the checkbox is unchecked, the hovered/focused colors remain lemon.

However the "else" part of the if condition (when the skin behavior is restored) 

  else
            {
                 igcWebTxtEvent.EnabledStyle.BackColor = originalEnabledColor;
                igcWebTxtEvent.FocusedStyle.BackColor = originalFocusedColor;
                igcWebTxtEvent.HoveredStyle.BackColor = originalHoverColor;

            }


works fine when it is restored after a postback. And the main observation is that if I do not add the following two lines:
                igcWebTxtEvent.FocusedStyle.BackColor = originalFocusedColor;
                igcWebTxtEvent.HoveredStyle.BackColor = originalHoverColor;

the hover/focused background colors remain lemon whereas the enabled style one is the same as the skin which is blue. Because my understanding was setting the enabled style background color sets all background colors as is the case when I am setting it to Lemon but not the case when I am setting it to its original color. Original backcolor also happens to be "None". Which is why I guess this is happening.  

This is what I am looking for ideally:

1. When a checkbox is checked, the enabled backcolor becomes lemon however focused/hovered remain white
2. When the the checkbox is unchecked, the original skin behavior is restored.

This has to be handled on both client side and server side due to postbacks. On client side it is working fine. However, on the server side it is not.

Is there any other way of acheiving this?  I tried to play around with the style attributes, css attributes on the server side but got nothing to work.

Any help would be greatly appreciated.

Thanks,
Tal





plamen
Top achievements
Rank 1
 answered on 09 Apr 2008
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?