Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
145 views
I have a rad panel that I have put a rad tree view in. However, now that the rad tree is within the panel, I cannot get it to collapse. It is always expanded and won't collapse even if you click the button. The two other panels have static data in them and they collapse fine. Can anyone help me with this issue? Here is my code

<%@ Master Language="VB" AutoEventWireup="false" Debug="True" %>

<%@ 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">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ import namespace="System.Data" %>
<%@ import namespace="System.Data.Sql" %>
<%@ import namespace="System.Data.SqlClient" %>
<%@ import namespace="Telerik.Web.UI" %>

<script runat="server">
    
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        
        If Not Page.IsPostBack Then
            
            Dim tree As RadTreeView = DirectCast(RadPanelBar1.Items(0).FindControl("RadTreeView1"), RadTreeView)
            'here is where the error is. it is saying that
            'createtable is null
            tree.DataSource = CreateTable()
            tree.DataFieldID = "ID"
            tree.DataFieldParentID = "ParentID"
            tree.DataTextField = "Text"
            tree.DataBind()
                        
        End If
    End Sub 'page_load
    
    'this function creates a datatable for the rad
    'tree that is in the events panel
    Private Function CreateTable() As DataTable
        'set up my connection to the database
        Dim conn As New SqlConnection
        conn.ConnectionString = ConfigurationManager.ConnectionStrings("connectionString").ConnectionString

        Dim table As DataTable = New DataTable()
        table.Columns.Add("ID")
        table.Columns.Add("ParentID")
        table.Columns.Add("Text")

        'this is a counter for the id fields
        'of the data table
        Dim count As Integer = 1
        
        'this adds the parent categories to the
        'datatable
        Dim categoryQuery As New SqlCommand
        conn.Open()
        categoryQuery.Connection = conn
        categoryQuery.CommandText = "select CategoryId, Name from categories"
        Dim cdr As SqlDataReader = categoryQuery.ExecuteReader()
        While cdr.Read()
            
            If (cdr.Item(0).ToString <> "") Then
                
                table.Rows.Add(New String() {count.ToString, Nothing, cdr.Item(1).ToString})
                'we have to increment count to keep an id for the data table
                count = count + 1
                
            End If
            
        End While 'while cdr.Read()
        conn.Close()
        conn.Open()
        'this adds the events with their parent category
        'id to the datatable
        Dim eventQuery As New SqlCommand
        eventQuery.Connection = conn
        eventQuery.CommandText = "SELECT eventid, FK_CategoryID, name from events"
        Dim edr As SqlDataReader = eventQuery.ExecuteReader()
        While edr.Read()
            
            If (edr.Item(0).ToString <> "") Then
                
                table.Rows.Add(New String() {count.ToString(), edr.Item(1).ToString, edr.Item(2).ToString})
                'we have to increment count to keep an id for the data table
                count = count + 1
                
            End If
            
        End While 'while edr.Read()
               
        Return table

    End Function 'CreateGenreTable

</script>

<head runat="server">
    <title></title>
    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadPanelBar ID="RadPanelBar1" runat="server" Skin="Web20" ExpandMode="SingleExpandedItem">
        <CollapseAnimation Type="None" Duration="100"></CollapseAnimation>
        <Items>
            <telerik:RadPanelItem runat="server" Text="Events">
                <ItemTemplate>
                    <telerik:RadTreeView ID="RadTreeView1" runat="server" Skin="Web20">
                        <CollapseAnimation Type="OutQuint" Duration="100"></CollapseAnimation>
                        <ExpandAnimation Duration="100"></ExpandAnimation>
                    </telerik:RadTreeView>
                </ItemTemplate>
            </telerik:RadPanelItem>
            <telerik:RadPanelItem runat="server" Text="Calendar">
                <Items>
                    <telerik:RadPanelItem runat="server" Text="Child RadPanelItem 1">
                    </telerik:RadPanelItem>
                    <telerik:RadPanelItem runat="server" Text="Child RadPanelItem 2">
                    </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelItem>
            <telerik:RadPanelItem runat="server" Text="Root RadPanelItem3">
                <Items>
                    <telerik:RadPanelItem runat="server" Text="Child RadPanelItem 1">
                    </telerik:RadPanelItem>
                    <telerik:RadPanelItem runat="server" Text="Child RadPanelItem 2">
                    </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelItem>
        </Items>
        <ExpandAnimation Type="None" Duration="100"></ExpandAnimation>
    </telerik:RadPanelBar>
    <div>
        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
        </asp:ContentPlaceHolder>
    </div>
    </form>
</body>
</html>

In case you want to see what I'm trying to do. You can go here
http://alpha.clickablecommunity.com/

Veselin Vasilev
Telerik team
 answered on 05 Aug 2009
