Telerik Forums
UI for ASP.NET AJAX Forum
8 answers
163 views
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    This is the first page.<br />
            <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Default2.aspx">Go to page with combobox</asp:HyperLink>
  
    </div>
    </form>
</body>
</html>
  
  
  
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" %>
  
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
    <div>
            Hitting the Backspace key after selecting an item here will redirect back to Default
            <telerik:RadComboBox ID="RadComboBox1" runat="server">
            <Items>
                <telerik:RadComboBoxItem Value="0" Text="Item 0" />
                <telerik:RadComboBoxItem Value="1" Text="Item 1" />
                <telerik:RadComboBoxItem Value="2" Text="Item 2" />
                <telerik:RadComboBoxItem Value="3" Text="Item 3" />
            </Items>
            </telerik:RadComboBox>
    </div>
    </form>
</body>
</html>
I am sure this has been addressed before, but I couldn't find any reference for it. So, here is the problem I found: when an item in a radcombox is selected, if you hit the backspace key, you will be redirected to the previous page. Below is my code: Starting from Default.aspx page, click on the hyperlink to Default2.aspx; selecting any of the items in the Radcombobox, hit the backspace key and you go back to Default.aspx.

Hopefully, it would be a simple solution to fix this. Thanks.

Tri Nguyen

Hristo Valyavicharski
Telerik team
 answered on 11 Mar 2013
2 answers
96 views
Hi

I am trying to change the style of my headercontextmenu since it is transparent now on the RadGrid. How can i change this?

thanks

Dirk
Raj
Top achievements
Rank 1
 answered on 11 Mar 2013
1 answer
99 views
Hello,
I would like to update my language localization of GlobalResources from Q3/2012 to Q1/2013.
I found that original files RadColorPicker.resx, RadSocialShare.resx and RadWindow.resx are missing
in new Q1/2013 installation package. Are their contents moved to the other files?
Thanks
-Marian
Marin Bratanov
Telerik team
 answered on 11 Mar 2013
0 answers
95 views
Hi,

I want to do a search page with pagination that when I click on an item I get a new page with the detail information. On the detail page, I want to be able to press on a back to results button to back to the result page, or a back button to see the prior item, or a next button to see the next item of the search results.

What would be the best way to acheive that with the radgrid in the result page ?
What kind of datacontrol or databinding to persist the information across web pages ?

Thank you

Carl
Carl
Top achievements
Rank 1
 asked on 11 Mar 2013
3 answers
80 views
Hi,

I upgraded to the 2013 Q1 release today, excited for the new features, but experienced a pretty big bug.  Here is what I'm seeing:

  1. No problems with 2012.2.912 (most recent before 2013 Q1).
  2. Upgrade to 2013 Q1.
  3. On ItemDataBound and on ItemCommands, I'm unable to read "text" problem for grid columns via the following code.  In every case, even when data exists in the column, item("ColumnName").Text returns "&nbsp;".

Protected Sub TruckersRadGrid_ItemDataBound(ByVal sender As Object, ByVal e As GridItemEventArgs)
 
    If TypeOf e.Item Is GridDataItem Then
 
        Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
        Dim myFlowStepID As String = item("FlowStepID").Text

Protected Sub TruckersRadGrid_ItemCommand(ByVal sender As Object, ByVal e As GridCommandEventArgs) Handles TruckersRadGrid.ItemCommand
 
    Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
    Dim myPartyID As String = item("PartyID").Text

When I go back to the previous release, the problem solves itself.   Also, here is the resulting page in an error state:

https://gist.github.com/fastport/5103685

One more note: I believe if I set the visibility of the columns that need the "text" from, the procedures above can see the values.  But I haven't tested this thoroughly.  This is not the case with previous release.  The values are visible server side no problem.

Please let me know if anyone has any ideas what is up, because I am excited to have access to the new features.

Jim

Andrey
Telerik team
 answered on 11 Mar 2013
5 answers
133 views
Hello,

