Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
351 views
I have in a page the code below for a radwindow used as a modal popup. For some reason no matter what I do the validators will not fire when I click the btnAddUserToRoleSave button. Is there some trick to using validators in a modal window box? Thanks.




<telerik:RadWindowManager ID="rwmManagerUsers" runat="server" Style="z-index: 3" >
<Windows>  
<telerik:RadWindow ID="rwManagerUsers_SelectUsers" runat="server" 
    OnClientClose="rwManagerUsers_SelectUsers_OnClientClose" 
    Modal="true"
    AutoSize="true"
    Behaviors="Close"
    v>
<ContentTemplate>
        <asp:ValidationSummary ID="vsAddUserToRoleValidationSummary" runat="server" 
            EnableClientScript="true" 
            ShowMessageBox="true"
            ValidationGroup="vgAddUserToRoleForm"
            HeaderText="ERROR! The user cannot be set due to the following reasons:
            " />
        <table>
            <tr>
                <td><asp:Label ID="lblSelectedUser" Text="User:" runat="server"></asp:Label></td>
                <td>
                    <telerik:RadComboBox ID="ddlSelectedUser" runat="server" DataTextField="DisplayName" DataValueField="UserName"></telerik:RadComboBox>
                    <asp:RequiredFieldValidator ID="rfvSelectedUser"  runat="server"
                        Text="*" 
                        ErrorMessage="A User must be selected."
                        ToolTip="A User must be selected."
                        ControlToValidate="ddlSelectedUser"
                        ValidationGroup="vgAddUserToRoleForm"
                        InitialValue="-1"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td><asp:Label ID="lblSelectedLocation" Text="Location:" runat="server"></asp:Label></td>
                <td>
                    <telerik:RadComboBox ID="ddlSelectedLocation" runat="server" DataTextField="Description" DataValueField="LocationCode"></telerik:RadComboBox>
                    <asp:RequiredFieldValidator ID="rfvSelectedLocation" runat="server"
                        Text="*" 
                        ErrorMessage="A Location must be selected."
                        ToolTip="A Location must be selected."
                        ControlToValidate="ddlSelectedLocation" 
                        ValidationGroup="vgAddUserToRoleForm"
                        InitialValue=""></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:Button ID="btnAddUserToRoleSave" runat="server" Text="Add User To Role" OnClick="btnAddUserToRoleSave_Click" ValidationGroup="vgAddUserToRoleForm" />
                    <asp:Button ID="btnAddUserToRoleCancel" runat="server" Text="Cancel" OnClientClick="rwManagerUsers_Cancel();cancelEvent()" />
                </td>
            </tr>        
        </table>
</ContentTemplate>
</telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>
Marin Bratanov
Telerik team
 answered on 29 Sep 2016
1 answer
123 views
Hi, I am new to Sitefinty , and I have inserted "Facebook Like Widget" but I noticed that this is generating an error in the template , and I am trying to click on it on the page and the counter is showing zero . and nothing happened . the website is still running on my local . please advise.
Danail Vasilev
Telerik team
 answered on 29 Sep 2016
2 answers
300 views

Hi, i have a RadDatePicker, how can i change the date textfield edit behaviour?

When I edit my selected date by using the date textfield (not by using the datepicker), when i click on the date textfield, the whole date is highlighted.

Can I make it not highlight the whole date instead?

Attached image (1.png) shows that the current behavior. Click once, whole date is highlighted.

Attached image (2.JPG) is the behavior which I want.

 

I am using Telerik 2016.2.607.45.

Thank you.

 

Elvis
Top achievements
Rank 1
 answered on 29 Sep 2016
3 answers
2.0K+ views

I am opening the popup window with the below code from Server side

var url = string.Format("../UserPopup.aspx?user_Ids={0}&fromDate={1}&toDate={2}", user_Ids, fromDate, toDate);
string script = string.Format("function f(){{openDialog('{0}', {1}, {2}, {3});Sys.Application.remove_load(f);}}Sys.Application.add_load(f);",
                                     url,
                                     "true",   
                                     1000,
                                     300);
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "someKey", script, true)

Below is the code for closing the popup window from javascript. The below code is not working.

function GetRadWindow() {
            var oWindow = null;
            if (window.radWindow)
                oWindow = window.radWindow;
            else if (window.frameElement.radWindow)
                oWindow = window.frameElement.radWindow;
            return oWindow;
        }
 
function Close() {
var result = window.confirm("Are you sure you want to close the window!");
if (result == true) {
    var oWindow = GetRadWindow();
    oWindow.argument = null;
    oWindow.onunload = refreshParent;
    oWindow.close();
    return false;
    }
 }
 
 function refreshParent() {
     window.opener.location.reload();
 }

How can I close the popup window from client side and refresh the parent page?

 

FYI: I am using RadWindow as popup for this.

Marin Bratanov
Telerik team
 answered on 29 Sep 2016
9 answers
309 views
Hi,
I have a RadListView that is populated from a database. It displays data in a grid format. The RadListView contains paging and has the OnNeedDataSource property set that is used to populate the RadListView with data. PLease see below for the code.

