Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
122 views
Dear All,

To avoid page refreshing I used RadAjaxManager and Add AjaxSetting but if I use like this when I back('back' button from browser) from another page all data I have filled in textbox, selected in combobox are disappear and Page_load event is firing.
If not using AjaxSetting, when user use back button from browser, Page_load is not fire and data are remain as user filled.
I want to use Ajaxsetting to prevent page refresh and when using browser back button data should remain(page_load should not fire).
Please advise how can I?

Thanks and best regards
Naunton
Top achievements
Rank 1
 answered on 05 Aug 2011
1 answer
89 views
Hi

I have RadRotator inside EditItemTemplate of RadListView. It is used for inserting images into items.
I also need implement possibility to filter rotator's images by text pattern. Filter requires roundtrip to server.
So I decided to put RadRotator inside UpdatePanel and to call __doPostback on key pressing in search textbox.
But I can't rebind Rotator on Postback to show new image collection. Even when its datasource contains new data,
Rotator shows initial collection of images.

I create RadListView in full programmatic way. In EditItemTemplate constructor I put actual data and then instantiate rotator, but
Rotator always show first data.

I have simple test app here which demonstrate problem. After pressing Edit button and typing some text in search field we can see only
how rotator blinks and images are not affected.

My QuoteHotelItemEditTemplate implements IBindableTemplate interface and creates UpdatePanel with Rotator ctrl in InstantiateIn method.
There I also assign data to Rotator's DataSource.
Debugger show that Rotator binds to new data source on PostBack but page renders old result.
Sorry for disturbing but please help me.



PS:
I'm using Telerik 2011 Q1.
dbozhyk
Top achievements
Rank 1
 answered on 05 Aug 2011
1 answer
98 views
Why is my <InvalidStyle> tag being ignored on all of my RadControls? It insists on using the default. Version 2011.2.712.40

ASP.Net snippet
<telerik:RadTextBox ID="txtFirstName" CausesValidation="true" EmptyMessage="Enter First Name"
      MaxLength="100" runat="server" SelectionOnFocus="SelectAll" AutoCompleteType="FirstName" Width="240px">
    <InvalidStyle CssClass="input_box_error" />
</telerik:RadTextBox>

CSS class I want applied (namely, custom bg image)
.input_box_error {
background-color: #FCF7F7;
color:#333;
border: 1px solid #990000;
Background-image: url(web_images/icon_input_error.png);
background-position:right;
}

Javascript validation method
function validateFirstName(sender, args) {
            var tb = $find("<%= txtFirstName.ClientID %>");
            if (tb.get_value() == "") {
                tb._invalid = true;
                tb.updateCssClass();
                args.IsValid = false;
            }
            else {
                tb._invalid = false;
                tb.updateCssClass();
                args.IsValid = true;
            }
        }

The default style that's being applied:
html body .RadInput_Default .riError, html body .RadInput_Error_Default
{
border-top-color: #d51923;
border-right-color-value: #d51923;
border-bottom-color: #d51923;
border-left-color-value: #d51923;
border-left-color-ltr-source: physical;
border-left-color-rtl-source: physical;
border-right-color-ltr-source: physical;
border-right-color-rtl-source: physical;
background-color: #ffffff;
background-image: url("WebResource.axd?d=Pl-AEyM6jqu8ijnVblcTiccZs9g-fx3RblQsV5LQ2xg8VP_Hxt2xcHsDuXiwDfB8GPPz5PpcKKZImQCrk72Jq3nUpEh_RIWAGLrotZeEzHhmO1hmMkfKXxD79gitj70HcRZKnaksvfXoqOK93XI3ITGi1zI1&t=634459979340000000");
background-repeat: no-repeat;
background-attachment: scroll;
background-position: 100% -298px;
background-clip: border-box;
background-origin: padding-box;
background-size: auto auto;
color: #d51923;
}
K
Top achievements
Rank 1
 answered on 04 Aug 2011
4 answers
118 views
I have a very plain drop down with only a few entries.  Before this morning, the list is populated and you could click on any entry and nothing happened...which was fine because there was no code.  Now I want it to do something when one of the list items is selcted (redirect to another page).  So I added OnSelectedItemChanged = "RadComboBox1_OnSelectedItemChanged" to the html definition of the combobox, then in the code behind I have a function to match that does a Select Case statement and redirects to the appropriate page based on which item the user selects.

