Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
119 views
I have a website on working on that will have a page that will have links to different pdf files.  Instead of just listing them I wanted to see if telerik has any controls that will allow me to list them in a nice clean way.  Is there a control that I could use that would allow me to do this?

Thank you
Jerry
Top achievements
Rank 1
 answered on 12 Apr 2012
5 answers
189 views
My Code is below and the Delete Button is not working?


aspx

 <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <asp:PlaceHolder ID="phdrGrid" runat="server" ></asp:PlaceHolder>
        <asp:SqlDataSource ID="sqldsGrid" runat="server"
            ConnectionString="<%$ ConnectionStrings:EFDBConnectionString %>"
            SelectCommand="SELECT * FROM [sites]"
            UpdateCommand="UPDATE [sites] SET [SiteName]=@SiteName WHERE [SiteId]=@SiteId"
            DeleteCommand="DELETE FROM [sites] WHERE [SiteId]=@SiteId">
        <UpdateParameters>
            <asp:Parameter Name="@SiteId" />
        </UpdateParameters>
        <DeleteParameters>
            <asp:Parameter Name="@SiteId" />
        </DeleteParameters>
        </asp:SqlDataSource>   

aspx.vb

Imports System.Data
Imports System.Data.SqlClient
Imports Telerik.Web.UI


Partial Public Class _Default
    Inherits System.Web.UI.Page

    Private Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
        Dim RadGrid1 As New RadGrid()
        'RadGrid1.NeedDataSource += New GridNeedDataSourceEventHandler(RadGrid1_NeedDataSource)
        'RadGrid1.ItemCommand += New GridCommandEventHandler(RadGrid1_ItemCommand)
        'RadGrid1.ItemCreated += New GridItemEventHandler(RadGrid1_ItemCreated)
        'RadGrid1.ID = "rgDemo"
        RadGrid1.Width = Unit.Percentage(100)
        RadGrid1.PageSize = 3
        RadGrid1.AllowPaging = True
        RadGrid1.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric
        RadGrid1.AutoGenerateColumns = False
        RadGrid1.GroupingEnabled = True
        RadGrid1.ShowGroupPanel = True
        RadGrid1.ShowStatusBar = True
        RadGrid1.ClientSettings.AllowDragToGroup = True
        RadGrid1.DataSourceID = "sqldsGrid"
        RadGrid1.Skin = "Outlook"

        RadGrid1.MasterTableView.PageSize = 15
        RadGrid1.MasterTableView.DataKeyNames = New String() {"SiteId"}
        RadGrid1.MasterTableView.AllowAutomaticUpdates = True
        'RadGrid1.MasterTableView.EditFormSettings.EditFormType = GridEditFormType.Template
        RadGrid1.MasterTableView.EditMode = GridEditMode.InPlace
        'Dim gtc As New GridTemplateColumn()
        'gtc.ItemTemplate = New ItemTemplateLabels("Description")
        'gtc.HeaderText = "Description"
        'gtc.EditItemTemplate = New EditItemTemplateTextBoxes("Description")
        'RadGrid1.MasterTableView.Columns.Add(gtc)

        'Dim gt2 As New GridTemplateColumn()
        'gt2.ItemTemplate = New ItemTemplateLabels("Name")
        'gt2.HeaderText = "Name"
        'gt2.EditItemTemplate = New EditItemTemplateTextBoxes("Name")
        'RadGrid1.MasterTableView.Columns.Add(gt2)
        Dim boundColumn1 As New GridBoundColumn()
        boundColumn1.DataField = "SiteId"
        boundColumn1.UniqueName = "SiteId"
        boundColumn1.HeaderText = "SiteId"
        RadGrid1.MasterTableView.Columns.Add(boundColumn1)
        Dim boundColumn2 As New GridBoundColumn()
        boundColumn2.DataField = "SiteName"
        boundColumn2.UniqueName = "SiteName"
        boundColumn2.HeaderText = "SiteName"
        RadGrid1.MasterTableView.Columns.Add(boundColumn2)


        Dim gt3 As New GridTemplateColumn()
        gt3.ItemTemplate = New ItemTemplateLinks("Links")
        gt3.UniqueName = "EditCommandColumn"
        gt3.HeaderText = "Links"
        gt3.EditItemTemplate = New EditItemTemplateLinks("Links", "Update", "Update")
        gt3.EditItemTemplate = New EditItemTemplateLinks("Links", "Cancel", "Cancel")
        RadGrid1.MasterTableView.Columns.Add(gt3)

        Dim gBtnColumn As New GridButtonColumn()
        gBtnColumn.CommandName = "Delete"
        gBtnColumn.Text = "Delete"
        gBtnColumn.ButtonType = GridButtonColumnType.LinkButton
        RadGrid1.MasterTableView.Columns.Add(gBtnColumn)

        RadGrid1.MasterTableView.EditFormSettings.EditFormType = GridEditFormType.Template

        phdrGrid.Controls.Add(RadGrid1)
    End Sub

    Private Class ItemTemplateLinks
        Implements ITemplate
        Protected rBtn As RadButton
        Private colname As String = String.Empty
        Private colValue As String = String.Empty

        Public Sub New(ByVal cName As String)
            colname = cName
        End Sub

        Public Sub InstantiateIn(ByVal container As System.Web.UI.Control) Implements System.Web.UI.ITemplate.InstantiateIn
            rBtn = New RadButton()
            rBtn.Text = "Edit"
            rBtn.ButtonType = RadButtonType.StandardButton
            'rBtn.Command += New CommandEventHandler(rBtn_Command)
            rBtn.CommandName = "Edit"
            Dim rnd As New Random()
            rBtn.ID = "test"
            container.Controls.Add(rBtn)
        End Sub

        Private Sub rBtn_Command(ByVal sender As Object, ByVal e As CommandEventArgs)
            Dim a As String = TryCast(sender, RadButton).CommandName
        End Sub

    End Class


    Private Class EditItemTemplateLinks
        Implements IBindableTemplate

        Private lstItemType As ListItemType
        Protected rBtn As RadButton
        Protected rBtn1 As RadButton
        Private colname As String = String.Empty
        Private btnText As String = String.Empty
        Private cmdName As String = String.Empty
        Private colValue As String = String.Empty

        Public Sub New(ByVal cName As String, ByVal bText As String, ByVal bCmdName As String)
            btnText = bText
            bCmdName = cmdName
            colname = cName
        End Sub

        Private Sub rBtn_Command(ByVal sender As Object, ByVal e As CommandEventArgs)
            Dim a As String = TryCast(sender, RadButton).CommandName
        End Sub


        Public Function ExtractValues(ByVal container As System.Web.UI.Control) As System.Collections.Specialized.IOrderedDictionary Implements System.Web.UI.IBindableTemplate.ExtractValues

            Dim od As New OrderedDictionary()
            Return od

        End Function

        Public Sub InstantiateIn(ByVal container As System.Web.UI.Control) Implements System.Web.UI.ITemplate.InstantiateIn

            rBtn = New RadButton()
            rBtn.Text = "Update"
            rBtn.ButtonType = RadButtonType.StandardButton
            rBtn.CommandName = "Update"
            'rBtn.Command += New CommandEventHandler(rBtn_Command)
            Dim rnd As New Random()
            rBtn.ID = "ssss"

            container.Controls.Add(rBtn)

            rBtn1 = New RadButton()
            rBtn1.Text = "Cancel"
            rBtn1.ButtonType = RadButtonType.StandardButton
            rBtn1.CommandName = "Cancel"
            Dim rnd1 As New Random()
            container.Controls.Add(rBtn1)

        End Sub
    End Class


    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