before this is my html code and vb.bet code:
<asp:Panel ID="PanelRadlist" runat="server" Width="700px">
<div style="font-family:Verdana; width:65" id="div_radlistview">
<telerik:RadListView ID="RadListView1" runat="server" DataKeyNames="idutente"
ItemPlaceholderID="Contenitore" AllowPaging="True" Skin="Office2010Silver"
Width="650px" OnPageIndexChanged="RadListView1_PageIndexChanged">
<LayoutTemplate>
<fieldset style="width: 700px; border:0px" id="FieldSet1">
<legend></legend>
<asp:Panel ID="Contenitore" runat="server">
</asp:Panel>
</fieldset>
</LayoutTemplate>
<ItemTemplate>
<div class="item">
<div class="image">
<asp:Image ID="Image1" runat="server" ImageUrl='<%# CType(Container.DataItem, PropertyUtente).imageprofile%>' Height="120px" Width="110px"/>
</div>
<div class="content">
<div class="user">
<b><%# CType(Container.DataItem, PropertyUtente).utente%></b>
</div>
<div class="description_category">
Categoria: <%# CType(Container.DataItem, PropertyUtente).Desccategoria%>
</div>
<div class="description_city">
Città: <%# CType(Container.DataItem, PropertyUtente).Desccomune%></div>
<div class="description_phone">
Telefono: <%# CType(Container.DataItem, PropertyUtente).Telefono%></div>
<div class="description_email">
Email: <%# CType(Container.DataItem, PropertyUtente).Email%>
</div>
<div class="item_button">
<telerik:RadButton ID="RadButton1" runat="server" Text="Visualizza biglietto completo" Width="170px" Skin="Office2010Silver"
OnClick="RadButton1_Click">
</telerik:RadButton>
</div>
</div>
</div>
</ItemTemplate>
</telerik:RadListView>
<telerik:RadDataPager ID="RadDataPager1" runat="server"
PagedControlID="RadListView1" Culture="it-IT" Width="700px">
<Fields>
<telerik:RadDataPagerButtonField FieldType="FirstPrev"></telerik:RadDataPagerButtonField>
<telerik:RadDataPagerButtonField FieldType="Numeric"></telerik:RadDataPagerButtonField>
<telerik:RadDataPagerButtonField FieldType="NextLast"></telerik:RadDataPagerButtonField>
</Fields>
</telerik:RadDataPager>
</div> <!-- end div radlist -->
</asp:Panel>

Imports System
Imports System.Web
Imports System.Data
Imports System.Data.SqlClient
Imports Telerik.Web.UI
Imports System.Web.UI.HtmlControls
Imports System.IO
Imports TRYcontact
 
Public Class search
    Inherits RadAjaxPage
    Private ObjUtente As New PropertyUtente
    Private Loadsearch As New GestoreUtente
    Private Sub Carica_risultati(ByVal _str1 As String, ByVal _str2 As String)
        Dim lista As List(Of PropertyUtente) = Loadsearch.Search(_str1, _str2)
        label1.text = "Risultati trovati: " & CInt(lista.Count)
        RadListView1.DataSource = lista
        RadListView1.DataBind()
    End Sub
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            Dim _str1, _str2 As String
            _str1 = Request.QueryString("_str1")
            _str2 = Request.QueryString("_str2")
            Carica_risultati(_str1, _str2)
            Me.ClientScript.RegisterStartupScript(Me.GetType, "", "Height_Div();", True)
        End If
    End Sub
 
    Protected Sub RadButton1_Click(sender As Object, e As System.EventArgs)
        Dim Button As RadButton = CType(sender, RadButton)
        Dim item As RadListViewDataItem = CType(Button.Parent, RadListViewDataItem)
        Dim dd As Integer = item.GetDataKeyValue("idutente")
        Response.Redirect("publicard.aspx?_id=" & item.GetDataKeyValue("idutente"))
    End Sub
 
    Protected Sub RadListView1_PageIndexChanged(sender As Object, e As Telerik.Web.UI.RadListViewPageChangedEventArgs) Handles RadListView1.PageIndexChanged
        RadListView1.CurrentPageIndex = e.NewPageIndex
        Dim _str1, _str2 As String
        _str1 = Request.QueryString("_str1")
        _str2 = Request.QueryString("_str2")
        Carica_risultati(_str1, _str2)
    End Sub