Now that I've added this code I can't click on the ComboBox anymore.  It doesn't drop-down like it should.

HTML Page:
Choose Location: 
<telerik:RadComboBox ID="RadComboBox1" Runat="server" DropDownWidth="200px"
    EnableTextSelection="False" Height="50px" MaxHeight="200px" NoWrap="True"
    Width="200px" OnClientSelectedIndexChanged="RadComboBox1_SelectedIndexChanged">
    <Items>
        <telerik:RadComboBoxItem runat="server" Text="Atlanta" Value="ATL" />
        <telerik:RadComboBoxItem runat="server" Text="Cincinnati" Value="CIN" />
        <telerik:RadComboBoxItem runat="server" Text="Cleveland" Value="CLV" />
        <telerik:RadComboBoxItem runat="server" Text="Dayton" Value="DAY" />
        <telerik:RadComboBoxItem runat="server" Text="Kansas City" Value="KC" />
        <telerik:RadComboBoxItem runat="server" Text="Kansas" Value="KAN" />
        <telerik:RadComboBoxItem runat="server" Text="Memphis" Value="MEM" />
        <telerik:RadComboBoxItem runat="server" Text="Northeast Ohio" Value="NEO" />
        <telerik:RadComboBoxItem runat="server" Text="Oklahoma City" Value="OKC" />
        <telerik:RadComboBoxItem runat="server" Text="Philadelphia" Value="PHL" />
        <telerik:RadComboBoxItem runat="server" Text="St. Louis" Value="STL" />
    </Items>
</telerik:RadComboBox>



Code Behind .aspx page:
    Protected Sub RadComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles RadComboBox1.SelectedIndexChanged
        Select Case e.Value
            Case "ATL"
 
            Case "CIN"
 
            Case "CLV"
                Response.Redirect("http://www.someurl.com/CLV.asp")
 
            Case "DAY"
 
            Case "KAN"
 
            Case "KC"
 
            Case "MEM"
 
            Case "NEO"
 
            Case "OKC"
 
            Case "PHL"
 
            Case "STL"
 
        End Select
    End Sub
End Class
dean.carrefour
Top achievements
Rank 1
 answered on 04 Aug 2011
1 answer
121 views
Hi,

I have a rad editor in one of my modal pop up pages.

I am unable to change the font name (style) of the selected text in the editor. It always defaults to "Verdana" style. I tried various things and i am unable to get this working. I did not find any related article on this in the forums as well. I am testing this in IE 7.

Please suggest me a possible solution.

Thanks and regards,
Damodar
Rumen
Telerik team
 answered on 04 Aug 2011
2 answers
175 views
This seems like it should be really easy and maybe I am just missing something obvious.

I have a simple line chart with 2 lines, its databound.
Y axis is numbers
X axis are dates , last 12 months

It just shows numbers for each date, ie; 1 ,2 , 3 , 4 ..... 11, 12

I want the X axis label to show as dates but I can't figure out how to do it. Using the Chart wizard on the data tab if I set X-Axis to my date column the wizard just disappears before I even click OK.  I have tried a few other ways and I get errors like: Unable to cast object of type 'System.DateTime' to type 'System.String'.

ideas?

thanks





Najid Hanif
Top achievements
Rank 2
 answered on 04 Aug 2011
4 answers
152 views
Hi,

Can you tell me why I can never get the Rad ajax manager to work properly? Everytime I've attempted to use this feature it only partially works. Everything seems to work fine except there is still a postbackto causing my browser to refresh. Is there somthing i'm down wrong?I was under the impression that using this feature will allow me to update a control without the postback, am I wrong? Here's the aspx , followed by the c#
<div id="StatusWrapper">
                <telerik:RadAjaxManager ID="RadAjaxManager" runat="server">
                    <ClientEvents OnResponseEnd="OnResponseEnd" OnRequestStart="OnRequestStart"></ClientEvents>
                    <AjaxSettings>
                        <telerik:AjaxSetting AjaxControlID="btnMakeActive">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="lblStatus" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                        <telerik:AjaxSetting AjaxControlID="BtnSend">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="lblStatus" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                    </AjaxSettings>
                </telerik:RadAjaxManager>
                <div id="Status">
                    Status:
                        <asp:Label ID="lblStatus" runat="server" Text="Active"></asp:Label>
                </div>
            </div>