End Class



When i click the Delete Button I am getting the Following error


Server Error in '/' Application.

Unable to cast object of type 'ItemTemplateLinks' to type 'System.Web.UI.IBindableTemplate'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidCastException: Unable to cast object of type 'ItemTemplateLinks' to type 'System.Web.UI.IBindableTemplate'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[InvalidCastException: Unable to cast object of type 'ItemTemplateLinks' to type 'System.Web.UI.IBindableTemplate'.]
Telerik.Web.UI.GridTemplateColumn.FillValues(IDictionary newValues, GridEditableItem editableItem) +388
Telerik.Web.UI.GridEditableItem.ExtractValues(IDictionary newValues) +164
Telerik.Web.UI.GridTableView.ExtractValuesFromItem(IDictionary newValues, GridEditableItem editedItem) +116
Telerik.Web.UI.GridTableView.PerformDelete(GridEditableItem editedItem, Boolean suppressRebind) +175
Telerik.Web.UI.GridCommandEventArgs.ExecuteCommand(Object source) +4861
Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e) +191
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +137
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +118
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +135
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565


Version Information: Microsoft .NET Framework Version:2.0.50727.3623; ASP.NET Version:2.0.50727.3618

Dan
Top achievements
Rank 1
 answered on 12 Apr 2012
5 answers
117 views
most of time the default editform works fine. There are cases that I just need to have a little bit tweak, for example, the textbox needs to be a little bit wider etc. If switch to use template for editform, I have to start from scratch, creating all those boring stuff, my question: is there somewhere we can get the aspx code the default editform? so it will be just a few minutes to add simple/quick customization.

Thanks.
Daniel
Telerik team
 answered on 12 Apr 2012
1 answer
105 views
Hi, I am trying to make my splitter fit into the div that i specify.
Following code works perfect when placed inside aspx, but the UI changes (radSplitter now takes default width and height of 400px) when the same code is places inside the ascx.

I am not sure, why ? Ideally, the RadSplitter should use the absolute dimensions of the container to set its width and height.
Why should i bother to set the dimensions for all parent containers ?? The moment i specify absolute values for the container, the child controls should use those values.

Please correct me if my understanding is wrong.

