Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
124 views
Hi,

I am trying to bind my RadTreeView control but for some reason the (+) sign is not coming with parent node to expand it and bind child nodes on server side.

 Any help would be really appreciated.

Thanks

 
<telerik:RadTreeView runat="Server" ID="rtvUserProducts" Height="300" Width="300"
                                    Skin="Vista">
                                    <Nodes>
                                        <telerik:RadTreeNode Expanded="true" Text="Parent" ExpandMode="ServerSide" runat="server">
                                            <NodeTemplate>
                                                <asp:Label ID="lblProductName" Text='<%# Bind("ProductCodeAndDesc") %>' runat="server">
                                                </asp:Label>
                                                <asp:HiddenField ID="hidLogisticProductKey" Value='<%# Bind("LogisticProductKey") %>'
                                                    runat="server" />
                                            </NodeTemplate>
                                            <Nodes>
                                                <telerik:RadTreeNode Expanded="true" Text="Child" ExpandMode="ServerSide">
                                                    <NodeTemplate>
                                                        <asp:Label ID="lblUserName" Text='<%# Bind("UserName") %>' runat="server"></asp:Label>
                                                    </NodeTemplate>
                                                </telerik:RadTreeNode>
                                            </Nodes>
                                        </telerik:RadTreeNode>
                                    </Nodes>
                                </telerik:RadTreeView>


 Protected Sub LoadProductsInTreeView()


        Dim oDataTable As New DataTable
        Dim oConn As New SqlConnection(SprintDB.GetStockSystemConnectionString)
        Dim sSQL As String
        Dim sb As New StringBuilder
        sb.Append("select distinct lp.LogisticProductKey, ProductDescription + ' (' + ProductCode + ')' 'ProductCodeAndDesc' from stockAlertRecipients sar inner join LogisticProduct lp on lp.LogisticProductKey = sar.Filter")
        sSQL = sb.ToString
        Dim oAdapter As New SqlDataAdapter(sSQL, oConn)
        Try
            oAdapter.Fill(oDataTable)
            rtvUserProducts.DataTextField = "ProductCodeAndDesc"
            rtvUserProducts.DataValueField = "LogisticProductKey"
            rtvUserProducts.DataFieldParentID = "LogisticProductKey"
            rtvUserProducts.DataSource = oDataTable
            rtvUserProducts.DataBind()
            rtvUserProducts.ExpandAllNodes()
        Catch ex As Exception
            WebMsgBox.Show(ex.Message.ToString)
        End Try


    End Sub
Kevin
Top achievements
Rank 2
 answered on 05 Sep 2012
2 answers
149 views
Hi,
 I filtered by datetime column like this http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/filtering/defaultcs.aspx 
But i want to change "From" and "To"  texts. how can i do this? 
Duygu
Top achievements
Rank 1
 answered on 05 Sep 2012
3 answers
125 views
Hi,
I am wishing to change the colour of a row if it is 'urgent' in my internal message system.
I found this code...

