Telerik Forums
UI for ASP.NET AJAX Forum
8 answers
213 views

 

Please take look at the following code:

 

<telerik:RadTextBox runat="server" ID="txtAddress" Text="Test Text" TextMode="MultiLine"  Rows="2"  Skin="WebBlue"/>  
<asp:Button runat="server" ID="btnReset" OnClientClick="document.forms[0].reset();return false;"  Text="Reset" UseSubmitBehavior="false" /> 
 

Let's enter some new text in the input text box and then click on the Reset button.

In FireFox 3.5.6.
    -Text box will be cleared
In IE 8 
    -Text box is not changed

In both cases original text will be displayed only when you give focus to text box.

Dimo
Telerik team
 answered on 11 Feb 2010
3 answers
103 views
Hi

I am experiencing issues when setting an image to align left or right. Instead of applying inline styles e.g. float:right, it is applying an attribute align="right". In the ConfigFile.xml I have set

  <property name="ConvertToXhtml">True</property>

Is there anything I am missing?

I am using rad editor lite 4.5.6

Thanks

Natasha



Stanimir
Telerik team
 answered on 11 Feb 2010
1 answer
77 views
On your demo:
http://demos.telerik.com/aspnet-ajax/editor/examples/default/defaultcs.aspx
You can not click an image to get the nodes or right click to get properties when using Safari 4.0.4.


Rumen
Telerik team
 answered on 11 Feb 2010
1 answer
81 views
it doesn't call check() function within RadAjaxManager1_AjaxRequest() while timer is controlled within radajaxmanager.
anyone help me. plz.
thx.


<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
        <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="Timer1">
        <UpdatedControls >
        <telerik:AjaxUpdatedControl ControlID="HiddenField1"/>
        </UpdatedControls>
        </telerik:AjaxSetting>
        </AjaxSettings>
        </telerik:RadAjaxManager>
        <asp:HiddenField ID="HiddenField1" runat="server" />
        <asp:HiddenField ID="HiddenField2" runat="server" />
        <br />
        <asp:Timer ID="Timer1" runat="server" Interval="3000" OnTick="Timer1_Tick">
        </asp:Timer>
 <telerik:RadScriptBlock runat="server" ID="sctblk">
        <script type="text/javascript">
 function checkval() {
 
  if (document.getElementById("HiddenField1").value == "ajax") {
        var result = confirm("Are you sure accept the users?");
        if (result) {
        var ajaxManager = $find("<%=RadAjaxManager1.ClientID %>");
        ajaxManager.ajaxRequest('yes');
            return ;
            
        }
        else {
            var ajaxManager = $find('<%= RadAjaxManager1.ClientID %>');
             ajaxManager.ajaxRequest('no');
            return;
        }
        }
    }

function check()
{
alert("check_request");
}
</script>


 function checkval() {
 alert("check");
  if (document.getElementById("HiddenField1").value == "ajax") {
        var result = confirm("Are you sure accept the users?");
        if (result) {
       // alert("if");
       //var ajaxManager="<%=RadAjaxManager1.ClientID %>";
          var ajaxManager = $find("<%=RadAjaxManager1.ClientID %>");

          //  alert(ajaxManager);
            //document.getElementById("HiddenField2").value="if";
            document.getElementById("HiddenField1").value ="kkk";
            ajaxManager.ajaxRequest('yes');
            return ;
            
        }
        else {
     //   alert("else");
        
            var ajaxManager = $find('<%= RadAjaxManager1.ClientID %>');
           // alert(ajaxManager);
          //  document.getElementById("HiddenField2").value="else";
                      document.getElementById("HiddenField1").value ="kkk";

            ajaxManager.ajaxRequest('no');
            return;
        }
        }
    }