<
div style="width: 700px; height: 500px; border: 2px solid orange;">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
    <telerik:RadSplitter ID="SplitterHorizontal" runat="server" height="100%" width="100%" Scrolling="None">
        <telerik:RadPane ID="LeftPane" runat="server" width="30%">           
            <telerik:RadSplitter ID="VerticalSplitter" Orientation="Horizontal" runat="server">
                <telerik:RadPane ID="LeftTopPane" runat="server" style="height:50%">
                </telerik:RadPane>
                <telerik:RadSplitBar ID="HorizontalSplitBar" runat="server" CollapseMode="Forward" />
                <telerik:RadPane ID="LeftBottomPane" runat="server" height="50%" >                   
                </telerik:RadPane>
            </telerik:RadSplitter>       
        </telerik:RadPane>
        <telerik:RadSplitBar ID="VerticalSplitBar" runat="server" CollapseMode="Forward" />
        <telerik:RadPane ID="RightPane" runat="server" width="70%">
        </telerik:RadPane>
    </telerik:RadSplitter>
</div>
Dobromir
Telerik team
 answered on 12 Apr 2012
2 answers
77 views
hi all
i have problem with requestItems() method in Radcombobox .it causes postback page and captcha generates new code but not shows it  to user .i searched forum and you suggest use RadXmlHttpPanel but how can i change this code :

<script type="text/javascript">
//global variables for the countries and cities comboboxes
var countriesCombo;
var citiesCombo;
 
function pageLoad()
{
    // initialize the global variables
    // in this event all client objects
    // are already created and initialized
    countriesCombo = $find("<%= RadComboBox2.ClientID %>");   
    citiesCombo = $find("<%= RadComboBox3.ClientID %>");
}
 
function LoadCountries(sender, eventArgs)
{   
    var item = eventArgs.get_item();
    countriesCombo.set_text("Loading...");
    citiesCombo.clearSelection();
     
    // if a continent is selected
    if (item.get_index() > 0)
    {       
        // this will fire the ItemsRequested event of the
        // countries combobox passing the continentID as a parameter
        countriesCombo.requestItems(item.get_value(), false);                               
    }
    else
    {
        // the -Select a continent- item was chosen
        countriesCombo.set_text(" ");
        countriesCombo.clearItems();
         
        citiesCombo.set_text(" ");
        citiesCombo.clearItems();
    }
}
 
function LoadCities(sender, eventArgs)
{   
    var item = eventArgs.get_item();
     
    citiesCombo.set_text("Loading...");
    // this will fire the ItemsRequested event of the
    // cities combobox passing the countryID as a parameter
    citiesCombo.requestItems(item.get_value(), false);                   
}
 
function ItemsLoaded(sender, eventArgs)
{   
    if (sender.get_items().get_count() > 0) {
        // pre-select the first item
        sender.set_text(sender.get_items().getItem(0).get_text());
        sender.get_items().getItem(0).highlight();
    }
 
    sender.showDropDown();
}
        </script>

i don't want captcha changes code when items load on comboboxes?

thanks
Slav
Telerik team
 answered on 12 Apr 2012
1 answer
151 views
Previously, I had been inserting HTML into the tree nodes such as
var node = new RadTreeNode();
node.Text = "<b>This is bold text</b>";
When I upgraded to 2012 Q1, it seems that it is now HTML encoding the Text. How can I insert on the server side raw HTML without the control encoding it (similar to how it used to work)?

Thanks!
Princy
Top achievements
Rank 2
 answered on 12 Apr 2012
2 answers
402 views
how can i load data read from database to a textbox template field in gridview. Please help me to solve this as soon as possible.
Thanks..................
ithihas
Top achievements
Rank 1
 answered on 12 Apr 2012
6 answers
306 views
Hi!

Sorry about my english -.-'

I have a little issue with one radgrid into formview, i'm trying to retrieve all columns values and i can't, i tried javascript, and visual basic functions in code behind, and always have the same problem, can't find the radgrid , because it is into the formview (i think).

Can anyone suggest something? i've been stuck for too long with this =(

Thanks.
Joan
Top achievements
Rank 1
 answered on 12 Apr 2012
3 answers
123 views
Dear Support Team!

Near the Installation of the RadControls Version 2012.1.215, when setup is
installing the Visual Studio 2008 extensions, it is telling me, that it was unable
to do so and I have to repair my Visual Studio 2008 installation first.
I have done this and restarted the installation with no other outcome.

Also uninstalling all previous versions of the Telerik RadControls didn't work out.
Additionally I searched the Registry for remaining entries of old installations of
RadControls and removed them (after a backup of course).
The outcome of the installation hasn't changed a bit.
It just keeps telling me, that the VS2008 extensions cannot be installed.

The next post contains the log file for the installation.
Any idea how to fix this?
Thanks in advance!


Best regards,

Tobias
Christian
Top achievements
Rank 1
 answered on 12 Apr 2012
1 answer
155 views
We're migrating from MOSS to SharePoint 2010 and I wanted to check if the control Telerik.Web.UI, Version=2010.1.309.20 is compatible with SharePoint 2010. Could anyone please let me know?
Rumen
Telerik team
 answered on 12 Apr 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?