Protected Sub RadGrid1_ItemDataBound(ByVal sender As System.Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound
    'Change the color of inactive rows
    If TypeOf e.Item Is GridDataItem Then
        Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
        Dim Urgent As CheckBox = DirectCast(item.FindControl("Urgent"), CheckBox)
        If Urgent.Checked = True Then
            e.Item.BackColor = Drawing.Color.RoyalBlue
        End If
    End If
End Sub


and changed it to suit my grid, or so I believed; however it does not work properly, and throws an exception ("Object reference not set to an instance of an object.") when checking whether

"If Urgent.Checked = true then"

What am I doing wrong, the code for my radgrid is...

<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateSelectColumn="True" CellSpacing="0"
            GridLines="Horizontal" AutoGenerateColumns="False" OnSelectedIndexChanged="RadGrid1_SelectedIndexChanged"
            OnNeedDataSource="RadGrid1_NeedDataSource" AllowAutomaticUpdates="True" AllowPaging="True"
            AllowSorting="True" ToolTip="Click on a message to view it" >
            <SortingSettings EnableSkinSortStyles="false" />
            <ClientSettings EnablePostBackOnRowClick="true" EnableRowHoverStyle="True">
                <Selecting AllowRowSelect="true" />
            </ClientSettings>
            <MasterTableView DataKeyNames="UniqueID" PageSize="20" Width="100%">
                <Columns>
                    <telerik:GridBoundColumn DataField="UniqueID" HeaderText="UniqueID" UniqueName="UniqueID"
                        FooterStyle-Width="1px" HeaderStyle-Width="1px" ItemStyle-Width="1px" Visible="false"
                        DataType="System.Int32" ReadOnly="True" SortExpression="UniqueID">
                        <FooterStyle Width="1px"></FooterStyle>
                        <HeaderStyle Width="1px"></HeaderStyle>
                        <ItemStyle Width="1px"></ItemStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Customer" HeaderText="Customer" UniqueName="Customer"
                        FooterStyle-Width="14%" HeaderStyle-Width="14%" ItemStyle-Width="14%" FilterControlAltText="Filter Customer column"
                        SortExpression="Customer">
                        <FooterStyle Width="14%"></FooterStyle>
                        <HeaderStyle Width="14%"></HeaderStyle>
                        <ItemStyle Width="14%"></ItemStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Subject" HeaderText="Subject" UniqueName="Subject"
                        FooterStyle-Width="46%" HeaderStyle-Width="46%" ItemStyle-Width="46%" SortExpression="Subject">
                        <FooterStyle Width="46%"></FooterStyle>
                        <HeaderStyle Width="46%"></HeaderStyle>
                        <ItemStyle Width="46%"></ItemStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Name" HeaderText="Taken By" UniqueName="Name"
                        FooterStyle-Width="8%" HeaderStyle-Width="8%" ItemStyle-Width="8%" DataType="System.Int32"
                        FilterControlAltText="Filter TakenByID column" SortExpression="TakenByID">
                        <FooterStyle Width="8%"></FooterStyle>
                        <HeaderStyle Width="8%"></HeaderStyle>
                        <ItemStyle Width="8%"></ItemStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="TakenOn" HeaderText="TakenOn" UniqueName="TakenOn"
                        FooterStyle-Width="11%" HeaderStyle-Width="11%" ItemStyle-Width="11%" DataType="System.DateTime"
                        FilterControlAltText="Filter TakenOn column" SortExpression="TakenOn">
                        <FooterStyle Width="11%"></FooterStyle>
                        <HeaderStyle Width="11%"></HeaderStyle>
                        <ItemStyle Width="11%"></ItemStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridCheckBoxColumn DataField="Urgent" DataType="System.Boolean" FilterControlAltText="Filter Urgent column"
                        HeaderText="Urgent" SortExpression="Urgent" UniqueName="Urgent" FooterStyle-Width="7%"
                        HeaderStyle-Width="7%" ItemStyle-Width="7%">
                        <FooterStyle Width="7%"></FooterStyle>
                        <HeaderStyle Width="7%"></HeaderStyle>
                        <ItemStyle Width="7%"></ItemStyle>
                    </telerik:GridCheckBoxColumn>
                    <telerik:GridBoundColumn DataField="StatusNew" HeaderText="Status ID" UniqueName="StatusNew"
                        FooterStyle-Width="11%" HeaderStyle-Width="11%" ItemStyle-Width="11%" SortExpression="StatusID">
                        <FooterStyle Width="11%"></FooterStyle>
                        <HeaderStyle Width="11%"></HeaderStyle>
                        <ItemStyle Width="11%"></ItemStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="DeleteColumn"
                        HeaderText="Delete" ButtonType="ImageButton" ImageUrl="~/RadControls/Grid/Skins/Default/Delete.gif"
                        FooterStyle-Width="4%" HeaderStyle-Width="4%" ItemStyle-Width="4%" >
                        <FooterStyle Width="4%"></FooterStyle>
                        <HeaderStyle Width="4%"></HeaderStyle>
                        <ItemStyle Width="4%"></ItemStyle>
                    </telerik:GridButtonColumn>
                </Columns>
                <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                    <HeaderStyle Width="5px"></HeaderStyle>
                </RowIndicatorColumn>
                <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                    <HeaderStyle Width="5px"></HeaderStyle>
                </ExpandCollapseColumn>
                <EditFormSettings>
                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                    </EditColumn>
                </EditFormSettings>
            </MasterTableView>
            <FilterMenu EnableImageSprites="False">
            </FilterMenu>
        </telerik:RadGrid>


and it comes from a sql database

Thanks in advance
Ryan
Princy
Top achievements
Rank 2
 answered on 05 Sep 2012
3 answers
56 views
Hi,
I have tested SAK in a SharePoint 2010 environment.
Apart from the point that in a list-item edit page when using the RadEditor and inserting Images the image-editor seems to behave a bit strange (i.e. I click resize and nothing happens) and that the image-editor does not fit intor the list-item edit page popup the RadEditor is really nice.
When will SAK be RTM? I'd hate to suggest deploying CTP ;-)

Best,
Nils
Rumen
Telerik team
 answered on 05 Sep 2012
1 answer
48 views
Hello friends. I have a radMenu on my MasterPage. when i hover the mouse on it at runtime it suddenly dissapears. and also some of its items have right alignment for text and some of them have left. 
What can i do for this problem?
Kate
Telerik team
 answered on 05 Sep 2012
3 answers
93 views
Need Urgent Help.  I am much tense.

As seen in attached image, all of sudden controls have stopped rendering properly on screen.
Aligment is off track.

Menus now shows extra row, menu items itself is not aligned properly.
numeric controls shows '0' outside of textbox.

To confirm i created another test project and inserted few controls.  there too, the issues are same.
eg. see how Radbutton is displayed in second image.

Please Advice. What's going wrong.

Regards
Ivan Zhekov
Telerik team
 answered on 05 Sep 2012
2 answers
74 views
Good Afternoon all,

I am hoping to get some help with a simple grid setup that I am working on. I am researching how the Rad Grid control works in order to use it in our production environment. I have little knowledge of the control or its interworkings. I've read through the online documentation and have tried to recreate the example demo with focus toward how I would use it in production. I have a basic Dataset whichi I populate manually for my example. On the aspx page i'm using a basic RadGrid and set the OnNeedDatatSource, I set the MasterTableView EditMode to InPlace and have the columns auto generated. The issue i am seeing is when i click the edit button the RadGrid1_ItemCreated Event is fired but none of theobjects coming in are of type GridDataInsertItem and the IsInEditMode property is always false resulting in a grid that only display "No Records to Display". I'm not sure what i'm missing. Any help would be appreciated. My code is below:

ASPX
<%@ Page Title="Home Page" Language="vb" MasterPageFile="~/Site.Master" AutoEventWireup="false"
    CodeBehind="Default.aspx.vb" Inherits="TelerikGridControlProject._Default" %>
  
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
  
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
   
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" 
                Name="Telerik.Web.UI.Common.Core.js">
            </asp:ScriptReference>
            <asp:ScriptReference Assembly="Telerik.Web.UI" 
                Name="Telerik.Web.UI.Common.jQuery.js">
            </asp:ScriptReference>
            <asp:ScriptReference Assembly="Telerik.Web.UI" 
                Name="Telerik.Web.UI.Common.jQueryInclude.js">
            </asp:ScriptReference>
        </Scripts>
    </telerik:RadScriptManager>
    <telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="0" GridLines="None" OnNeedDataSource="RadGrid1_NeedDataSource" Visible="true">
    <MasterTableView EditMode="InPlace" AutoGenerateColumns="True" Visible="true">
        <Columns>
           <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" />
        </Columns>
    </MasterTableView>
    </telerik:RadGrid>
   
</asp:Content>


Code Behind:
Imports Telerik.Web.UI
  
Public Class _Default
    Inherits System.Web.UI.Page
    Private _myDataTable As New DataTable
    Private _nameColumn As DataColumn
    Private _myObjectDataSource As ObjectDataSource
  
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            BuildDataTable()
            FillDataTable()
        End If
    End Sub
    
  
    Private Sub FillDataTable()
        Dim dataRow As DataRow
        For i As Integer = 0 To 1
            dataRow = MyDataTable.NewRow()
            dataRow("CIFNUMBER") = 1
            dataRow("CustomerName") = String.Format("Customer {0}", i)
            dataRow("BusinessType") = String.Format("Business {0}", i)
            dataRow("Role") = "Role"
            dataRow("RelationshipToPrimary") = "Spouse"
            dataRow("VotingRights") = i
            dataRow("Scored") = i * 100
            MyDataTable.Rows.Add(dataRow)
        Next
    End Sub
  
    Private Sub BuildDataTable()
        Dim nameList As List(Of String) = New List(Of String)(New String() {"CIFNUMBER", "CustomerName", "BusinessType", "Role", "RelationshipToPrimary", "VotingRights", "Scored"})
  
        For i As Integer = 0 To nameList.Count - 1
            MyDataTable.Columns.Add(i)
            MyDataTable.Columns.Add(nameList(i))
        Next
  
    End Sub
  
    Public Property MyDataTable As DataTable
        Get
            Return _myDataTable
        End Get
        Set(value As DataTable)
            _myDataTable = value
        End Set
    End Property
  
    Protected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
        RadGrid1.DataSource = MyDataTable
    End Sub
  
    Private Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemCreated
        If (TypeOf e.Item Is GridDataInsertItem AndAlso e.Item.IsInEditMode) Then
            'init insert operation triggered
            Dim myString As String = "NOTHING"
  
        ElseIf (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then
            'edit operation triggered
            Dim myString As String = "NOTHING"
        End If
    End Sub
  
End Class
David
Top achievements
Rank 1
 answered on 05 Sep 2012
5 answers
454 views
When I have a RadListBox that allows multiple selections, such as:

<telerik:RadListBox ID="rlbItems" runat="server" AutoPostBack="true" Height="200px"
SelectionMode="Multiple" OnSelectedIndexChanged="items_SelectedIndexChanged" />

The server side event only fires when a single selection is made via a click. If the user clicks to drag across several items, then the event never fires. Is there another event I should be using, or another way to make this even fire appropriately when the selected items change?
Nencho
Telerik team
 answered on 05 Sep 2012
21 answers
206 views
I am using RADPanel bar Q2 2008 in my application. I am able to successfully use the control except for a problem in animation.

The animation is showing a flicker on expand or collapse. I digged in to the issue and found that this is occuring only if i remove following string in the aspx header:

<!

 

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

If the string is present, the animation works fine but my page breaks. This application is an old application and difficult to debug why it is breaking. I guess the problem is with some not well written HTML. Is there any way i can get the animation working flawlessly with the above string not present in the page?

 

 

Kate
Telerik team
 answered on 05 Sep 2012
1 answer
99 views
I wrote a generic HTTP handler for submitting forms that is shared throughout my site like this:

<form action="formmail.ashx" method="post">
     <!-- form contents here -->
</form>

This is so the graphic artists on my team can put anything they want inside it form-wise and it doesn't rely on a form that has runat="server" in it (so no postbacks in the typical sense that we're all used to). Given that, I'm also not doing any server checking for whether the page is valid behind the button itself which is where my real question lies. Is it possible to utilize RadCaptcha in this manner and it still prevent the form from submitting? Or do I have to migrate to an ASP.NET form that can do a Page.IsValid?
Slav
Telerik team
 answered on 05 Sep 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?