1 answer
116 views
Is there a way to skin the RadMultiPage so that it appears to blend with the selected tab?  I am using the Office2007 skin and would like the background underneath all my  rad page views to have the same blue shade that is the very bottom row of pixels on the selected tab.
In the future, I would like to allow users to select their own skin, so if there was a non-hardcoded way to do this, I would really prefer it.
Kamen Bundev
Telerik team
 answered on 05 Aug 2009
3 answers
130 views
Hello,
I am adding a row to a child grid in the OnInsertCommand event. This is working as expected. But I would like to move to the last page in the grid and select the row that was just inserted. I am doing the following, but I always remain on the first page of the child grid.
protected void RadGrid1_InsertCommand(object source, GridCommandEventArgs e) 
    string serverID = null
    string insertType = "master"
     
    GridEditFormItem gridEditFormItem = (GridEditFormItem)e.Item; 
 
    Hashtable ht = new Hashtable(); 
    gridEditFormItem.ExtractValues(ht); 
 
 
    if ("Systems".Equals(e.Item.OwnerTableView.Name)) 
    { 
        GridDataItem parentItem = (GridDataItem)e.Item.OwnerTableView.ParentItem; 
 
        serverID = parentItem.OwnerTableView.DataKeyValues[parentItem.ItemIndex]["ServerID"].ToString(); 
        insertType = "detail"
    } 
     
    presenter.InsertRecord(serverID, ht, insertType); 
     
    XmlDataSource1.Save(); 
     
    //rebind to get the real number of pages (incase adding an item increased the page count 
    RadGrid1.Rebind(); 
    if ("Systems" != e.Item.OwnerTableView.Name) 
    { 
        //set to last page 
        RadGrid1.CurrentPageIndex = RadGrid1.PageCount - 1; 
 
        //after changing page, need to rebind 
        RadGrid1.Rebind(); 
    } 
    else 
    { 
        GridTableView table = e.Item.OwnerTableView; 
         
        //set to last page 
        table.CurrentPageIndex = table.PageCount - 1; 
 
        //after changing page, need to rebind 
        table.Rebind(); 
         
    } 

In this example, "Systems" is the name of the Detail grid view.
also, is there away to do this without doing so many rebind calls?
Thanks
-marcos


Sebastian
Telerik team
 answered on 05 Aug 2009
1 answer
172 views
<telerik:radupload id="RadUpload1" runat= "server"
    allowedfileextensions=".doc,.rtf,.txt" />
<asp:customvalidator 
runat="server" id="CustomValidator1" 
    display="Dynamic"
    clientvalidationfunction="ValidateRadUpload1"
   >
        Invalid extensions.
</asp:customvalidator>

<asp:button runat="server" id="Button1" text="Submit" />
<script type="text/javascript">
function ValidateRadUpload1(source, arguments)
{
    arguments.IsValid = GetRadUpload('<%= RadUpload1.ClientID %>').ValidateExtensions();
}
</script>


i have 4 tabstrips and in the 3rd tab i m using radupload.

when i use the above code then error occured "the object doesnt support this property or method"

please help me
Princy
Top achievements
Rank 2
 answered on 05 Aug 2009
3 answers
140 views
Hi,

I was using RADGrid Q3 2007 release, in that the following highlighted properties were available:

<radG:RadGrid ID="rgMemberResult" BackColor="white" runat="server" AllowPaging="true" AutoGenerateColumns="false"
EnableAJAX="true" EnableAJAXLoadingTemplate="true" LoadingTemplateTransparency="20"
        EnableOutsideScripts="true" 
<ClientSettings ApplyStylesOnClient="true">
</radG:RadGrid>

When i upgraded the control to Q2 2009 release, the above specified properties were not supported. Seems to be that they are obsolete. Please let me know, whether any alternate properties available or by default it does support those properties?

Thanks
Viswa
Dimo
Telerik team
 answered on 05 Aug 2009
1 answer
163 views
Hi,
I am created a application using Telerik:RadGrid.It performs insert, update, delete operations successfully. I have taken a checkbox and a Button in header of one column and all the rows of that column contain checkboxex. Whenever I select the checkboxed and click on the delete button it deletes the selected records from the grid. When i Select the Header checkbox , it will select all the records of the grid with in that page and by click on the delete button it deletes all the records from that page. 

    I want to delete all the records across the grid when ever i select the header checkbox and click the Delete button instead delete records page wise. Can anybody help me to solve this problem.
Here is my code used to delete records page wise.

 

<telerik:GridTemplateColumn UniqueName="TemplateColumn" ItemStyle-HorizontalAlign = "Center">

 

 

<HeaderStyle Font-Bold = "true" Font-Names = "Verdana" Width = "15%" CssClass = "GridButton"/>

 

 

<HeaderTemplate>

 

 

<asp:CheckBox id="headerChkbox" AutoPostBack="True" runat="server"

 

 

oncheckedchanged="headerChkbox_CheckedChanged"></asp:CheckBox>

 

 

