Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
473 views
We are considering adding a feature to our application that provides a thumbnail preview of any documents that might be contained within a specific directory. These documents could be any one of several common types including pdf, rtf, doc, etc. I was wondering what you would suggest would be a good approach. Do you have a thumbnail control of some sort that might work for this purpose? We were considering using the slider control to facilitate browsing.

Thanks in advance,
Tom
Tom Jaspering
Top achievements
Rank 1
 answered on 21 Oct 2009
5 answers
410 views
I'm working with another developer to satisfy their busienss requirement of enabling/disabling editing on a row-by-row basis based on a given criteria...  For simplicity sake, let's say they can edit Even row #'s and Odd row #'s are displayed but not editable...

Our grid has a standard GridEditCommandColumn named "EditCommandColumn"... We also have an additional GridButtonColumn named "DeleteCommand" and its CommandName is set to "Delete"...  There is also a ClientEvents setting for OnRowDblClick to call a JavaScript function which performs the following:


radGrid.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical()); 

What I've done thus far is to use the following code to access the ImageButton in the GridEditCommandColumn and set it's Visible property to False...  Same basic approach I'm assuming I would apply for the Delete column though I haven't made it that far yet...


TableCell tableCell = gridDataItem[
"EditCommandColumn"];  
ImageButton imageButton = tableCell.Controls[0] as ImageButton;  
imageButton.Visible = false

So this works to hide the button and prevent the user from clicking on it, but it leaves the client-side OnRowDblClick still functional...

I was hoping to find something far more elegant / canned & ready-to-use... ie. a row-level setting of some sort - such as a property on the GridDataItem for "AllowEdit" or something similar... perhaps both "AllowEdit" and "AllowDelete"... but I see nothing of the sort...

What is the "right" way to handle this case? Or am I heading in the right direction and just need a few more tweaks.... 

I'm thinking my option here for dealing with the client-side double-click handler would be to do as described above and additionally catch the ItemCommand event and test for the same conditions and conditionally Cancel the ItemCommand event?


Brad Hehe
Top achievements
Rank 1
 answered on 21 Oct 2009
1 answer
317 views
Hi,

Is it possible to add a footer to a GridBoundColumn without turning it into an item template.

i want to add a button to the footer of a radGrid.  I'd like to have it under the right most column, but don't want to have to convert the contents of the column to an item template, is this possible, and if so, how do I do it?

The code below is a snippet from the grid I'd like to add the footer to.  If possible I'd like the button to appear under the FirstName column.



<telerik:RadGrid ID="grvLandlords" runat="server" AutoGenerateColumns="False" DataSourceID="SqlLandlord" GridLines="None"   
                Skin="Office2007" OnSelectedIndexChanged="grvLandlords_SelectedIndexChanged" OnItemDataBound="grvLandlords_ItemDataBound" > 
                <MasterTableView ShowFooter="true" DataKeyNames="LandlordID" DataSourceID="SqlLandlord">  
                    <Columns>                              
                        <telerik:GridButtonColumn CommandName="Select" Text="Select" UniqueName="Select">  
                        </telerik:GridButtonColumn>    
                        <telerik:GridBoundColumn DataField="LandlordID" DataType="System.Int32" HeaderText="LandlordID" 
                            ReadOnly="True" SortExpression="LandlordID" UniqueName="LandlordID" Visible="false">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="Title" HeaderText="Title" SortExpression="Title" 
                            UniqueName="Title">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" SortExpression="FirstName" 
                            UniqueName="FirstName">  
                        </telerik:GridBoundColumn> 
</Columns> 
                </MasterTableView> 
            </telerik:RadGrid> 


Thanks,

Peter
Pavlina
Telerik team
 answered on 21 Oct 2009
1 answer
214 views
Hi

In RadGrid, when you group and the group continues on the next page, RadGrid automatically displays this:
"(Showing 7 of 65 items. Group continues on the next page.)"

Is there a way to ALWAYS show this when grouping? Even when group does not continue on next page? ie:
"(7 items)"
Iana Tsolova
Telerik team
 answered on 21 Oct 2009