</script>
protected void Timer1_Tick(object sender, EventArgs e)
    {
        
        HiddenField1.Value = "ajax";
        string loadscript2 = "function f(){checkval()} Sys.Application.add_load(f);";
        ScriptManager.RegisterStartupScript(this, this.GetType(), "loadscript2", loadscript2, true);
}
protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
    {
        Timer1.Enabled = false;
        if (e.Argument == "yes")
        {          
         MessageBox.Show("yes");
        string loadscript3 = "check();";
        ScriptManager.RegisterStartupScript(this, this.GetType(), "loadscript3", loadscript3, true);
        }
 else
        {
            MessageBox.Show("no");
         }




Iana Tsolova
Telerik team
 answered on 11 Feb 2010
3 answers
71 views
Hi

I have a simple grid connected to an nhibernate collection. All works fine bar the sorting.
When a user clicks on a header column to sort, if the word in the header is click it will sort asc. More clicks on the header on the word have no effect - column remains sorted asc. However if the sort icon is clicked the next column is sorted and marked as sorted?? and so on..

Anyone seen this behaviour before?

Regards
Kieran
Pavlina
Telerik team
 answered on 11 Feb 2010
1 answer
120 views
Dear Sir,
    As you noticed in the thread title i am writing RadWindowManagers, i will descripe the following scenario:
one aspx page that contains one RadTabStrip and one RadMultiPage, inside each RadPageView we have one UserControl, inside each UserControl we have RadWindowManager and at least two RadWindow. i was having a problem with a script:

var manager = GetRadWindowManager();  
// txtShowWindow is the id of a textarea on the page  
var window1 = manager.getWindowByName('rwMap');  
var MapInput =  $find('<%=txt_Location.ClientID%>');  
var MapInputValue = MapInput.get_value();  
var Latval = 0;  
var Longval = 0;  
if (MapInputValue.length > 0)  
{  
Latval = MapInputValue.split(',')[0];  
Longval = MapInputValue.split(',')[1];  
}  
window1.setUrl('Map.aspx?Lat=' + Latval + '&Long=' + Longval);  
window1.show();  
window1.maximize(); 

which is in the UserControl, i thought the problem was the [manager.getWindowByName('rwMap')] part but i investigat the problem, and found that the RadWindowManager in the first RadPageView is the only accessable even if i am in the second Tab, the second RadWindowManager is not accessable, that's why the function was returning null when i was trying to get the RadWindow.
Georgi Tunev
Telerik team
 answered on 11 Feb 2010
3 answers
259 views
I have a treeview, with checkboxes=true, tristatecheckboxes=true, and want to use checkchildnodes=true, but, I want to not have certain child nodes, with a certain attribute value, to be auto-checked, these nodes are always at the bottom/lowest level of the tree.

if I try to spin my own checking logic, with checkchildnodes=false, the tristate checking stuff does not work right, I check a higher level node, and it goes full check, it seems there is no method of setting the check state to indeterminate, so I can only check, or uncheck the higher level nodes, so, it seems I can't conditionally set them to indeterminate if I find some nodes as children I don't want to check.

and, unchecking nodes is proving problematic as well, higher level nodes don't uncheck as expected when checkchildnodes=false, and child nodes are unchecked, they don't uncheck (higher level nodes with no child nodes checked).

any hints on some approach to simulate the auto checking logic, setting check state to other than checked/unchecked, or?
Yana
Telerik team
 answered on 11 Feb 2010
2 answers
128 views
hi all,
  I want to filter grid accoridng to the textbox value. I initiate ajax request in 'keyup' client event of textbox and write filter code in the ajax request event. But when i added ajax settings for reax requestmanager i shoing dome null refernce script error. Can anyone give me what i did wrongly?

Check the attached file for error screenshot

Design Code :
<body> 
    <form id="form1" runat="server" dir="ltr">  
            <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">  
                <script type="text/javascript">  
                    var timer = null;  
 
                    function KeyUp() {  
                        if (timer != null) {  
                            clearTimeout(timer);  
                        }  
                        timer = setTimeout(LoadTable, 100);  
                    }  
 
                    function LoadTable() {  
                        $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("SearchGrid");  
                    }  
                </script> 
            </telerik:RadCodeBlock> 
        <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">  
        </telerik:RadScriptManager> 
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Runat="server" IsSticky="true"    
            Skin="Default">  
        </telerik:RadAjaxLoadingPanel> 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"   
            UpdatePanelsRenderMode="Inline" DefaultLoadingPanelID="RadAjaxLoadingPanel1"   
            onajaxrequest="RadAjaxManager1_AjaxRequest">  
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="rad_grd_Resource" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
              
                <telerik:AjaxSetting AjaxControlID="rad_ts_Main">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="rad_ts_Main" /> 
                        <telerik:AjaxUpdatedControl ControlID="rad_mp_Main" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
               <telerik:AjaxSetting AjaxControlID="btn_GetFiles">  
                    <UpdatedControls> 
                         <telerik:AjaxUpdatedControl ControlID="RadAjaxManager1" /> 
                        <telerik:AjaxUpdatedControl ControlID="rad_cmb_FileName" /> 
                        <telerik:AjaxUpdatedControl ControlID="rad_cmb_Language" /> 
                        <telerik:AjaxUpdatedControl ControlID="btn_LoadResource" /> 
                        <telerik:AjaxUpdatedControl ControlID="rad_grd_Resource" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
                <telerik:AjaxSetting AjaxControlID="rad_cmb_FileName">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="rad_cmb_Language" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
                <telerik:AjaxSetting AjaxControlID="btn_LoadResource">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="rad_grd_Resource" /> 
                        <telerik:AjaxUpdatedControl ControlID="rad_cmb_Filter" /> 
                        <telerik:AjaxUpdatedControl ControlID="btn_AddKeys" /> 
                        <telerik:AjaxUpdatedControl ControlID="btn_Save" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
                 <telerik:AjaxSetting AjaxControlID="rad_cmb_Filter">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="rad_grd_Resource" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting>                 
                <telerik:AjaxSetting AjaxControlID="btn_AddKeys">  
                    <UpdatedControls> 
                       <telerik:AjaxUpdatedControl ControlID="rad_mp_Main" /> 
                        <telerik:AjaxUpdatedControl ControlID="rad_grd_NewKeys" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
                <telerik:AjaxSetting AjaxControlID="btn_Save">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="rad_grd_Resource"   
                            LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
       
     <telerik:RadTabStrip ID="rad_ts_Main" runat="server" MultiPageID="rad_mp_Main"   
            ontabclick="rad_ts_Main_TabClick"  > 
        <Tabs> 
            <telerik:RadTab runat="server" PageViewID="pv_Editor" Text="Resource Editor"   
                Selected="True"></telerik:RadTab> 
            <telerik:RadTab runat="server" PageViewID="pv_NewKey" Text="New Keys"></telerik:RadTab> 
        </Tabs> 
    </telerik:RadTabStrip> 
     <telerik:RadMultiPage ID="rad_mp_Main" runat="server" SelectedIndex="0">  
        <telerik:RadPageView ID="pv_Editor" runat="server">  
            <table width="98%"  > 
            <tr> 
                <td colspan="3" width="90%">  
                    <asp:TextBox ID="txt_Directory" runat"server" Width="500px" ></asp:TextBox>   
                    <asp:Button ID="btn_GetFiles" runat="server" Text="Get Resources" OnClick="btn_GetFiles_onClick" /> 
                </td> 
                <td width="10%" align="right">  
                    <telerik:RadTextBox ID="rad_txt_Search" runat="server" SelectionOnFocus="CaretToEnd" EmptyMessage="Search" onkeyup="KeyUp();"></telerik:RadTextBox> 
                </td> 
            </tr> 
            <tr> 
            <td width="40%">  
                Select Resource : <telerik:RadComboBox ID="rad_cmb_FileName" runat="server" AutoPostBack="true" Width="230px"   
                    onselectedindexchanged="rad_cmb_FileName_SelectedIndexChanged">  
                </telerik:RadComboBox>          
            </td> 
            <td width="32%" > 
                Language : <telerik:RadComboBox ID="rad_cmb_Language" runat="server" Width="200px" > 
                </telerik:RadComboBox>          
                  
            </td> 
            <td width="18%" align="right">  
                <asp:Button ID="btn_LoadResource" runat="server" Text="Load Rosource" OnClick="btn_LoadResource_onClick" /><br /> 
            </td> 
            <td width="10%">  
                <telerik:RadComboBox ID="rad_cmb_Filter" runat="server" AutoPostBack="true" Width="130px" onselectedindexchanged="rad_cmb_Filter_SelectedIndexChanged"></telerik:RadComboBox> 
            </td> 
            </tr> 
            <tr> 
                <td colspan="4">  
                    <asp:Label ID="lblError" runat"server" ForeColor="Red" Font-Size="Small"></asp:Label> 
                </td> 
            </tr> 
            <tr> 
            <td colspan="4">  
                <telerik:RadGrid ID="rad_grd_Resource" runat="server"   
                    AutoGenerateColumns="false" Height="360"   
                    onitemdatabound="rad_grd_Resource_ItemDataBound"   
                    onitemcreated="rad_grd_Resource_ItemCreated"   
                    onprerender="rad_grd_Resource_PreRender" > 
                <ClientSettings > 
                <Scrolling AllowScroll="true" UseStaticHeaders="true" /> 
                </ClientSettings> 
                    <MasterTableView > 
                        <Columns> 
                            <telerik:GridTemplateColumn UniqueName="Key" HeaderText="Key" DataType="System.String" > 
                                <ItemTemplate> 
                                    <asp:Label ID="lbl_it_Key" runat="server" Width="75%" Text='<%#Eval("Key") %>'></asp:Label> 
                                </ItemTemplate> 
                           </telerik:GridTemplateColumn> 
                            <telerik:GridTemplateColumn UniqueName="ValueDefault" HeaderText="Value - Default" > 
                                <ItemTemplate> 
                                    <asp:TextBox ID="txt_it_ValueDefault" runat="server" Width="75%" Text='<%#Eval("ValueDefault") %>'></asp:TextBox> 
                                </ItemTemplate> 
                          </telerik:GridTemplateColumn> 
                            <telerik:GridTemplateColumn UniqueName="Value" HeaderText="Value" > 
                                <ItemTemplate> 
                                    <asp:TextBox ID="txt_it_Value" runat="server" Width="75%" Text='<%#Eval("Value") %>'></asp:TextBox> 
                                </ItemTemplate> 
                            </telerik:GridTemplateColumn> 
                            
                        </Columns> 
                        <NoRecordsTemplate> 
                        </NoRecordsTemplate> 
                    </MasterTableView> 
                     
                </telerik:RadGrid> 
            </td> 
            </tr> 
            <tr> 
            <td width="40%">&nbsp;</td> 
            <td width="32%">&nbsp;</td> 
            <td colspan="2" width="28%" align = "right">  
                <asp:Button ID="btn_AddKeys" runat="server" Text="Add New Keys" OnClick="btn_AddKeys_onClick" /> 
                <asp:Button ID="btn_Save" runat="server" Text="Save" OnClick="btn_Save_onClick" /> 
            </td> 
            </tr> 
            </table> 
        </telerik:RadPageView> 
        <telerik:RadPageView ID="pv_NewKey" runat="server">  
            <table width="100%">  
                <tr> 
                <td width="70%">  
                    <asp:Label ID="lblErrorKeys" runat"server" ForeColor="Red" Font-Size="Small"></asp:Label> 
                </td> 
                <td width="30%">  
                    Page Prefix : <telerik:RadTextBox ID="rad_txt_PagePrefix" runat="server"></telerik:RadTextBox> 
                </td> 
                </tr> 
                <tr> 
                    <td colspan="2">  
                        <telerik:RadGrid ID="rad_grd_NewKeys" runat="server"   
                            AutoGenerateColumns="false" Width="98%" Height="400px"   
                            onitemcommand="rad_grd_NewKeys_ItemCommand"   
                            oneditcommand="rad_grd_NewKeys_EditCommand"   
                            oncancelcommand="rad_grd_NewKeys_CancelCommand"   
                            onupdatecommand="rad_grd_NewKeys_UpdateCommand" > 
                            <MasterTableView ShowFooter="true" EditMode="InPlace" > 
                                <Columns> 
                                    <telerik:GridTemplateColumn UniqueName="NewKey" HeaderText="Key" HeaderStyle-Width="50%" > 
                                        <ItemTemplate> 
                                            <asp:Label ID="lbl_it_Key" runat="server" Width="75%" Text='<%#Eval("Key") %>'></asp:Label> 
                                        </ItemTemplate> 
                                        <FooterTemplate> 
                                            <asp:TextBox ID="txt_ft_Key" runat="server" Width="75%" ></asp:TextBox> 
                                        </FooterTemplate> 
                                    </telerik:GridTemplateColumn> 
                                    <telerik:GridTemplateColumn UniqueName="NewValue" HeaderText="Value"  HeaderStyle-Width="35%" > 
                                        <ItemTemplate> 
                                            <asp:Label ID="txt_it_Value" runat="server" Width="75%" Text='<%#Eval("Value") %>'></asp:Label> 
                                        </ItemTemplate> 
                                        <EditItemTemplate> 
                                             <telerik:RadTextBox ID="rad_txt_et_Value" runat="server" Width="200px" ></telerik:RadTextBox> 
                                        </EditItemTemplate>    
                                        <FooterTemplate> 
                                            <asp:TextBox ID="txt_ft_Value" runat="server" Width="75%" ></asp:TextBox> 
                                        </FooterTemplate> 
                                    </telerik:GridTemplateColumn> 
                                    <telerik:GridTemplateColumn UniqueName="AddKeyColumn" HeaderText="Edit"  HeaderStyle-Width="15%">  
                                    <ItemTemplate> 
                                        <asp:LinkButton ID="lnkbtn_it_Edit" runat="server" CommandName="Edit" Text="Edit"></asp:LinkButton> 
                                    </ItemTemplate> 
                                    <EditItemTemplate> 
                                        <asp:LinkButton ID="lnkbtn_et_Update" runat="server" CommandName="Update" Text="Update"></asp:LinkButton> 
                                        <asp:LinkButton ID="lnkbtn_et_Cancel" runat="server" CommandName="Cancel" Text="Cancel"></asp:LinkButton> 
                                    </EditItemTemplate> 
                                    <FooterTemplate> 
                                        <asp:Button ID="btn_ft_Insert" runat="server" CommandName="AddKey" Text="Add" /> 
                                    </FooterTemplate> 
                                    </telerik:GridTemplateColumn> 
                                      
                                </Columns> 
                                <NoRecordsTemplate> 
                                </NoRecordsTemplate> 
                            </MasterTableView> 
                             
                        </telerik:RadGrid> 
                    </td> 
                </tr> 
                <tr> 
                    <td width="80%">&nbsp;</td> 
                    <td width="20%">  
                        <asp:Button ID="btn_SaveKeys" runat="server" Text="Save" OnClick="btn_SaveKeys_onClick" /> 
                    </td> 
                </tr> 
            </table> 
        </telerik:RadPageView> 
     </telerik:RadMultiPage> 
       
     </form> 
</body> 
Code Behind:
        protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)  
        {  
            if (e.Argument.IndexOf("SearchGrid") != -1)  
            {  
                rm.BindGrid(rad_grd_Resource, rad_cmb_Language.SelectedValue, rad_txt_Search.Text, lblError);  
            }  
 
        } 
Akhil Raj
Top achievements
Rank 1
 answered on 11 Feb 2010
3 answers
118 views
I assign my single level Grid with an objectdatasource in code behind, in the same event I save the datasource in session, and have a needdatasource event to make sure the binding doesn't get lost by calling "Grid1.datasource =

(

ObjectDataSource)Session["objectdatasource1"]"

 

. At runtime the grouping works fine, when I tried to sort any column, it looks like it does sort (the column header is highlighted and the sort arrorw appears), but the actual records are not sorted.


any idea what's happening there?
Tsvetoslav
Telerik team
 answered on 11 Feb 2010
1 answer
141 views
Hi,

I am using RadGrid column filter option. I am trying to add a new Filter menu. I have aded the same using the

RadMenuItem

 

class and it's shoing up in the Menu options. however when I select this newly added option I get the following javascript error: "Error: Sys.ArgumentException: 'FromTo' is not a valid value for enum Telerik.Web.UI.GridFilterFunction.
Parameter name: value".

can anyone tell me how to add this new filtermenu option to the GridKnownFunction enum or any other work around?

Thanks

Yavor
Telerik team
 answered on 11 Feb 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?