Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
483 views
After the postback of the RadGrid in one update panel, the custom validator in another panel fires numerous times. The more postbacks you do on the RadGrid, the more times the validator will fire.

Here is the sample code. Watch "Count: 0" before a postback and after selecting a row or two in the RadGrid.

Before postback, the validator runs once every time you change the textbox or press the button. After selecting a couple of grid rows, it will fire multiple times....

You can execute the validator by changing the text in the text box to anything other than "hello"...

Move the validator out of the ajaxified table and it works as expected...

How can I have the custom validator inside the ajaxified table act properly after postback?

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default2.aspx.cs" Inherits="TestValidation.Default2" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<script runat="server">
    protected void Page_Load(object sender, EventArgs e)
    {
        RadGrid1.NeedDataSource += new Telerik.Web.UI.GridNeedDataSourceEventHandler(RadGrid1_NeedDataSource);
    }
 
    protected void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
    {
        var items = new List<dynamic>()
            {
                new { Col1 = "ABC", Col2 = "DEF" },
                new { Col1 = "123", Col2 = "456" }
            };
 
        RadGrid1.DataSource = items;
    }
</script>
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js">
            </asp:ScriptReference>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js">
            </asp:ScriptReference>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js">
            </asp:ScriptReference>
        </Scripts>
    </telerik:RadScriptManager>
    <telerik:RadGrid ID="RadGrid1" runat="server" Height="100px" Width="400px">
        <MasterTableView Name="ChargePaymentTable" TableLayout="Fixed" AutoGenerateColumns="true">
        </MasterTableView>
        <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true">
            <Selecting AllowRowSelect="true" />
        </ClientSettings>
    </telerik:RadGrid>
    <br />
 
    <div id="div1">Count: 0</div>
 
    <%--<div>
        <asp:CustomValidator ID="CustomValidator1" runat="server" ControlToValidate="TextBox1"
            Text="FORMAT" ValidationGroup="CheckGroup" ClientValidationFunction="CheckText"></asp:CustomValidator>
    </div>--%>
 
    <table id="Table1" runat="server">
        <tr>
            <td>
                Hello?
                <asp:CustomValidator ID="CustomValidator2" runat="server" ControlToValidate="TextBox1"
                    Text="FORMAT" ValidationGroup="CheckGroup" ClientValidationFunction="CheckText"></asp:CustomValidator>
            </td>
        </tr>
        <tr>
            <td>
                <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Button ID="Button1" runat="server" Text="Check" ValidationGroup="CheckGroup" />
            </td>
        </tr>
    </table>
    <telerik:RadAjaxManager runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="Button1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                    <telerik:AjaxUpdatedControl ControlID="Table1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
        <script language="javascript" type="text/javascript">
 
            var checkCount = 0;
 
            function CheckText(sender, args) {
                $telerik.$("#div1").html("Count: " + ++checkCount);
                args.IsValid = (args.Value == "hello");
            }
 
        </script>
    </telerik:RadScriptBlock>
    </form>
</body>
</html>

Milena
Telerik team
 answered on 21 Aug 2012
2 answers
145 views

Raddatepicker is selecting wrong date after clicking on tab.

Hi,

Please advice which property is used to solve the below problem?

 <telerik:RadDatePicker ID="RadDatePicker1" AutoComplete="on" DateInput-DateFormat="dd-MMM-yyyy"
 runat="server" MinDate="01/01/1990" MaxDate="01/01/9999" AutoPostBack="false"  Width="136px">
 <DateInput ID="DateInput1" runat="server" MaxLength="11">
</DateInput>
 </telerik:RadDatePicker>

Problem: 

1. Current Date is 21-Aug-2012
2. When i enter 15 in RadDatePicker control and click on Tab
3. Default it is taking 15-Jun-2012
4. When i enter 20 in RadDatepicker control and click on Tab
5. Default it is taking 15-Jun-2012

Please suggest. 

Please Note: By default i will not display any current date.

Thanks & Regards,
Chakradhar
Chakradhar
Top achievements
Rank 1
 answered on 21 Aug 2012
2 answers
73 views
What is the default font(s) used by FileExplorer?
When FileExplorer displays files and folders, what font does it use?
Also, FileExplorer displays 2 columns; Filename and Size. What font is this?

We are developing a webpage that utilizies FileExplorer and I have been instructed to have all the fonts on the page match the font(s) used by FileExplorer, yet I have found no way to determine the exact font(s) used by FileExplorer.

Thank you
Brian
Top achievements
Rank 1
 answered on 21 Aug 2012
1 answer
189 views
Hi all,

I have a commanditemtemplate with a button that I would like to use to edit one row from the radgrid using a popup usercontrol.

The situation:
I cannot edit the row with the GridEditCommandColumn because there is only one row in the entire grid that is allowed to be edited, and I don't want to work with hiding buttons because I think it's an ugly solution. Therefore I would like to edit the row by pressing a button at the commanditemtemplate.

Unfortunately, the popup doesn't show. I probably forgot some setting somewhere, could someone please help me?