2 answers
59 views
Hi,
I am using rad Editor for some content manipulation which can be either in right to left language like arabic.
Is that possible to write in arabic using rad editor while cursor should move ahead rather staying there...this is what exactly happens when we use any left to right language???.

I am waiting for your response.

Thanks for your help.

Rumen
Telerik team
 answered on 21 Oct 2009
2 answers
260 views
Hello,

I have a radmenu and one of the item templates uses radcombobox.

How do I make the radcombobox to show its dropdown over the menu ?
Roland
Top achievements
Rank 1
 answered on 21 Oct 2009
2 answers
164 views
Hello,

I have a treeview in a div. The div has fixed width and height. The treeview has fixed width and height smaller the div of course.

The node text is longer which gives me scroll bars (this is ok).

The attached screen shot shows selected node in IE8, IE8 standard mode. You can see the vertical scrollbar, then the div border and another div border.

Is there a way the text will not show over my divs on the right ?

Latest release of ASP.NET ajax controls.
Roland
Top achievements
Rank 1
 answered on 21 Oct 2009
1 answer
91 views
I was not sure which forum this is most appropriate in so I cross-posted this here and to the Calendar forum. 
We are implementing a Month/Year picker (http://www.telerik.com/community/code-library/aspnet-ajax/calendar/month-year-picker.aspx#944510) in the FilterTemplate of a RadGrid. I have copied the code from the grid below.  I have not been able to get the javascript to get a reference to the pickers ClientID - the compiler complains it does not know the TechManListPicker control.

Thanks

<telerik:GridDateTimeColumn HeaderText="Technical Manual Date" ReadOnly="true" DataField="TechnicalManualDate" DataFormatString="{0:MM/yyyy}">
                    <FilterTemplate>
                        <telerik:RadDatePicker ID="TechManListDatePicker" runat="server">
                            <DateInput DateFormat="MM/yyyy">
                            </DateInput>
                            <Calendar>
                                <FastNavigationSettings TodayButtonCaption="current date" />
                            </Calendar>
                        </telerik:RadDatePicker>
                        <telerik:RadScriptBlock ID="radScriptBlock" runat="server" >
                            <script type="text/javascript">
                                //override the onload event handler to change the picker after the page is loaded
                                //Sys.Application.add_load(setCalendarTable);

                                function setCalendarTable() {

                                    var picker = $find("<%= TechManListDatePicker.ClientID %>");
                                    var calendar = picker.get_calendar();
                                    var fastNavigation = calendar._getFastNavigation();

                                    $clearHandlers(picker.get_popupButton());
                                    picker.get_popupButton().href = "javascript:void(0);";
                                    $addHandler(picker.get_popupButton(), "click", function() {
                                        var textbox = picker.get_textBox();
                                        //adjust where to show the popup table
                                        var x, y;
                                        var adjustElement = textbox;
                                        if (textbox.style.display == "none")
                                            adjustElement = picker.get_popupImage();

                                        var pos = picker.getElementPosition(adjustElement);
                                        x = pos.x;
                                        y = pos.y + adjustElement.offsetHeight;

                                        var e = {
                                            clientX: x,
                                            clientY: y - document.documentElement.scrollTop
                                        };
                                        //synchronize the input date if set with the picker one
                                        var date = picker.get_selectedDate();
                                        if (date) {
                                            calendar.get_focusedDate()[0] = date.getFullYear();
                                            calendar.get_focusedDate()[1] = date.getMonth() + 1;
                                        }

                                        $get(calendar._titleID).onclick(e);

                                        return false;
                                    });

                                    fastNavigation.OnOK =
                                        function() {
                                            var date = new Date(fastNavigation.Year, fastNavigation.Month, 1);
                                            picker.get_dateInput().set_selectedDate(date);
                                            fastNavigation.Popup.Hide();
                                        }


                                    fastNavigation.OnToday =
                                        function() {
                                            var date = new Date();
                                            picker.get_dateInput().set_selectedDate(date);
                                            fastNavigation.Popup.Hide();
                                        }
                                }   
                            </script>
                        </telerik:RadScriptBlock>
                    </FilterTemplate>
                </telerik:GridDateTimeColumn>
Pavlina
Telerik team
 answered on 21 Oct 2009
1 answer
236 views
I created an Extension method that will set the page break of a RadTabStrip for visible tabs only and then split the rows in half.  I have a situation where some of the tabs will be visible during certain page views. 

so in your code for the page_load, you would just call:
RadTabStrip1.FormatMultiLineTabs(False); 

If you have any refactorings  or improvements for this snippet, I'd be interested to see it.
Enjoy!

C#:
using Telerik.Web.UI; 
using System.Runtime.ComplierServices;  
  
public class RadTabStripExtensions  
{  
  
    [Extension()]  
    public void FormatMultiLineTabs(ref RadTabStrip tab, bool ForceMultiLine)  
    {  
        int intTabCount = 0;  
        foreach (RadTab objTab in tab.Tabs) {  
            if (objTab.Visible)  
            {  
                intTabCount += 1;  
            }  
        }  
        if (ForceMultiLine || intTabCount >= 8) // this can be changed to the line break number  
        {  
            int intTabBreakIndex = intTabCount / 2 - 1;  
            if (intTabCount % 2 == 1)  
            {  
                intTabBreakIndex += 1;  
            }  
            tab.AddTabBreakToVisibleTabIndex(intTabBreakIndex);  
        }  
    }  
  
    [Extension()]  
    public void AddTabBreakToVisibleTabIndex(ref RadTabStrip tab, int VisibleIndexBreak)  
    {  
        int intIndex = 0;  
        foreach (RadTab objTab in tab.Tabs) {  
            if (objTab.Visible)  
            {  
                if (intIndex == VisibleIndexBreak)  
                {  
                    objTab.IsBreak = true;  
                }  
                intIndex += 1;  
            }  
        }  
    }  
  
}  

VB:
Imports Telerik.Web.UI 
Imports System.Runtime.CompilerServices  
  
Public Module RadTabStripExtensions  
  
    <Extension()> _  
    Public Sub FormatMultiLineTabs(ByRef tab As RadTabStrip, ByVal ForceMultiLine As Boolean)  
        Dim intTabCount As Integer = 0  
        For Each objTab As RadTab In tab.Tabs  
            If objTab.Visible Then  
                intTabCount += 1  
            End If  
        Next  
        If ForceMultiLine OrElse intTabCount >= 8 Then 'this can be changed to the line break number 
            Dim intTabBreakIndex As Integer = intTabCount \ 2 - 1  
            If intTabCount Mod 2 = 1 Then  
                intTabBreakIndex += 1  
            End If  
            tab.AddTabBreakToVisibleTabIndex(intTabBreakIndex)  
        End If  
    End Sub  
  
    <Extension()> _  
    Public Sub AddTabBreakToVisibleTabIndex(ByRef tab As RadTabStrip, ByVal VisibleIndexBreak As Integer)  
        Dim intIndex As Integer = 0  
        For Each objTab As RadTab In tab.Tabs  
            If objTab.Visible Then  
                If intIndex = VisibleIndexBreak Then  
                    objTab.IsBreak = True  
                End If  
                intIndex += 1  
            End If  
        Next  
    End Sub  
  
End Module  

Smitha Test
Top achievements
Rank 1
 answered on 21 Oct 2009
2 answers
136 views

I am having trouble with the EmptyMessage parameter being viewable in firefox.  This is what is happening:

I have a page that has a radtextbox as shown

<rad:RadTextBox ID="txtEmail" runat="server" MaxLength="200" EmptyMessage="E-mail address" EnableEmbeddedSkins="false" Skin="TEST" Width="200px" /> 

When I view the page in IE everything is good in that the empty message appears, and when I set focus to the textbox the message goes away and when the textbox loses focus the message comes back.  The problem I am seeing is when viewing this same page in firefox.  The page loads just fine with the empty message in the text box and it goes away when I set focus to the text box.  But when focus is lost in the text box without typing anything in, the empty message does not reappear.

I was looking at a demo on the telerik site:
http://demos.telerik.com/aspnet-ajax/input/examples/radtextbox/firstlook/defaultcs.aspx

and experienced the same thing.  I am running firefox 3.0 if that helps.

Do I need to add anything else to the radtextbox to get this to work in firefox too?

Thanks

Tom
Top achievements
Rank 1
 answered on 21 Oct 2009
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?