End Class
Digita il testo o l'indirizzo di un sito web oppure traduci un documento.
now the my problem is that  that when I click on the next button to go forward with the record, the selection of the next page is not the case still remains the number one and then if I click on button press or back first, the pages do not come back and you do not see the change records.
look at the picture I posted
And another question..it is possible that when I click on DataPage to change the page, being the property PageSize = 10, the display of the page to look back at the first record in high .. then come back as if the scrollbar on it ... like in google
i used this code: 

 

ScriptManager.RegisterStartupScript(Page, Me.GetType, "Goon", "window.scrollTo(0,0);", True)

but is only a refresh of Pgina and the scrollbar is always positioned at the bottom so the page does not return at the beginning of the list.




Kostadin
Telerik team
 answered on 11 Mar 2013
4 answers
231 views
Hi,
    I set initial content while page_loaded. After i change content i can see changes by clicking track changes button.
    But there is a scenerio like this.
    First user writes a content and saves.(xml, sql etc.)
    Second user opens saved content (Page_Load)
    Makes changes and saves again.
    First user opens document. User wants to see changes made by second user. 
    How?

    Thanks.
   
Rumen
Telerik team
 answered on 11 Mar 2013
6 answers
151 views
Hi,
I have aspx page it has usercontrol, radwindow,  and inside radwindow it has radrotator.
User control  has gridview when user click linkbutton inside gridview, I am showing radwindow as a popup.
When loading aspx page I am binding data to radrotator.

When user clicks link current item is not setting properly. 
But when the window is closed and reopened it works fine.
//aspx
<
telerik:RadWindowManager ID="RWM" Height="640px" Width="870px" ShowContentDuringLoad="false" ReloadOnShow="true" runat="server">
       <Windows>
         <telerik:RadWindow ID="RW_Detail" Localization-Restore="none" runat="server" Modal="True"
                    VisibleStatusbar="False" Behaviors="Close" Title="Deck Images" IconUrl="~/images/SmallLogo.jpg">
                    <ContentTemplate>
                        <div style="background-repeat: no-repeat; box-sizing: border-box; -moz-box-sizing: border-box;">
                            <div style="margin: 0 auto;">
                                <telerik:RadRotator ID="RadRotatorDetail" Height="525px" Width="850px" BorderColor="Transparent"
                                    ItemWidth="836px" BorderWidth="0" WrapFrames="false" RotatorType="Buttons" runat="server"
                                    ControlButtons-LeftButtonID="img_left" ControlButtons-RightButtonID="img_right" Skin="MetroTouch">
                                    <ItemTemplate>
                                        <div style="overflow-y: auto; height: 510px; width: 836px">
                                            <asp:Image ID="imgDetails" ImageUrl='<%# Eval("ID")+"\\"+Eval("ImageName")%>'
                                                SlideID='<%#Eval("ID") %>' runat="server" ImageAlign="Middle" />
                                            <br />
                                        </div>
                                    </ItemTemplate>
                                </telerik:RadRotator>
                            </div>
                            <div>
                                <div style="float: right;">
                                    <asp:Image ImageUrl="~/images/ticks/arrow_right.png" ID="img_right" AlternateText="right" runat="server"
                                        Style="margin: -10px 0px; cursor: pointer;" />
                                </div>
                                <div style="float: left">
                                    <asp:Image ImageUrl="~/images/ticks/arrow_left.png" ID="img_left" AlternateText="left" runat="server"
                                        Style="margin: -10px 0px; cursor: pointer;" />
                                </div>
                            </div>
                        </div>
                        <br />
                    </ContentTemplate>
                </telerik:RadWindow>
            </Windows>
        </telerik:RadWindowManager>
//Inside Aspx.cs
MainDetails mDetails = new MainDetails();
DataSet ds = mDetails.Get_Details(m_ID, false) as DataSet;
RWM.Shortcuts.Add("Close", "Esc");
RadRotatorDetail.DataSource = ds;
RadRotatorDetail.DataBind();
<asp:TemplateField HeaderText="More Detail">
<ItemTemplate>
<asp:LinkButton ID="LB" runat="server" OnClientClick=<%# "Show_Window('" + Eval("ID") +"'); return false;" %>
                     Text='<%# Eval("Pro_Name") %>'></asp:LinkButton>
</ItemTemplate>
<ControlStyle Font-Bold="False" ForeColor="#003399" />
     <ItemStyle HorizontalAlign="Justify" />
