Telerik Forums
UI for ASP.NET AJAX Forum
9 answers
305 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
171 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
102 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
115 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
803 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
222 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
1 answer
214 views
Hi,
I have a general query. Is it possible to Rename the text that is displayed in filter options of RADGRID ? for e.g. If I use 'IsEmpty' Filter option , I do not want to show the text "Is Empty" , But I want to display " Blank" instead, so which property can I use?
Eyup
Telerik team
 answered on 28 Sep 2016
0 answers
98 views

Hi,

Sorry for this second thread about my problem (How to acces other controls inside Advanced Insert Form ??) here :

http://www.telerik.com/forums/how-to-acces-other-controls-inside-advanced-insert-form

but i realy need your help because this slow my progressin in my development for now...

If anybody has already had this problem...

Thank you

 

 

 

 

Pierre
Top achievements
Rank 1
 asked on 28 Sep 2016
7 answers
262 views
Hi,

I have a grid with an edit form with textboxes that I need to disable based on a button that is clicked in the form. I'm wondering if there is a way to find the textboxes in the itemcommand events that get triggered by the buttons?

I've been trying to use something like:

 

Private Sub RadGrid2_ItemCommand(ByVal source As Object, ByVal e As Telerik.WebControls.GridCommandEventArgs) Handles RadGrid2.ItemCommand

 

 

If e.CommandName = "TimeInOutTextboxes" Then

 

 

Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)

 

 

Dim txtTimeIn As TextBox = DirectCast(editedItem.FindControl("txtTimeIn"), TextBox)

 

txtTimeIn.Enabled =

False

 

 

End If

but an error is thrown at "txtTimeIn.Enabled = False" because the control is not being found

Thanks


 

Beth
Top achievements
Rank 1
 answered on 28 Sep 2016
3 answers
84 views

Hello All,

I came across this strange issue happening only on production.

In my RadGrid, i have set the pager style as below, and its counting and displaying the paging details properly on local, dev and test environemnts (for example, 1,000 items in 10 pages)

<PagerStyle Mode="NextPrevAndNumeric" PageSizeLabelText="Page Size:" PageSizes="10,20,50" Position="TopAndBottom" PagerTextFormat="{4} {5:0,0} items in {1:0,0} pages" />

But on production, the counting of items and pages is behaving strange. For example, when i filter and sort or page to first or last page, the counting changes randomly and displays different numbers.

Can someone help me what must the issue?

I am binding the RadGrid with "asp:ObjectDataSource" (not using NeedDataSource event). I need to do this way, as this is an old code and cannot restructure everything for good reasons.

Please suggest.

 

 

 

 

A
Top achievements
Rank 1
 answered on 27 Sep 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?