Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
263 views
What I would like to do is use a custom asp modal popup box on the perform insert command on a radgrid.  It works as I have it but the problem is that the grid also opens up to insert data as well, but only the data in my needdatasource statement.  Is there a way to block this from opening and only open my modal popup.

I know I could use a template commandline but am trying to use built in radgrid items as its less code and looks cleaner.

Protected Sub myRadGrid_ItemCommand(sender As Object, e As GridCommandEventArgs) Handles myRadGrid.ItemCommand
       If (e.CommandName = RadGrid.InitInsertCommandName) Then
           pnlRegions_MPE.Show()
       End If
   End Sub
Kevin
Top achievements
Rank 1
 answered on 30 May 2013
1 answer
47 views
I have a 2012/Q2 RadEditor that was upgraded from version 2011/Q2.  There is a major difference in the UI of the image editor component.  It's more full featured, but I preferred the simple image editor that was in 2011.  

Is there a way through configuration, or a custom patch that I could restore the image editor that was in the 2011 version?
Ivaylo
Telerik team
 answered on 30 May 2013
1 answer
119 views
What I need to do is see if any items are checked in my radcombox, if they are ass them to an string and tehn to a sql where statement,
each time I look to see if items are checked though I get errors, at this point don't know what I am doing wrong.  Need to check and see if anything checked first so that I can skip it otherwise as part of a where statement for sql.
Protected Sub myRadGrid_NeedDataSource(sender As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles myRadGrid.NeedDataSource
       Dim SqlWhere As String = ""
       Dim items As String = ""
 
       If rblActive.SelectedValue = Nothing Then
           SqlWhere = " where r.bitActive = 1"
           rblActive.SelectedValue = 1
       ElseIf rblActive.SelectedValue = "All" Then
           SqlWhere = ""
       ElseIf rblActive.SelectedValue = "0" Then
           SqlWhere = " where r.bitActive = 0"
       ElseIf rblActive.SelectedValue = "1" Then
           SqlWhere = " where r.bitActive = 1"
           rblActive.SelectedValue = 1
       End If
 
       If ddlRadTeam.SelectedItem.Checked = True Then
           For Each item As RadComboBoxItem In ddlRadTeam.Items
               If item.Selected Then
                   items += item.Value & ","
               End If
           Next
       End If
 
       If ddlRadTeam.SelectedItem.Checked = True And rblActive.SelectedValue = "All" Then
           SqlWhere = " where r.intTeamId IN (" & items & ")"
       ElseIf ddlRadTeam.Items.Count > 0 Then
           SqlWhere += " and r.intTeamId IN (" & items & ")"
       End If
 
       sql = "select  " & SqlWhere
  
       myRadGrid.DataSource = getData(sql)
   End Sub
Nencho
Telerik team
 answered on 30 May 2013
1 answer
238 views
Hi Telerik,

I am trying to display a confirm message whenever users try to close a Radwindow. It works correctly when there  is only 1 Radwindow, but got various problems in nested RadWindows(open Radwindow from another Radwindow). I tried different approaches based on samples I found in your forum. But none of them works for my scenario. 

Basically, I want to achieve the following goals:
1. Whenever users click on the close button on the active Radwindow,  the confirm should show up. If users click on OK, it should only close the active Radwindow. If users click on Cancel, user will stay on the current Radwindow.
2. Confirm message should only be displayed once. I often got duplicate confirm windows intermittently. I guess it is due to add_beforeClose got attached multiple times.
3. When I close the 2nd Radwindow and open it again from the 1st one and try to close it, the confirm prompt should be displayed again and only once. Right now, in my sample, the prompt is like in an infinite loop and cannot be closed.

Please find the code sinippets below.
function OnBeforeClose(sender, args) {
    function callbackFunction(eventArgs) {
        if (eventArgs) {
            sender.remove_beforeClose(OnBeforeClose);
            sender.close();
//            sender.add_beforeClose(OnBeforeClose)
        }
    }
    args.set_cancel(true);
    radconfirm('Are you sure you want to close this window?', callbackFunction, 400, 140, null, 'Close Window');
}

Default.aspx:
    <telerik:RadWindow runat="server" ID="RadWindow1"></telerik:RadWindow>
    <asp:Button ID="Button1" Text="open window" runat="server" OnClientClick="openWindow(); return false;" />
    <script type="text/javascript">
        function openWindow() {
            var oWindow = window.radopen("Default2.aspx", "");
            oWindow.setSize(600, 400);
            oWindow.center();
            oWindow.add_beforeClose(OnBeforeClose);
            oWindow.show();
        }
    </script>

Default2.aspx:
  <telerik:RadWindow runat="server" ID="RadWindow1"></telerik:RadWindow>

    <asp:Button ID="Button1" Text="open window" runat="server" OnClientClick="openWindow(); return false;" />
    <script type="text/javascript">
        function openWindow() {
            var oWindow = window.radopen("Default3.aspx", "");
            oWindow.setSize(400, 300);
            oWindow.center();
            oWindow.add_beforeClose(OnBeforeClose);
            oWindow.show();
        }
    </script>

Default3.aspx is just a simple page with some text.

Here are steps to reproduce my problem:
1. Open Default2 form Default and open Default3 from Default2. 
2. Close Default3 and open it again from Default2. Try to close Default3. You will get the prompt but cannot close it.

You can try different combination of those 3 pages. I want to always display confirm prompt correctly no matter how many times I open and close and no matter which Radwindow I am trying to close. Is there any way that I can make this work?

Thank you very much
Marin Bratanov
Telerik team
 answered on 30 May 2013
1 answer
162 views
Using version 2013.1.417.35 and Internet Explorer 10.

Why is it that there seems to be a 30 character limit on the text we can enter in a column's filter?  If we type 31 characters, no results show, no matter the criteria (Contains, Equals, etc.).

Thanks,
Kyle
Eyup
Telerik team
 answered on 30 May 2013
9 answers
172 views
Dear all,
I've used a RadGrid personalized with GridTemplateColumn using as <ItemTemplate> controls such as RadNumericTextBox and no <EditItemTemplate> with the aim was to implement a sort of fast point&click Excel-like grid that is used to configure parameters of a project. Namely, the maximum dimensions of this grid are 20 columns x 50 rows - so I do not deal with millions of records...
The changing of the cell values now is very fast, more than using the classic approach of row selection, single cell update and press od the update link/button on the selected row.
Unfortunately, when I need to update something from the entire grid (also  the grid itself is auto-updated in Ajax mode) it takes a very long long long time to finish... The computational part is rather simple and it is accomplished in less than 1 second but when arriving to the grid.DataBind() method it takes almost 30 secs/1 min. to visually update the grid itself on the screen.
From the generated HTML I've seen that the VIEWSTATE now is enormous and this is probably the cause of the bad performance.
According to you, is there a way to speed up this process?
Pavlina
Telerik team
 answered on 30 May 2013
3 answers
72 views
Hi, I am using RadAsyncUpload. After the user select a file I automatically make a postback using Ajax using where btnFileUploaded is not visible.

function asupImage_ClientFileUploaded(sender, args) {
    $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequestWithTarget('<%= btnFileUploaded.UniqueID %>', '');
}

On server side OnFileUploaded is called and I save the file this way

protected void asupImage_FileUploaded(object sender, FileUploadedEventArgs e)
{
    string strAppplicationPath = HttpContext.Current.Request.ApplicationPath;
    string strLocalPath = HttpContext.Current.Request.MapPath(strAppplicationPath);
    e.File.SaveAs(strLocalPath + @"\Temp\" + e.File.FileName, true);
}

...which works. But if after that I hit the refresh button in IE (F5) whitout having select a new file then OnFileUploaded is called again and an Exception occurred in SaveAs() because the file doesn't exists anymore.

Do I miss something or is it a bug?

Hristo Valyavicharski
Telerik team
 answered on 30 May 2013
1 answer
170 views
Hello,

1. I need the image filter (ie, it must allow only image files) when i click Select Button in RAD UPLOAD control and not in validation.

2. I change "a.doc" files extension as "a.jpeg" and trying to upload the "a.jpeg" file. How to stop uploading the a.jpeg file as because it's not an image file.
How to do validation using java script?

Regards
Jayanthi
Shinu
Top achievements
Rank 2
 answered on 30 May 2013
3 answers
237 views
Hi,

I have a split button (below), when I click on a RadMenuItem i'd like to postback immediately rather than changing the button text and the user then requiring to click again, how would I accomplish this?

<telerik:RadButton ID="CloneSplitButton" AutoPostBack="false" runat="server" Text="Clone"
    EnableSplitButton="true" Height="22px" Enabled="true" CommandName="SaveReturn"
    UseSubmitBehavior="false" OnClientClicked="OnClientCloneSplitButtonClicked" OnClick="CloneSplitButton_Click">
</telerik:RadButton>
<telerik:RadContextMenu ID="CloneContextMenu" runat="server" OnClientItemClicked="OnClientCloneContextMenuClicked"
    EnableRoundedCorners="true">
    <Items>
        <telerik:RadMenuItem Text="New Quick Quote" />
        <telerik:RadMenuItem Text="New Subscription" />
    </Items>
</telerik:RadContextMenu>
<telerik:RadCodeBlock runat="server">
    <script type="text/javascript">
        function OnClientCloneSplitButtonClicked(sender, args) {
            if (args.IsSplitButtonClick()) {
                var currentLocation = $telerik.getLocation(sender.get_element());
                var contextMenu = $find("<%= CloneContextMenu.ClientID %>");
                contextMenu.showAt(currentLocation.x, currentLocation.y + 22);
                sender.set_autoPostBack(false);
            }
            else {
                sender.set_autoPostBack(true);
                window.setTimeout(function () {
                    sender.set_enabled(false);
                }, 0);
            }
        }
        function OnClientCloneContextMenuClicked(sender, args) {
            var itemText = args.get_item().get_text();
            var splitButton = $find("<%= CloneSplitButton.ClientID %>");
 
            if (itemText == "New Quick Quote") {
                splitButton.set_text("Clone to New Quick Quote");
                splitButton.set_commandName("CloneQuickQuote");
            }
            else {
                splitButton.set_text("Clone to New Subscription");
                splitButton.set_commandName("CloneSubscription");
            }
        }
    </script>
</telerik:RadCodeBlock>
Danail Vasilev
Telerik team
 answered on 30 May 2013
1 answer
256 views
On my line chart with negative values the x-axis labels are under the '0' instead of under the chart.  

See attached image.

Is there a way to fix this?

Andy
Danail Vasilev
Telerik team
 answered on 30 May 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?