<telerik:RadListView ID="RadListView1" runat="server"

ItemPlaceholderID="ProductsContainer" DataKeyNames="ProductId" AllowPaging="true" PageSize="12"

OnItemCommand="RadListView1_ItemCommand" OnNeedDataSource="RadListView1_NeedDataSource">

<LayoutTemplate>

<fieldset id="FieldSet1" style="border: none; padding: 0px;">

<asp:PlaceHolder ID="ProductsContainer" runat="server"></asp:PlaceHolder>

<div style="clear: both">

</div>

<div style="border-top: dashed 0px #CACACA; padding-top: 30px;">

<div style="float: left; margin-left: 0%;">

<asp:Button runat="server" ID="btnFirst" CommandName="Page" CommandArgument="First"

Text="<<" Enabled="<%#Container.CurrentPageIndex > 0 %>" CssClass="Button_Grid_Pager"></asp:Button>

<asp:Button runat="server" ID="btnPrev" CommandName="Page" CommandArgument="Prev"

Text="<" Enabled="<%#Container.CurrentPageIndex > 0 %>" CssClass="Button_Grid_Pager"></asp:Button>

<span style="vertical-align: middle; line-height: 22px; display: inline-block;">&nbsp;&nbsp;Page

<%#Container.CurrentPageIndex + 1 %>

of

<%#Container.PageCount %></span>&nbsp;&nbsp;

<asp:Button runat="server" ID="btnNext" CommandName="Page" CommandArgument="Next"

Text=">" Enabled="<%#Container.CurrentPageIndex + 1 < Container.PageCount %>" CssClass="Button_Grid_Pager"></asp:Button>

<asp:Button runat="server" ID="btnLast" CommandName="Page" CommandArgument="Last"

Text=">>" Enabled="<%#Container.CurrentPageIndex + 1 < Container.PageCount %>" CssClass="Button_Grid_Pager"></asp:Button>

</div>

<div style="border: none; padding-top: 2px;">

<span style="vertical-align: middle; font-weight: normal; line-height: 22px; padding-left: 15px;">Items per page:&nbsp;&nbsp;</span>

<telerik:RadComboBox runat="server" ID="cmbPageSize"

OnSelectedIndexChanged="cmbPageSize_SelectedIndexChanged"

AutoPostBack="true" Width="60px" Skin="Default"

SelectedValue="<%#Container.PageSize %>">

<Items>

<telerik:RadComboBoxItem Text="4" Value="4"></telerik:RadComboBoxItem>

<telerik:RadComboBoxItem Text="12" Value="12"></telerik:RadComboBoxItem>

<telerik:RadComboBoxItem Text="36" Value="36"></telerik:RadComboBoxItem>

<telerik:RadComboBoxItem Text="100" Value="100"></telerik:RadComboBoxItem>

 

</Items>

</telerik:RadComboBox>

</div>

</div>

</fieldset>

</LayoutTemplate>

<ItemTemplate>

<fieldset class="item">

<asp:Panel ID="ItemContainer" runat="server">

<asp:ImageButton ID="imgbtnProductDetails" runat="server" ImageUrl='<%# "prodimages/" & Eval("ProdRef") & "-1_Grid.jpg"%>'

AlternateText='<%# Eval("ImageAltText") %>' Width="240px"

CommandName="SelectProduct" CommandArgument='<%# Eval("ProductId")%>' Enabled='<%# IIf(Eval("IsVoucher") = True, False, True)%>' />

</asp:Panel>

</fieldset>

</ItemTemplate>

</telerik:RadListView>


I want to know how I can, dynamically (code behind) always display an image in item position / grid position 0 in the RadListView, so that it is always displayed on every page, in the same position, of the RadListView....for example see below where (X) is where I want to display the image on every page...

X......... item1.....item2
item3....item4.....item4
item6....item7.....item8

Thanks for your time.
Bhavya
Top achievements
Rank 1
 answered on 29 Sep 2016
1 answer
177 views

Hi I have been able to hide hidden files but i cant seem to get the directories to hide my files code is -

