Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
155 views
what does i need to upgrade my rad controls version from RadControls for ASP.NET Q3 2007 to rad Controls 2008 and keep it working properly with .Net 2.0
Princy
Top achievements
Rank 2
 answered on 04 Jun 2009
1 answer
221 views
Hi,
I have a page with a master page. This page has an HTML table and inside that table (no runat server! tag for the table) I have a bunch of RadnumericTextbox controls named tbx1, tbx2, through tbxn.
I want to iterate through these, but when I use the findcontrol method, I get an "Object Reference not set to an instance of an object" error. So i tried to get the value of just one named "tbx1" - still getting the rror
Here is the code I use to test with one control:

asp page:

 

<

 

telerik:RadNumericTextBox ID="tbx1" Runat="server"

 

 

Culture="English (United States)" DataType="System.Int16" MaxValue="400"

 

 

MinValue="0" ShowSpinButtons="True" Width="35px">

 

 

 

 

 

<NumberFormat DecimalDigits="0" />

 

 

 

 

 

</telerik:RadNumericTextBox>

 

 

 

Code behind:
Function CollectAnswer() as string
Dim

 

strResult As String = ""

 

 

Dim tbox As RadNumericTextBox

 

tbox = CType(Page.FindControl("tbx1"), RadNumericTextBox)

 

 

 

strResult = tbox.Text

 

 

Return strResult

 

End Function

I have also tried

tbox = Me.FindControl("tbx1") as the third line, same results

 


with the same results.
I get no errors in VS.

Help?
Shinu
Top achievements
Rank 2
 answered on 04 Jun 2009
2 answers
200 views
I have created a simple grid to show the problem I have encountered. 

The grid contains 3 columns:

Title: The title of the picture
Edit: An 'Edit' link, when you click on this link a tooltip appears with a link (the link includes the unique id of the element). 
Delete: A 'Delete' link to delete the picture.

Problem: When the page first loads all of the tooltips are correct and they display the correct id.  When you click the delete link and the page does an ajax postback, the grid is updated and the row is removed, however the tooltip is still referencing the old ID. 

Hopefully this is a simple fix I am missing, but here is the code and table structure, thanks!


Table Layout:
Table Name: Pictures
Columns:
  • PictureID - int
  • Title - varchar
  • Approved - bit

test.aspx:
<%@ Page language="VB" CodeFile="test.aspx.vb" AutoEventWireup="false" Inherits="_test" %>  
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>  
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">  
<html xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">  
<body>  
    <form runat="server" id="mainForm" method="post">  
        <asp:ScriptManager id="ScriptManager1" runat="server" />  
 
        <telerik:RadToolTipManager ID="RadToolTipManager1"  
            Position="BottomRight" ShowDelay="0" 
            runat="server" OnAjaxUpdate="OnAjaxUpdate" Sticky="true" ShowEvent="OnClick" 
            RelativeTo="Element" EnableViewState="False"
        </telerik:RadToolTipManager>                                                       
 
            <telerik:RadAjaxPanel  
                ID="RadAjaxPanel1"  
                runat="server" 
                LoadingPanelID="LoadingPanel1"
                    <asp:UpdatePanel ID="UpdatePanel3" UpdateMode="Conditional" runat="server"
                        <ContentTemplate> 
 
                            <telerik:RadGrid 
                                ID="RadGrid1" 
                                runat="server" 
                                Width="100%" 
                                Skin="Vista" 
                                OnItemDataBound="RadGrid1_ItemDataBound" 
                                OnItemCommand="RadGrid1_ItemCommand" 
                                DataSourceID="SqlDataSource1"
                                <MasterTableView 
                                    AutoGenerateColumns="False" 
                                    DataKeyNames="PictureID" 
                                    Width="100%"
                                    <Columns> 
                                        <telerik:GridTemplateColumn HeaderText="Title"
                                            <ItemTemplate> 
                                                <asp:HyperLink ID="targetControl" runat="server" NavigateUrl='<%# "picture/" & trim(Eval("PictureID")) & ".aspx" %>' Text='<%# Eval("Title") %>'></asp:HyperLink> 
                                            </ItemTemplate> 
                                        </telerik:GridTemplateColumn> 
                                        <telerik:GridTemplateColumn 
                                            UniqueName="Edit" HeaderText="Edit" ItemStyle-HorizontalAlign="Center"
                                            <ItemTemplate> 
                                                <asp:HyperLink runat="server" NavigateUrl="#" onclick="return false;" Text="edit" ID="hlEditPicture"></asp:HyperLink>                                                         
                                            </ItemTemplate> 
                                        </telerik:GridTemplateColumn> 
                                        <telerik:GridTemplateColumn 
                                            UniqueName="Delete" HeaderText="Delete" ItemStyle-HorizontalAlign="Center"
                                            <ItemTemplate> 
                                                <asp:LinkButton ID="DeletePicture" runat="server" OnClick="deletePicture" CommandArgument='<%# Eval("PictureID") %>'>Delete</asp:LinkButton> 
                                            </ItemTemplate> 
                                        </telerik:GridTemplateColumn> 
                                    </Columns> 
                                </MasterTableView> 
                            </telerik:RadGrid>                                     
                            <asp:SqlDataSource ID="SqlDataSource1" runat="server" SelectCommand="SELECT * FROM Pictures Where approved = 1" ConnectionString="<%$ ConnectionStrings:TestString %>"></asp:SqlDataSource> 
                        </ContentTemplate>                                                                 
                    </asp:UpdatePanel>                                                                 
            </telerik:RadAjaxPanel> 
            <telerik:RadAjaxLoadingPanel ID="LoadingPanel1" runat="server" Transparency="35" BackColor="#E0E0E0"
                <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'  
                    style="margin-top: 50px; margin-left: 0px; position:relative;" /> 
            </telerik:RadAjaxLoadingPanel>         
    </form>  