protected void btnMakeActive_Click1(object sender, EventArgs e)
   {
       string currentStatus = Staff.GetStaffStatus(id);
       string status = string.Empty;
 
       if (currentStatus == "Active")
           status = "Inactive";
       if (currentStatus == "Inactive")
           status = "Active";
       Staff.UpdateStatus(id, status);
 
       lblStatus.Text = status;
   }
Ron
Top achievements
Rank 1
 answered on 04 Aug 2011
8 answers
444 views
Hi,

I'm building an ASP.NET MVC application, and would like find an easy way to generate and show charts.

Is it possible to use Teleriks library of charts, e.g. RadControls, in an MVC application, and if so, how?

//Erik
Todd Anglin
Top achievements
Rank 2
 answered on 04 Aug 2011
0 answers
88 views
Good Morning Sir,

I have a Parent Grid. in its Item Template i have two more grid. One For Country and second for states.
i bind both grid on the ItemDatabaound of the parent gird. both grid bound successfully bound.
below is the HTML how i put the grid.

<telerik:RadGrid ID="HeaderGrid" runat="server"
        onitemdatabound="HeaderGrid_ItemDataBound" >                    
       <MasterTableView>    
       <ItemTemplate>          
        <asp:Label ID="lblCountryID" runat="server" Visible="true" Text='<%#Eval("CountryID")%> '></asp:Label>      
         <telerik:RadGrid ID="CountryGrid" runat="server">
         </telerik:RadGrid>    
         <telerik:RadGrid ID="StateGrid" runat="server">
         </telerik:RadGrid>
       </ItemTemplate>
       </MasterTableView>
</telerik:RadGrid>


on item databound both grid are bind successfully.
 protected void HeaderGrid_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (e.Item.ItemType == GridItemType.Item ||
            e.Item.ItemType == GridItemType.AlternatingItem)
        {
            int CountryID = Convert.ToInt32(((Label)e.Item.FindControl("lblCountryID")).Text);
            RadGrid CountryGrid= (RadGrid)e.Item.FindControl("CountryGrid");
            con = new SqlConnection("data source=(local);initial catalog=iTracker_DB;persist security info=True;user id=iTrackerUser;password=77Bcc333");
            cmd = new SqlCommand("select * from Country where CountryID = '" + CountryID + "' ", con);
            con.Open();
            SqlDataReader dr = cmd.ExecuteReader();
            DataTable dt = new DataTable();
            dt.Load(dr);
            con.Close();
            CountryGrid.DataSource = dt;
            CountryGrid.DataBind();

            RadGrid StateGrid= (RadGrid)e.Item.FindControl("StateGrid");
            con = new SqlConnection("data source=(local);initial catalog=iTracker_DB;persist security info=True;user id=iTrackerUser;password=77Bcc333");
            cmd = new SqlCommand("select * from State where CountryID = '" + CountryID + "' ", con);
            con.Open();
            SqlDataReader dr1 = cmd.ExecuteReader();
            DataTable dt1 = new DataTable();
            dt1.Load(dr1);
            con.Close();
            StateGrid.DataSource = dt1;
            StateGrid.DataBind();
        }
    }

when i export with this code
 HeaderGrid.ExportSettings.ExportOnlyData = true;
  HeaderGrid.ExportSettings.Excel.Format = GridExcelExportFormat.ExcelML;
only Country data is exported.
how state data can be exported.


please reply soon.
bharat veer
Top achievements
Rank 1
 asked on 04 Aug 2011
2 answers
96 views
I am following the demo from this link http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/nestedviewtemplate/defaultcs.aspx except I am working in a VS2010 visualWebPart project for Sharepoint2010.

Is there a way to have the same loadOnDemand functionality this demo provides but without the first item being expanded by default?
 protected void RadGrid1_PreRender(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                RadGrid1.MasterTableView.Items[0].Expanded = true;
                RadGrid1.MasterTableView.Items[0].ChildItem.FindControl("InnerContainer").Visible = true;
            }
        }

If I remove "RadGrid1.MasterTableView.Items[0].Expanded = true;", I get the below javascript error
Sys.ArgumentUndefinedException: Value cannot be undefined.
Parameter name: type

I have been messing with this for awhile now and can only get it to work with that first item expanded.
JonathanElsner
Top achievements
Rank 1
 answered on 04 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?