Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
76 views

When we are looking at a schedule with a recurring event from 1am to 3am Sunday to Tuesday, the overflow icons showing only on Monday and Tuesday.  It doesn't show up on Sunday.  See attached image as example.

Is there a way to do this?

Peter Milchev
Telerik team
 answered on 27 Jun 2016
2 answers
355 views
Do you have an example of how to pass in an argument (for example an image name) from a javascript function to a radlightbox when it opens?  I want to do something like the below, where the onmouseover in the <img src opens the lightbox if I hard code the value in the <asp:Image.
I need to load different images on different img src tags so I thought passing the image name via the funcion was the cleanest way to do so. 

Is this the best way to do this:
http://www.telerik.com/forums/parameterized-lightbox-show()-functions---how-to-do-it

The disadvantage is that it looks like every image is loaded when the page is rendered, I was hoping it load the image dynamically.
Thanks for your help!



<script type="" >
function loadlb(imageName) {
        var rbx = $find('<%= rlbBox.ClientID %>');
        rbx.show();
}
</script>

<telerik:RadLightBox Modal="true" RenderMode="Auto" ClientIDMode="Static" ID="rlbBox" runat="server" ShowCloseButton="true">
        <ClientSettings><AnimationSettings></AnimationSettings></ClientSettings>
        <Items>
            <telerik:RadLightBoxItem>
                <ItemTemplate>
<asp:Image runat="server" ImageUrl="<image_from_loadlb>"/> 
                </ItemTemplate>
            </telerik:RadLightBoxItem>                 
        </Items>
</telerik:RadLightBox>


<img src=<some image> onmouseover="loadlb('imageToLoad'.jpg')" >
mack
Top achievements
Rank 1
 answered on 27 Jun 2016
3 answers
180 views

I have the following two RadListBoxes defined to allow switching items between them. All was well until I defined OnInserted and OnDelted, which fail to fire.

I  need to take action when anything is added to or removed from the right list box. This is they only way I'm aware of doing it, but like I said the events don't fire.

Here's the associated code:

<telerik:RadListBox runat="server" ID="rlbxAvailableRoles" Height="210" Width="230" AllowTransfer="true" TransferToID="rlbxSelectedRoles"
    ButtonSettings-AreaWidth="35px" AllowTransferOnDoubleClick="true" ButtonSettings-ShowTransferAll="false">
    <HeaderTemplate>
        <h3>Available Roles</h3>
    </HeaderTemplate>
</telerik:RadListBox>
<telerik:RadListBox runat="server" ID="rlbxSelectedRoles" Height="210" Width="190" EmptyMessage="Select at least one role"
    OnInserted="rlbxSelectedRoles_Inserted" OnDeleted="rlbxSelectedRoles_Deleted">
    <HeaderTemplate>
        <h3>Selected Roles</h3>
    </HeaderTemplate>
</telerik:RadListBox>

protected void rlbxSelectedRoles_Inserted(object sender, RadListBoxEventArgs e)
{
    LoadPrimaryRoleDropdown();
}
 
protected void rlbxSelectedRoles_Deleted(object sender, RadListBoxEventArgs e)
{
    LoadPrimaryRoleDropdown();
}

 

 

Any help would be appreciated

Ivan Danchev
Telerik team
 answered on 27 Jun 2016
3 answers
756 views
Hi,
I would like to edit a gridhyperlinkcolumn's navigateurl in my code behind. I have tried:
RadGrid grid = (RadGrid)sender;
GridColumn column = grid.Columns.FindByUniqueName("ViewBus");
(column as GridHyperLinkColumn).NavigateUrl = "www.google.ca";


in both the PreRender and DataBound events. Any suggestions?
Eyup
Telerik team
 answered on 27 Jun 2016
1 answer
99 views

Hi, 

I have Activity object which has childActivity which is a dynamic data type.

DataSource to grid is list of Activity.

How can assign few columns of grid with values of child object.

I was trying like below code.

 col.UniqueName = item.Name;

col.HeaderText = item.DisplayName;
(col as GridDateTimeColumn).DataField =  Activity.childActivity.Name;

 

Viktor Tachev
Telerik team
 answered on 27 Jun 2016
1 answer
139 views

Here is my code:

 