</body>  
</html>  

test.aspx.vb:
Imports Telerik.Web.UI 
Imports System.Data 
Imports System.Data.SqlClient 
 
Partial Class _test 
    Inherits System.Web.UI.Page 
 
    Protected Sub OnAjaxUpdate(ByVal sender As ObjectByVal args As ToolTipUpdateEventArgs) 
        Me.UpdateToolTip(args.Value, args.UpdatePanel) 
    End Sub 
 
    Private Sub UpdateToolTip(ByVal elementID As StringByVal panel As UpdatePanel) 
        panel.ContentTemplateContainer.Controls.Add(New LiteralControl("<div style=""background:#FFF;font-size:13px;""><strong>Choose an option below:</strong><br /><a href=""edit.aspx?PictureID=" & elementID & """ class=""underline"">Edit Picture ID: " & elementID & "</a></div>")) 
    End Sub 
 
    Protected Sub RadGrid1_ItemDataBound(ByVal sender As ObjectByVal e As GridItemEventArgs) 
        If e.Item.ItemType = GridItemType.Item OrElse e.Item.ItemType = GridItemType.AlternatingItem Then 
            Dim currentRow As DataRowView = DirectCast(e.Item.DataItem, DataRowView) 
 
            Dim hpEditListing As Control = e.Item.FindControl("hlEditPicture"
            If Not [Object].Equals(hpEditListing, NothingThen 
                If Not [Object].Equals(Me.RadToolTipManager1, NothingThen 
                    Me.RadToolTipManager1.TargetControls.Add(hpEditListing.ClientID, currentRow.Row("PictureID").ToString(), True
                End If 
            End If 
        End If 
    End Sub 
 
    Protected Sub RadGrid1_ItemCommand(ByVal source As ObjectByVal e As GridCommandEventArgs) 
        If e.CommandName = "Sort" OrElse e.CommandName = "Page" Then 
            RadToolTipManager1.TargetControls.Clear() 
            RadGrid1.Focus() 
        End If 
    End Sub 
 
    Protected Sub deletePicture(ByVal sender As ObjectByVal e As System.EventArgs) 
        Dim lnkBtn As LinkButton 
        lnkBtn = sender 
 
 
        Dim myConnection As New SqlConnection(ConfigurationManager.ConnectionStrings("testString").ConnectionString) 
        Dim myCommand As New SqlCommand("UPDATE Pictures SET Approved = 0 WHERE PictureID = " & lnkBtn.CommandArgument, myConnection) 
 
        myConnection.Open() 
        myCommand.ExecuteNonQuery() 
        If Not (myConnection Is NothingThen 
            If (myConnection.State = ConnectionState.Open) Then 
                myConnection.Close() 
            End If 
            myConnection.Dispose() 
        End If 
        If Not (myCommand Is NothingThen 
            myCommand.Dispose() 
        End If 
 
        RadGrid1.Rebind() 
    End Sub 
 
End Class 

Brenden
Top achievements
Rank 1
 answered on 04 Jun 2009
1 answer
100 views
I created a custom RadGrid Control and when I click on PDF Export button the OnItemCreated is called before the OnItemCommand, but it only happens to 1 of my 10 web pages.  How can this be fixed?  Thanks for the help.
Veli
Telerik team
 answered on 04 Jun 2009
3 answers
61 views
Hi

When I add a CheckBox to the Controls of a RadPanelItem, the CheckedChanged event will be fired only every second time. What could be the problem? Thank you
wima
Paul
Telerik team
 answered on 04 Jun 2009
12 answers
266 views
How do I configure the MOSS radEditor (Premium version) to only show CSS styles from specific CSS files?

Thanks,
John W.
Archana
Top achievements
Rank 1
 answered on 04 Jun 2009
1 answer
133 views
We have a RadCalendar implemented on a web site which is exhibiting unexpected and undesirable behavior when combining the browser back button and the RadCalendar Forward 1 View button on the control. The problem occurs in both IE and Firefox.  We are using IE version 7.0.5730.13 and Firefox version 3.0.10.

To see the issue, go to our staging/test version at:



http://204.255.139.168/CIED_Conference_Tool/ There is a RadCalendar near the bottom of the page. Don't click on a calendar yet, but select an Event from the drop-down just above it. Select "Testing 50005". You will be sent to the default Event page. Now click the browser Back Button. Now, click the Forward 1 View button (the right arrow image just to the right of the Month/Year display in the RadCalendar header). Instead of switching the calendar to the next month it instead forwards you to the page you were just at. This is very strange since the Forward 1 View works fine if the Back Button is never used. The markup for the Calendar is: <telerik:RadCalendar ID="RadCalendar1" Skin="Inox" runat="server" AutoPostBack="True" OnSelectionChanged="SelectedDateChange" OnDefaultViewChanged="NavigationChanged" EnableMultiSelect="False" SelectedDate="" ShowRowHeaders="False" width="231px"> <CalendarDayTemplates> <telerik:DayTemplate ID="dayTemplate1"> <Content> <asp:Label id="lblDay1" runat="server" Text="Event Day!" /> </Content> </telerik:DayTemplate> <telerik:DayTemplate ID="dayTemplate2"> <Content> <asp:Label id="lblDay2" runat="server" Text="Event Day!" /> </Content> </telerik:DayTemplate> <telerik:DayTemplate ID="dayTemplate3"> <Content> <asp:Label id="lblDay3" runat="server" Text="Event Day!" /> </Content> </telerik:DayTemplate> <telerik:DayTemplate ID="dayTemplate4"> <Content> <asp:Label id="lblDay4" runat="server" Text="Event Day!" /> </Content> </telerik:DayTemplate> <telerik:DayTemplate ID="dayTemplate5"> <Content> <asp:Label id="lblDay5" runat="server" Text="Event Day!" /> </Content> </telerik:DayTemplate> </CalendarDayTemplates> <specialdays> <telerik:RadCalendarDay TemplateID="dayTemplate1" Date="2006-01-01" ToolTip=""> </telerik:RadCalendarDay> <telerik:RadCalendarDay TemplateID="dayTemplate2" Date="2006-02-01" ToolTip=""> </telerik:RadCalendarDay> <telerik:RadCalendarDay TemplateID="dayTemplate3" Date="2006-03-01" ToolTip=""> </telerik:RadCalendarDay> <telerik:RadCalendarDay TemplateID="dayTemplate4" Date="2006-04-01" ToolTip=""> </telerik:RadCalendarDay> <telerik:RadCalendarDay TemplateID="dayTemplate5" Date="2006-05-01" ToolTip=""> </telerik:RadCalendarDay> </specialdays> <HeaderStyle ForeColor="#00457c" BackColor="#00457c"></HeaderStyle> <SelectedDayStyle BorderColor="#573d08" BackColor="#573d08" /> <CalendarTableStyle BackColor="#ffffff" /> </telerik:RadCalendar> The only code-behind we have is for the server-side event "SelectedDateChange": protected void SelectedDateChange(object sender, SelectedDatesEventArgs e) { Label8.Visible = true; Label8.Text = "Event Info:" + "<br />"; for (int i = 0; i < e.SelectedDates.Count; i++) { _date = (e.SelectedDates[i]).Date; cgDataSet.tbl_eventDataTable dt = _eventContentAdapter.GetEventBeginDataByDate(_date); if (dt.Rows.Count != 0 ) { cgDataSet.tbl_eventRow row = dt[0]; String eventName = row.event_name; IRewriteTransform transform = new ConferenceGeneric.cgControls.cgUrlRewriting.SpaceToUnderscoreTransform(); //supply client name in URL for each of these anchors HtmlAnchor[] anchors = { aHome, aAgenda, aRegistration, aDirections, aSecurity }; foreach (HtmlAnchor anchor in anchors) { anchor.HRef = formatWithTransformedName(anchor.HRef, transform, eventName); } Label12.Visible = true; Label12.Text = row.event_begin_date.ToShortDateString() + "-" + row.event_end_date.ToShortDateString() + "<br />"; Label6.Visible = true; Label6.Text = "Event Name:" + "&nbsp;" + row.event_name + "<br />"; Label9.Visible = true; Label9.Text = "Event Location:" + "&nbsp;" + row.event_location + "<br />"; hl.Visible = true; hl.NavigateUrl = aHome.HRef.ToString(); Label7.Visible = false; } else { Label7.Visible = true; Label7.Text = "There are no events for the selected date."; Label6.Visible = false; Label9.Visible = false; Label8.Visible = false; Label12.Visible = false; hl.Visible = false; } } }
Veli
Telerik team
 answered on 04 Jun 2009
2 answers
120 views
Hi,

i'm looking for a radtabstrip, with a menu appearing when you click on a tab.
i dont like the second tab bar who appears under the first.

I prefer to have a menu on wich you selected the page you want.


Dont you have this component?
If no, how can i proceed to make it by code, with the existing ?
mouhcine
Top achievements
Rank 1
 answered on 04 Jun 2009
1 answer
121 views
Hi

I have not used rad ajax before and I am just trying to learn how it works. I am trying to emulate a common scenario whereby you have a user form outside an update panel and this has a submit button which, when clicked, updates the display which are  some sort of results inside an update panel. The submit button is an asych postback trigger for the updatepanel.

I wasn't sure how to achieve this set up using rad ajax. My first thought was the rad panel but this wasn't really suitable because the rad panel is triggered by controls inside the panel which meant I had to have had my submit button inside the panel and this didnt look good when i incorporate a loading panel as the loading image is displayed over the button as well as the results section.

The way I choose to implement it was to have a rad manager and then enclose all of the controls that comprise my results form within an asp.net panel. I then set the submit button to update the asp.net panel in the ajax manager. When the button is clicked, the results form inside the panel is updated and the loading image is only shown on top of the results section and not the submit button

This seems to work but is this the correct way? I guess I am confused because I thought i would use the rad panel but i didn't. Most of my web pages have this same organisation section set up so I want to get the rad ajax side of things right before I apply it to all my other pages.


thanks in advance
Tsvetoslav
Telerik team
 answered on 04 Jun 2009
3 answers
156 views
Hi,

I would like to use the editor like a textbox but use the spell checking facility.  Therefore I have a few questions:

1. Is it possible to remove the toolbar?  If so, how is this done?

2. Is it possible to simply highlight mispelt words as the user is typing instead of forcing them to click on a button to perform the spell check?

Thanks,
J
Rumen
Telerik team
 answered on 04 Jun 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
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
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?