<asp:Button ID = "btnDelete" runat = "server" Text = "Delete" BackColor = "#336699" CssClass = "GridButton" ForeColor = "White" onclick="btnDelete_Click"/>

 

 

</HeaderTemplate>

 



.cs:.

 

protected void headerChkbox_CheckedChanged(object sender, EventArgs e)

 

{

 

if ((sender as CheckBox).Checked)

 

{

 

foreach (GridDataItem dataItem in radSurgicalHistory.MasterTableView.Items)

 

{

(dataItem.FindControl(

"chkRowSelection") as CheckBox).Checked = true;

 

dataItem.Selected =

true;

 

}

}

 

else

 

{

 

foreach (GridDataItem dataItem in radSurgicalHistory.MasterTableView.Items)

 

{

(dataItem.FindControl(

"chkRowSelection") as CheckBox).Checked = false;

 

dataItem.Selected =

false;

 

}

}

}

 

 

protected void chkRowSelection_CheckedChanged(object sender, EventArgs e)

 

{

((sender

as CheckBox).Parent.Parent as GridItem).Selected = (sender as CheckBox).Checked;

 

}

 

 

 

try

 

 

 

 

{

 

if (radSurgicalHistory.MasterTableView.DataKeyNames.Length > 0)

 

{

 

string pkId = "";

 

 

string key = radSurgicalHistory.MasterTableView.DataKeyNames[0];

 

 

for (int i = 0; i < radSurgicalHistory.SelectedItems.Count; i++)

 

{

pkId = radSurgicalHistory.MasterTableView.DataKeyValues[radSurgicalHistory.SelectedItems[i].ItemIndex][key].ToString();

 

string delete = "Update M_SURGICAL_HISTORY SET ROW_STATUS = 0 where Pk_Surgical_History = " + pkId + "";

 

 

SqlHelper.ExecuteNonQuery(Utilities.GetConnectionString, CommandType.Text, delete);

 

}

radSurgicalHistory.Rebind();

}

}

 

catch (Exception ex)

 

{

radSurgicalHistory.Controls.Add(

new LiteralControl("Unable to delete Customers. Reason: " + ex.Message));

 

}

Yavor
Telerik team
 answered on 05 Aug 2009
2 answers
93 views
I would like to have the statusbar, but it should be empty. I set VisibleStatusbar="true". On the client side I call oWnd.set_status(''); . As a result of that, I have the statusbar visible and during loading it has no information. But unfortunately, when the it's loaded, the statusbar has the url. Is there any way not to have the url information in the statusbar, but have it visible?

Thank you,

Tatiana
DW Web Team Member
Top achievements
Rank 2
 answered on 05 Aug 2009
3 answers
308 views
Hi,

I want to restrict user to select/browse only restricted files, like in html file upload control we have a property called 'Accept' which will take the parameters as file types with cama seperated.

ex: <input type="file" accept="image/jpg,image/png" name="file1" />

I want to know whether this property is availabe in Rad Upload control?

Thanks.
Atanas Korchev
Telerik team
 answered on 05 Aug 2009
3 answers
224 views

Hello,

I am trying to setup my Radgrid to select multiple rows.  After following the demo (http://demos.telerik.com/aspnet-ajax/grid/examples/client/selecting/defaultcs.aspx), everything works great with one exception.  I can not select or deselect rows using the Ctrl Key.  The Shift Key works as expected.

Here is my code:

 

<telerik:RadGrid ID="radgrdEvaluator" Skin="Vista" AutoGenerateColumns="False" AllowPaging="True" AllowSorting="True" AllowMultiRowSelection="True" ShowStatusBar="False" PageSize="10" GridLines="None" width="96%" HorizontalAlign="NotSet" Visible="False" runat="server">  
    <MasterTableView DataKeyNames="EvaluatorID">  
        <Columns> 
        <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn"></telerik:GridClientSelectColumn> 
        <telerik:GridButtonColumn ButtonType="LinkButton" DataTextField="EvaluatorID" HeaderText="EvaluatorID" CommandName="Select"></telerik:GridButtonColumn> 
        <telerik:GridBoundColumn DataField="EvaluatorStatus" HeaderText="EvaluatorStatus" DataType="System.Boolean"></telerik:GridBoundColumn> 
        </Columns> 
    </MasterTableView> 
    <ClientSettings EnableRowHoverStyle="True">  
        <Selecting AllowRowSelect="True" /> 
    </ClientSettings> 
    <pagerstyle mode="NextPrevAndNumeric" AlwaysVisible="True" /> 
</telerik:RadGrid> 
Mira
Telerik team
 answered on 05 Aug 2009
2 answers
131 views
I'm doing customization of FileExplorer but I've got strange strings like "Common_Open," "Common_Select" in the tooltips and buttons. Since I didn't put any string like above, it's so weird where they come from. Simply, I want to make the string as just "Open" and "Select" etc.

Any idea?
Tom
Top achievements
Rank 1
 answered on 05 Aug 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
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
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?