aspx code snippet
<MasterTableView DataKeyNames="keyName" AllowMultiColumnSorting="True" EditMode="PopUp"
    CommandItemDisplay="Top">
        <EditFormSettings EditFormType="WebUserControl" />
            <CommandItemSettings ShowAddNewRecordButton="false" AddNewRecordText=""
                ShowRefreshButton="false" RefreshText="" />
            <CommandItemTemplate>
                <telerik:RadButton ID="RadButtonDone" runat="server" Text="Done"
                    CommandArgument="Done" CommandName="Edit"
                    ToolTip="Mark the item as done">
                    <Icon PrimaryIconUrl="Images/done.gif" PrimaryIconLeft="8"
                        PrimaryIconTop="5" />
                </telerik:RadButton>
            </CommandItemTemplate>

code behind c#:
protected void RadGridMyGrid_ItemCommand(object source, GridCommandEventArgs e)
{
    if (e.CommandName == RadGrid.EditCommandName)
    {
        //  Change status to 'Done'
        if (e.CommandArgument == "Done")
        {
            SessionState.Current.intKey =
               GetKeyValueFromRowThatIsAllowedToBeEdited(ValueFromSessionState);
            e.Item.OwnerTableView.IsItemInserted = false;
            e.Item.OwnerTableView.EditFormSettings.PopUpSettings.Width = 700;
            e.Item.OwnerTableView.EditFormSettings.PopUpSettings.Modal = true;
            e.Item.OwnerTableView.EditFormSettings.UserControlName =
                "ChangeStatusToDone.ascx";
        }
    }
}

Thank you!

Marlies
Marliela
Top achievements
Rank 1
 answered on 21 Aug 2012
0 answers
67 views

Hi

I have a Scheduler Control where i have defined a function on onclientappointmentmoveend="OnClientAppointmentMoveEnd" and within my function i have something like this

function OnClientAppointmentMoveEnd(sender, eventArgs) {
    MyFunction(eventArgs, "onMove");                
 }

function MyFunction(eventArgs, action) {
    $.ajax(
     {
          url: url,
          data: parameter,
          contentType: "application/json; charset=utf-8",
          success: 
          function (data) {
               CallbackFunction(data, eventArgs,action);
           },
      type:'POST',
      dataType: 'json',
      async: false
 });

}

function CallbackFunction(data, eventArgs,action) {
..........
.......
.........

}

Now, my callback function works fine on any windows browser but this callback function is not executed on IPad. Is there something that is missing to make it execute on IPad?

Surabhi
Top achievements
Rank 1
 asked on 21 Aug 2012
2 answers
79 views
Hi,
While I really like this feature, there appears to be a potential issue with it.
If I have multiple roots, it seems the breadcrumb feature doesn't work. It seems to go to the first root item. Which is fine, until you drill into it. Once drilled in, there is no way for the user to get back to the level with the multiple roots. Only to the root item that was drilled on.
Any ideas?
Thanks ... Ed

Ed Staffin
Top achievements
Rank 1
 answered on 21 Aug 2012
4 answers
159 views
I've got 2 radmenus on the same page that have clicktoopen set to true.

If I click on a menu it opens, then if I click away it closes.  Unless I click on the second menu, then the first menu remains open and the second menu opens up as well.

I would like to have the first menu close when the second menu is clicked.
I tried adding a onblur client event to the menus where I close the menu if focus is taken away, but that caused 2 issues.

1) The clicked property remains set to 'true' so when I hove the mouse the menu opens up again without having to click.
2) I have a checkbox inside of the menu template, when I click the checkbox, the menu technically loses focus and tries to close then immediately reopens.  

Concerning point 1.
If I set clicked to false in the same event, then the menu can't be closed by clicking on it a second time, it starts to close then immediately reopens again.  

Thanks,
Javier
Boyan Dimitrov
Telerik team
 answered on 21 Aug 2012
11 answers
626 views
I'm using a RadUpload in an EditTemplate of a RadGrid and when I check the UploadedFiles.Count within my InsertCommand, it returns 0.  Any ideas what I'm doing wrong?

        RadGrid rgRotator = (RadGrid)sender;
        RadUpload ruThumbnail = (RadUpload)e.Item.FindControl("ruThumbnail");

        if (ruThumbnail.UploadedFiles.Count > 0)
        {
            // execute SaveAs
        }



Thanks,

Jeff
Peter Filipov
Telerik team
 answered on 21 Aug 2012
1 answer
68 views
Hi.

I would like to know if its possible to set the TimePicker to handle only minutes?
So instead of having an input of "01:30" (HH:mm) it should be 90 only.

Also that the PopUp to pick values, displays as follows

instead of --> it should be
00:55 --> 55
01:00 --> 60
01:05 --> 65
and so on...

Hope you can help me.
Eyup
Telerik team
 answered on 21 Aug 2012
1 answer
78 views
Hi,

I'm trying to figure out the best way to achieve the following scenario:
1. Have a RadGrid display a table of information i.e.

Customer

# of Orders

# of Products Ordered

Total Revenue

John Doe

10

23

$2300.00


2. When client selects a row, to generate a report ( such as a breakdown of orders) that provides more detailed information on a value (i.e. Customer's name) in selected row.

Thanks, 
Yankev
Andrey
Telerik team
 answered on 21 Aug 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?