function RadGrid1_Command(sender, args) {
               var commandName = args.get_commandName();
               if (commandName == "RebindGrid")
               {                  
                   var editedrow = args.get_itemIndexHierarchical();

                   //var itemIndex = args.get_commandArgument();

                   var master = $find('<%= RadGrid1.ClientID %>').get_masterTableView();
 
                   $.ajax({
                       type: "POST",
                       url: "Default.aspx/...",
                       data: "{year: 1}",
                       contentType: "application/json; charset=utf-8",
                       dataType: "json",
                       success: function (data) {
                           var response = data.d;
                           alert(response.message);
                       }
                   });
               }               
           }

I can't get the row index from get_itemIndexHierarchical() (JS error function does not exist). Also get_commandArgument() is blank if  I try that.

 

Can anyone help?

Viktor Tachev
Telerik team
 answered on 27 Jun 2016
9 answers
887 views
I upload a document and click a button, I want to get the file name under temporary folder for the uploaded document.How can I get it?
Plamen
Telerik team
 answered on 27 Jun 2016
9 answers
588 views
Hello!

i try to use the Colorpicker inside a FormView and want to bind property SelectedColor to SqlDataSource using the following code:
<telerik:RadColorPicker ID="colpickschedule_color" runat="server" Preset="Standard"
 ShowIcon="True" SelectedColor='<%# Bind("color") %>'>
</telerik:RadColorPicker>
when opening the form it says "specified cast is not valid".. this happanes when field in database contains some hex-color as string (#cacaca) and for DbNull-Values...

also tried something with ColorTranslator, but this only works for displaying data, null values throws some other errors..

can someone please explain how to do this? thank you!
achim
Peter
Top achievements
Rank 1
 answered on 25 Jun 2016
3 answers
58 views

What i want is to add a custom filter to one column that will takes the date from this column as first date and a date in another column as the second date to do a between like filter with these two dates.

I added a custom filter with  FilterListOptions="VaryByDataTypeAllowCustom".

then i added an handler like this (my second date is in "Col2") but this isn't working. What am i missing?:

Protected Sub gvAbsence_ItemCommand(source As Object, e As GridCommandEventArgs) Handles gvAbsence.ItemCommand
        If e.CommandName = RadGrid.FilterCommandName Then
            Dim filterPair As Pair = DirectCast(e.CommandArgument, Pair)
            If filterPair.First.ToString() = "Custom" Then
                Dim colName As String = filterPair.Second.ToString()
                If colName = "Col0" Then
                    Dim tbPattern As TextBox = TryCast(TryCast(e.Item, GridFilteringItem)(colName).Controls(0), TextBox)
                    Dim values As String() = tbPattern.Text.Split(" "c)
                    If values.Length = 1 Then
                        e.Canceled = True
                        Dim newFilter As String = "(([" + filterPair.Second + "] <='" + values(0) + "') AND ([" + "Col2" + "] >='" + values(0) + "'))"
                        If gvAbsence.MasterTableView.FilterExpression = "" Then
                            gvAbsence.MasterTableView.FilterExpression = newFilter
                        Else
                            gvAbsence.MasterTableView.FilterExpression = (Convert.ToString("((" + gvAbsence.MasterTableView.FilterExpression + ") AND (") & newFilter) + "))"
                        End If
                        gvAbsence.Rebind()
                    End If
                End If
            End If
        End If
    End Sub

Maria Ilieva
Telerik team
 answered on 24 Jun 2016
7 answers
203 views

Hi,

I'm attempting to print a RadGrid via JavaScript in Chrome.  I'm getting one of two results:

  1. A blank preview window appears and prints a blank page.
  2. An error stating "Print preview failed" appears.

Everything works as intended in IE 11. 

Here is my code.  Thanks!

01.function RadButtonRCCPrint_ClientClick() {
02.  var previewWnd = window.open('about:blank', '', '', false);
03.  var sh = '<%= ClientScript.GetWebResourceUrl(RadGridRCC.GetType(), String.Format("Telerik.Web.UI.Skins.{0}.Grid.{0}.css", RadGridRCC.Skin)) %>';
04.  var styleStr = "<html><head><style>.RadGrid_Windows7 .rgRow td, .RadGrid_Windows7 .rgAltRow td { border: solid 1px #000000; }</style><link href='" + sh + "' rel='stylesheet' type='text/css'></link></head>";
05.  var htmlContent = styleStr + "<body>" + $find('<%= RadGridRCC.ClientID %>').get_element().outerHTML + "</body></html>";
06.  previewWnd.document.open();
07.  previewWnd.document.write(htmlContent);
08.  previewWnd.document.close();
09.  previewWnd.print();
10.  previewWnd.close();
11.}

Konstantin Dikov
Telerik team
 answered on 24 Jun 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?