Telerik Forums
UI for ASP.NET AJAX Forum
14 answers
965 views
I'm apparently missing something here.  Trying to change the sort order of a grid that uses GroupByExpressions with no luck.

I started with the following:
<GroupByExpressions>
    <telerik:GridGroupByExpression>
        <GroupByFields>
            <telerik:GridGroupByField FieldName="OrderID" />
        </GroupByFields>
        <SelectFields>
            <telerik:GridGroupByField FieldName="OrderID" HeaderText="Order ID" />
            <telerik:GridGroupByField FieldName="CustLastFirst" HeaderText="Customer" />
            <telerik:GridGroupByField FieldName="Total" HeaderText="Order Total" FormatString="{0:C}" />
        </SelectFields>
    </telerik:GridGroupByExpression>
</GroupByExpressions>


Then I tried adding this:
<SortExpressions>
    <telerik:GridSortExpression FieldName="CustLastFirst" SortOrder="Ascending" />
</SortExpressions>

And I tried variations of this, but get either no action or a type mismatch error:
<GroupByFields>
    <telerik:GridGroupByField FieldName="OrderID" />
    <telerik:GridGroupByField FieldName="CustLastFirst" />
</GroupByFields>


Any suggestions?  Thanks!


Kostadin
Telerik team
 answered on 29 Sep 2016
9 answers
181 views
Hello! Please note that ClientSettings-Scrolling-SaveScrollPosition="true" not working since Q3 2015. Please fix!!!
Pavlina
Telerik team
 answered on 29 Sep 2016
4 answers
342 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
111 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
291 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
299 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
169 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
100 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
113 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?