</asp:TemplateField>
//javascript inside usercontrol.
<
script type="text/javascript">
    function Show_Window(ID) {
        var oManager = GetRadWindowManager();
        var oWnd = oManager.GetWindowByName("RW_S");
        var radRotator = GetRadRotator();
        var RadImgItems = radRotator.get_items();
   
ID = firstItem(ID);
        for (var name in RadImgItems) {
            if (ID == GetAttributeValue(RadImgItems[name], "SlideID")) {
                radRotator.set_currentItemIndex(RadImgItems[name].get_index(), false);
                radRotator.repaint();
            }
        }         
        oWnd.Show();
    }
    function firstItem(ID) {
        if (ID.indexOf(",") !== -1) {
            var firstItemName = ID.substring(0, ID.indexOf(","));
        }
        else
            firstItemName = ID;
        return firstItemName.trim();
    }
    function GetAttributeValue(item, name) {
        return $telerik.$(item.get_element()).find("img").attr(name);
    }
Am I missing something? How to force it to load correct index? In first popup it does goes through
 radRotator.set_currentItemIndex(RadImgItems[name].get_index(), false);

Best Regards,
Damdoar
Slav
Telerik team
 answered on 11 Mar 2013
3 answers
138 views
Hello,

We are doing an html export of a page that has a Radgrid placed inside. We have some problem with telerik skin and with scripts. 
The grid html export  is made by the overriden render function of the page, we do that in this way because we need other parts of the page on a html and pdf export.

How can I export with embeded styles?


thanks in advance,
Emanuele
MgfProject s.r.l.
Alessandro
Top achievements
Rank 1
 answered on 11 Mar 2013
5 answers
357 views
Hi!

I have a RadDatePicker that I want to reset its value on the server-side during a postback when the input is invalid. But it seems that once the property InvalidTextBoxValue is set, there is no way to clear that.

My test code looks something like this:

If Page.IsPostBack AndAlso Not String.IsNullOrEmpty(Me.RadDatePicker1.InvalidTextBoxValue) Then
    ' None of the following will help to show a new selected date in the date input -- the date input will fail to show anything
    Me.RadDatePicker1.Clear()
    Me.RadDatePicker1.SelectedDate = Now.Date
    Me.RadDatePicker1.DateInput.Clear()
    Me.RadDatePicker1.DateInput.SelectedDate = Now.Date
End If

I studied the source code in RadDateInput.cs and there are two variables used by InvalidTextBoxValue:

protected bool invalidDateStringFlag = false;
protected string invalidDateString;

It seems that those variables are never cleared anywhere, and once they are set there is no way to reset them, and those variables are affecting the logic of several properties and functions.

Shouldn't these variables be cleared when calling RadDatePicker.Clear or when setting RadDatePicker.SelectedDate, so that the RadDatePicker starts to behave "normally" again? Otherwise the RadDatePicker remains locked in its "invalid state" no matter what.

As an example, the following property of RadDateInput will never work properly again once the invalidDateStringFlag was set, since that flag is never cleared:

public virtual DateTime? SelectedDate
{
    get
    {
        if (String.IsNullOrEmpty(Text) || invalidDateStringFlag)
        {
            return null;
        }
        else
        {
            return DateTime.ParseExact(Text, hiddenFormat, DateTimeFormatInfo.InvariantInfo);
        }
    }
    set
    {
        if (value.HasValue)
        {
            if ((value > MaxDate) || (value < MinDate))
            {
                throw new ArgumentOutOfRangeException("SelectedDate", String.Format("Value of '{0}' is not valid for 'SelectedDate'. 'SelectedDate' should be between 'MinDate' and 'MaxDate'.", value));
            }
            Text = value.Value.ToString(hiddenFormat, DateTimeFormatInfo.InvariantInfo);
        }
        else
        {
            Text = null;
        }
    }
}

Setting a new value for the SelectedDate will not change anything -- the returned value will always be Null in that state, no matter what it is changed server-side on the RadDatePicker!

I am using version Telerik.Web.UI.dll 2010.3.1109.35

So, the final question is how to put a new valid value into a RadDatePicker after the user has entered an invalid value? This should preferably be done server-side, since there are some other actions too that need to be taken following an invalid date input (not just resetting the date picker).
Vasil
Telerik team
 answered on 11 Mar 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?