public override DirectoryItem ResolveDirectory(string virtualPath)
{

        DirectoryItem basedir = base.ResolveDirectory(virtualPath);
    
     

        string physicalPath;
physicalPath = this.GetPhysicalFromVirtualPath(virtualPath);

if (physicalPath == null)
return null;

DirectoryItem result = new DirectoryItem(PathHelper.GetDirectoryName(physicalPath),
virtualPath,
virtualPath,
virtualPath,
GetPermissions(physicalPath),
GetFiles(virtualPath),
new DirectoryItem[] { }// Directories are added in ResolveRootDirectoryAsTree method
);

        // Update all file items with the additional information (date, owner)
        DirectoryItem oldItem = base.ResolveDirectory(physicalPath);
        List<FileItem> visibleFiles = new List<FileItem>();
        foreach (FileItem fileItem in result.Files)
        {
            // Get the information from the physical file
            FileInfo fInfo = new FileInfo(physicalPath + "\\" + fileItem.Name);
            // Add the information to the attributes collection of the item. It will be automatically picked up by the FileExplorer
            // If the name attribute matches the unique name of a grid column
            fileItem.Attributes.Add("CreationDate", fInfo.CreationTimeUtc.ToString());
            fileItem.Attributes.Add("ModifiedDate", fInfo.LastWriteTime.ToString());

            
            
            FileAttributes fileattr = File.GetAttributes(physicalPath + "\\" + fileItem.Name);
            if((fileattr & FileAttributes.Hidden) != FileAttributes.Hidden)
            {
                visibleFiles.Add(fileItem);
            }
        }

        DirectoryItem result1 = new DirectoryItem(PathHelper.GetDirectoryName(physicalPath),
                                                    virtualPath,
                                                    virtualPath,
                                                    virtualPath,
                                                    GetPermissions(physicalPath),
                                                   visibleFiles.ToArray(),
                                                    new DirectoryItem[] { }// Directories are added in ResolveRootDirectoryAsTree method
                                                );

        return result1;
}

 

Which works really well my Directory code is code is - > 

   public override DirectoryItem ResolveRootDirectoryAsTree(string path)
{

        
        

        string physicalPath;
string virtualPath = string.Empty;       

if (PathHelper.IsSharedPath(path) || PathHelper.IsPhysicalPath(path))
{
physicalPath = path;

foreach (KeyValuePair<string, string> mappedPath in MappedPaths)
{

if (physicalPath.StartsWith(mappedPath.Value, StringComparison.CurrentCultureIgnoreCase))
{


string restOfPhysicalPath = physicalPath.Substring(mappedPath.Value.Length);


virtualPath = mappedPath.Key + restOfPhysicalPath.Replace('\\', '/');


virtualPath = PathHelper.AddEndingSlash(virtualPath, '/');
break;
}
}
}
else
{
virtualPath = PathHelper.AddEndingSlash(path, '/');
physicalPath = this.GetPhysicalFromVirtualPath(path);
           
if (physicalPath == null)
return null;
}

      


        DirectoryItem result = new DirectoryItem(PathHelper.GetDirectoryName(physicalPath),
string.Empty,
virtualPath,
string.Empty,
GetPermissions(physicalPath),
new FileItem[] { }, // Files are added in the ResolveDirectory method
GetDirectories(virtualPath)
);

        return result;
}

 

Any help would be much appreciated.

Ianko
Telerik team
 answered on 29 Sep 2016
3 answers
106 views

Hello,

Currently I have the 'UI for ASP.NET AJAX Q3 2014' library.
I ask if it is possible to place the 'RadEditorNodeInspector' module on the top of the editor, after the Tools buttons.

I have already seen that there is a secondary way to do that by coding <telerik:EditorModule Name="RadEditorNodeInspector" Enabled="true" dockingzone="Top" /> but this is not a good way because there are some grafical issues.

Is there another way to do that?

Thanks.
Regards.

Rumen
Telerik team
 answered on 28 Sep 2016
2 answers
119 views

Hi there, I'm using some code like this to import from Word.

 

            Using fileStream As New FileStream(Server.MapPath(FilePath), FileMode.Open, FileAccess.Read)
                EditorContent.LoadDocxContent(fileStream)
            End Using

In principle this works fine. However, if text has been formatted as Heading 3 in Word, then it comes through as <p>My text</p> instead of <h3>My text</h3>.

However, if I copy/paste from Word into the editor, then the <h3> tags are preserved. Any ideas why the import is not preserving the <h3> tags?

Julian
Top achievements
Rank 1
 answered on 28 Sep 2016
25 answers
815 views
Hi Guys,

One of our developers has been using the telerik controls such as the scheduler, tab strip, etc. for several months now.  Most of our customers use IE7/IE8.  And, we see a definite performance decrease when using any telerik controls with those browsers.  In FireFox, the performance appears better.

It has gotten to the point where my developer is going to pull the telerik controls from our product and go to other 3rd-party tools because the customers are complaining about the sluggish performance.  Granted, some customers have weak client computers while others have top-of-the-line.  In almost all cases, the telerik controls perform terrible in IE.

I know Microsoft's browsers may have issues that FireFox does not, but IE is not going anywhere, and something must be done to support it better.

My developer has looked at the top 10 list for increasing telerik performance, and we have tried everything to trim down the code supporting the telerik controls to make them function lean, mean, and fast.  But, this still has not given us the performance that we expect.

Even when using the live demos at telerik of the scheduler, the demos work better on FireFox, etc. than in IE.  Something must be done to correct this.  Again, IE is not going anywhere.

If you have any betas, coding suggestions, etc., I would gladly welcome them.  Until a fix is available for performance, I cannot afford to keep using telerik in the future.

Bryan
:-(
Veselin Tsvetanov
Telerik team
 answered on 28 Sep 2016
5 answers
225 views
The Telerik ASP.NET Editor responsive features not working when adding the Skin="Bootstrap"

Please reply as soon as possible its very urgent.
Rumen
Telerik team
 answered on 28 Sep 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?