Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
117 views
Is it possible to make it so that when the RibbonBar is in the minimized mode and tabs are accessed that the menu content is shown above other content on the page to avoid everything getting pushed down??
Adam Nelson
Top achievements
Rank 2
 answered on 21 Aug 2012
4 answers
1.3K+ views
OK, I have a radgrid with a GridButtonColumn (below)
<telerik:RadGrid ID="grdOrderedItems" OnNeedDataSource="OrdItem_NeedDataSource"
    OnItemDataBound="OrdItemDatabound" runat="server" AutoGenerateColumns="False" AllowPaging="False">
    <ClientSettings>
        <Scrolling AllowScroll="True" ScrollHeight="250px" UseStaticHeaders="True"></Scrolling>
    </ClientSettings>
    <MasterTableView NoMasterRecordsText="You have no ordered items att his time.">
        <Columns>
            <telerik:GridBoundColumn HeaderText="Order Number" DataField="OrderNumber"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderText="Item Number" DataField="ItemNumber"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderText="Item Name" DataField="ItemName"></telerik:GridBoundColumn>
            <telerik:GridButtonColumn HeaderText="View Custom Print" UniqueName="btnView" DataTextField="CustomID"></telerik:GridButtonColumn>
            <telerik:GridBoundColumn HeaderText="Custom ID" DataField="CustomID" Visible="False"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderText="Friendly Name" DataField="FriendlyName" Visible="False"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderText="Ordered By" DataField="OrderedBy"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderText="Shipped?" DataField="Shipped"></telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

I want to have an onclick event with a command argument
I kind of have it - but this line
                     btnView.Attributes.Add("OnClick", "LoadProof(null, null)"); 
gives me some issues...
protected void OrdItemDatabound(object sender, GridItemEventArgs e)
{
    if (e.Item.ItemType == GridItemType.AlternatingItem || e.Item.ItemType == GridItemType.Item)
    {
        if (e.Item is GridDataItem)
        {
            GridDataItem itemValue = (GridDataItem)e.Item;
 
            LinkButton btnView = (LinkButton)itemValue["btnView"].Controls[0];
            btnView.Attributes.Add("OnClick", "LoadProof(null, null)");
            btnView.CommandArgument = string.Format("return Click('{0}';", itemValue.GetDataKeyValue("CustomID"));
        }
    }
}

I need to fire this block of code:
protected void LoadProof(object sender, EventArgs e)
{
    //.... do some stuff
}

But I can't figure out how to call the object and arguments - for the onclick:
btnView.Attributes.Add("OnClick", "LoadProof(null, null)");
Any suggestions?  I know, it shouldn't be "null, null" - but I can't use "sender, e" - Visual Studio doesn't like it.
Mark
Top achievements
Rank 1
 answered on 21 Aug 2012
3 answers
570 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
181 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
114 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
261 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
93 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
117 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
193 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
682 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
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?