Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
61 views
Hi,

I need to create schedule that starts today at 8am and ends tomorrow at 6am.
Is it possible to achieve this functionality using Day view of Scheduler Control?
If yes, how? I've been trying to set start and end time of Day view, but it's not working if I set end time smaller then start time.

Thanks,
Tomica

Tomica
Top achievements
Rank 1
 answered on 29 Oct 2009
1 answer
101 views
Hi All

Have a grid with a two RadComboBox in each column.

While the page is Loaded I need to load records from a table (abc) int the first RadComboBox.

I Have used

protected void RadGridCurrInvt_ItemDataBound(object sender, GridItemEventArgs e)  
        {  
            if (e.Item is GridDataItem)  
            {  
                GridDataItem item = (GridDataItem)e.Item; 

                RadComboBox

RBCCurrInvtType = (RadComboBox)item.FindControl("RBCCurrInvtType"); 

                RBCCurrInvtType.DataSource = blCllAgt.getCurrentInvestmentType();  
                RBCCurrInvtType.DataBind();  
            }  
        }   
But,Nothing is displayed, only the grid which is shown as  line appears.

Is there any option for this.

Thanking You

-Anto
Princy
Top achievements
Rank 2
 answered on 29 Oct 2009
3 answers
1.1K+ views
My ImageButton (imgbtnToggle) will not pass the CommandArgument to my method ToggleTaskResults. Based on searches here, I guess this is because I'm doing Client Side DataBinding? How can I do server side or whatever to make this work? Thanks?

 

<telerik:RadGrid ID="RadGrid1" runat="server" OnItemDataBound="dgResults_OnItemDataBound" AutoGenerateColumns="false" EnableViewState="false" >

 

 

<MasterTableView>

 

 

<Columns>

 

 

<telerik:GridTemplateColumn>

 

 

<ItemTemplate>

 

 

<asp:ImageButton ID="imgbtnToggle" runat="server" CausesValidation="false" Visible='<%#Eval("IsTask").Equals(false) %>'

 

 

CommandArgument='<%#Eval("ResultId") %>' OnClick="ToggleTaskResults" />

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridBoundColumn DataType="System.Int32" DataField="JobId">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataType="System.Int32" DataField="ResultId">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataType="System.Boolean" DataField="IsTask">

 

 

</telerik:GridBoundColumn>

 

 

</Columns>

 

 

</MasterTableView>

 

 

</telerik:RadGrid>

 

 

</ContentTemplate>

 

 

</asp:UpdatePanel>

 

Princy
Top achievements
Rank 2
 answered on 29 Oct 2009
1 answer
105 views
Hi,

After triing many times for all configurations i have some big problems for looping my rotators under last FF. I have tried and tested many configurations and searched xhtml complains errors. I have no error inside one maker not closed or similar like old post suggest. I have tested with Rotator.width and height definitions or without. Used with ItemsWidth ,height using definitions server and client side. 
Whats are the problem?. one internal "rrItemList" definition width of 10000px are generated and rotator are started, after first loop the internal counter is not cleared for the itemsnumber x Width and continue to 10000px. Result, you don´t get anymore your items and at end is blocked is this last value like 9474px..or similar... The looping is ok in IE8(Ie7) but fonts are infamous. Advice please.
 
<ul class="rrItemsList" style="width: 10000px; height: 368px; position: relative; left: -9474px; top: 0px; visibility: visible; opacity: 1;">
</ul>
 
    <telerik:RadRotator runat="server" ID="RadRotator1" Width="270" Height="310">     
        <ItemTemplate>    
            <asp:Image runat="server" ID="ImgRotator" Width="270" />    
        </ItemTemplate>    
    </telerik:RadRotator>  
I have tested may template contents including text or hyperlinks with same issue. I have defined more options server side with no effect.
regards.
Fiko
Telerik team
 answered on 29 Oct 2009
5 answers
433 views
I have written code to programmatically create a chart object and add one or more chart series to it.  This method is being called from an asp.net page and it returns the chart object.  The chart is being added to the page using the Controls.Add method.  After adding the chart, the series are not clickable.  How do I make the series (bar chart bars) clickable and hook them to event code in the page?
Quantesys IT
Top achievements
Rank 1
 answered on 29 Oct 2009
1 answer
218 views
I am trying to do a simple recursion of folders based upon this folder structure:
Folder ID
Folder Name
Folder Parent

for example root folder has an id of 0 and parent is -1 identifying it as the root folder
Subsequent folders relate back to thier parent id.

Here is the code I got:
'Format Code Block'

 

Public Sub getparentfolders(ByVal parentid As String, ByVal name As String, ByVal rootnode As RadTreeNode)

 

DBConn =

New SqlConnection(ConfigurationManager.ConnectionStrings("db").ToString)

 

 

Dim roottable As New DataTable

 

 

Dim rootrow As DataRow

 

roottable = FolderAPI.GetAllFoldersByParent(parentid, DBConn)

 

Dim subtable As New DataTable

 

 

For Each rootrow In roottable.Rows

 

 

Dim ParentNode As New RadTreeNode

 

ParentNode.Text = rootrow(1).ToString

ParentNode.Value = rootrow(0).ToString

 

'Do I have sub folders

 

subtable = FolderAPI.GetAllFoldersByParent(rootrow(0).ToString, DBConn)

 

If subtable.Rows.Count = 0 Then

 

rootnode.Nodes.Add(ParentNode)

 

Else

 

name = rootrow(1).ToString

getchildfolder(rootrow(0).ToString, name, ParentNode, rootnode, childnode)

 

End If

 

 

Next

 

FolderList.Nodes.Add(rootnode)

 

End Sub

 

 

Public Sub getchildfolder(ByVal parentid As String, ByVal name As String, ByVal ParentNode As RadTreeNode, ByVal rootnode As RadTreeNode, ByVal Childnode As RadTreeNode)

 

 

If Childnode.Text = "" Then Childnode = ParentNode

 

DBConn =

New SqlConnection(ConfigurationManager.ConnectionStrings("db").ToString)

 

 

Dim roottable As New DataTable

 

 

Dim rootrow As DataRow

 

roottable = FolderAPI.GetAllFoldersByParent(parentid, DBConn)

 

If roottable.Rows.Count < 1 Then

 

 

Try

 

rootnode.Nodes.Add(ParentNode)

 

Catch ex As Exception

 

 

Dim parentnode2 As New RadTreeNode

 

parentnode2.Text = name

parentnode2.Value = parentid

 

Dim rootnode2 As New RadTreeNode

 

rootnode2.Text =

"Home"

 

rootnode2.Value = 0

rootnode = rootnode2

rootnode.Nodes.Add(parentnode2)

 

End Try

 

 

End If

 

 

Dim newchild As New RadTreeNode

 

 

For Each rootrow In roottable.Rows

 

 

'Do I have more folders

 

name = rootrow(1).ToString

newchild.Text = name

newchild.Value = parentid

Childnode.Nodes.Add(newchild)

 

'getparentfolders(parentid, name, ParentNode)

 

getchildfolder(rootrow(0).ToString, name, ParentNode, rootnode, newchild)

 

Next

 

 

End Sub

 

 

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

 

 

Dim rootnode As New RadTreeNode

 

rootnode.Value = -1

rootnode.Text =

"Root"

 

getparentfolders(

"0", "Root", rootnode)

 


Here is where it gets annoying, Works fine except for folders with two sub folders.
Then I get this:

Specified argument was out of the range of valid values.
Parameter name: index

Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: index

Source Error:

Line 36:             End If
Line 37:         Next
Line 38: FolderList.Nodes.Add(rootnode)

In debugging you can see the parent folder all of a sudden has an index of 2. WTF?
Yana
Telerik team
 answered on 29 Oct 2009
1 answer
169 views
Running into a few issues here.  The functionality we want this application to have is quite simple.  We have a "notes" control with a RadAjaxPanel that consists of a RadTextBox and also a RadPanelBar within another RadAjaxPanel. Notes that are already in the database will populate into their own RadPanelbar items when the page is loaded.  The user enters some text into the RadTextBox and clicks "save."  For some strange reason, once the save button is clicked - the RadPanelBar disappears and is not shown again unless the whole control is closed and reopened.  Another strange issue is that every now and then, the text will not save if it is entered and the save button is clicked too quickly.




<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Notes.ascx.cs" Inherits="Notes" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<html> 
<head> 
    <style type="text/css"> 
        body 
        { 
            background-color: #d3d3d3; 
        } 
        img 
        { 
            border: none; 
        } 
        .notesblock 
        { 
            width: 99%; 
            margin: 0 0 0 0; 
        } 
        .noteslist 
        { 
            color: #8a8c8f; 
            list-style-type: none; 
            padding: 0px 1px; 
            font-family: "Lucida Grande" , "Segoe UI" , "Bitstream Vera Sans" , Tahoma, Verdana, Arial,sans-serif; 
            font-size: 10px; 
            line-height: 160%; 
        } 
        #saveButton 
        { 
            position: absolute; 
            top: 280px; 
            right: 75px; 
        } 
        #cancelButton 
        { 
            position: absolute; 
            top: 280px; 
            right: 12px; 
        } 
        #expandButton 
        { 
            position: absolute; 
            top: 20px; 
            right: 5px; 
        } 
 
    </style> 
 
    <script type="text/javascript"> 
        function clearText(field) { 
 
            var selectString = "Click to Enter New Note"; 
 
            if (field.defaultValue == selectString) field.value = ''; 
 
            //        if (field.defaultValue == selectString) field.value = ''; 
            //        else if (field.value == '') fieldfield.value = field.defaultValue;     
        } 
 
 
        function resizeTB() { 
            var tb = $find("<%= txtUserNote.ClientID %>"); 
//            tb._originalTextBoxCssText = "width:99%;height:35px;"; 
//            tb.updateCssClass(); 
 
            return false; 
        } 
 
 
        function ButtonClick(sender, e) { 
            var radTextBox = sender; 
            radTextBox.raisePostBackEvent(); 
        } 
 
    </script> 
 
</head> 
<body bgcolor="#F4F4F4" runat="server" id="MainBody"> 
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="100%" Width="100%"> 
        <asp:Literal ID="notesHeader" runat="server"> 
        </asp:Literal> 
        <telerik:RadTextBox ID="txtUserNote" runat="server" TextMode="MultiLine" Width="99%" 
            Height="15px" Visible="False" EmptyMessage="Click to Enter New Note" Font-Size="10px" 
            AutoPostBack="true"> 
        </telerik:RadTextBox> 
        <div id="expandButton"> 
            <asp:ImageButton runat="server" ID="expandTbButton" ImageUrl="images/expand.gif" 
                OnClientClick="return resizeTB()" /> 
        </div> 
        <div id="saveButton"> 
            <asp:Button ID="SaveButton" Height="20px" Font-Size="10px" runat="server" Text="Save" 
                Visible="False" OnClick="SaveButton_Click" /> 
        </div> 
        <div id="cancelButton"> 
            <asp:Button ID="CancelButton" Height="20px" Font-Size="10px" runat="server" Text="Cancel" 
                OnClick="CancelButton_Click" Visible="False" /> 
        </div> 
    </telerik:RadAjaxPanel> 
    <div id="allnotes"> 
        <telerik:RadAjaxPanel ID="RadAjaxPanel2" runat="server" Width="562px" Style="background-color: #d3d3d3;"> 
            <telerik:RadPanelBar ID="RadPanelBar1" runat="server" Style="background-color: #d3d3d3;" 
                EnableEmbeddedSkins="false" Skin="Custom" Height="200px" Width="562px" ExpandMode="FullExpandedItem"> 
            </telerik:RadPanelBar> 
        </telerik:RadAjaxPanel> 
    </div> 
</body> 
</html> 
 
 
 
 
    public partial class Notes : System.Web.UI.UserControl, IPostBackDataHandler 
    { 
        #region variables 
        private string noteText = string.Empty; 
        private string userNote = string.Empty; 
        private string sessionNoteKey = "4"; 
        private string modeKey = "5"; 
        private string tempNoteTextKey = "6"; 
        public static string invoiceNotesObjectKey = "7"; 
        #endregion 
 
        #region Page event handlers 
        protected void Page_Load(object sender, EventArgs e) 
        { 
            Notes notes = (Notes)Session[invoiceNotesObjectKey]; 
 
            LoadNoteHistory(notes); 
 
            if (notes == null) 
            { 
                notes = new Notes(); 
            } 
 
            txtUserNote.Visible = true; 
            CancelButton.Visible = true; 
            SaveButton.Visible = true; 
 
        } 
        #endregion 
 
        #region enumerations 
        private enum Mode 
        { 
            Delete = 0, 
            Edit, 
            New 
        } 
        #endregion 
 
        #region properties 
        public string NoteText 
        { 
            get { return noteText; } 
            set { noteText = value; } 
        } 
 
        public string UserNote 
        { 
            get { return userNote; } 
            set { userNote = value; } 
        } 
        #endregion 
 
        #region public methods 
        public void AddNote(Invoice invoice) 
        { 
            Notes notes = ((Notes)Session[this.sessionNoteKey]); 
            Note note = notes[notes.Count - 1]; 
            note.DateTime = System.DateTime.Now; 
            note.DocId = invoice.ID; 
            note.Username = invoice.Username; 
            note.Save = true; 
            invoice.Notes.Add(note); 
        } 
 
 
        public bool LoadNoteHistory(Notes notes) 
        { 
            StringBuilder stringBuilder; 
            int counter = 1; 
 
            Session[this.sessionNoteKey] = notes; 
 
            XmlDocument xmlDoc = new XmlDocument(); 
            XmlElement notesBlock = xmlDoc.CreateElement("div"); 
            notesBlock.SetAttribute("class", "notesblock"); 
            xmlDoc.AppendChild(notesBlock); 
 
 
            stringBuilder = new StringBuilder("<div class=\"notesblock\">"); 
 
            stringBuilder.Append("<ol class=\"noteslist\">"); 
 
            stringBuilder.Append("<li>"); 
 
            notesHeader.Text = stringBuilder.ToString(); 
 
            xmlDoc = new XmlDocument(); 
            notesBlock = xmlDoc.CreateElement("div"); 
            notesBlock.SetAttribute("class", "notesblock"); 
            xmlDoc.AppendChild(notesBlock); 
 
 
            RadPanelBar1.Items.Clear(); 
 
            for (int i = 0; i < notes.Count; i++) 
            { 
                String userName = notes[i].Username; 
                String pendingStatus = " - Pending "; 
                String dateTime = notes[i].DateTime.ToShortDateString(); 
                String noteText = notes[i].Text.ToString(); 
                String newNote; 
 
                if (notes[i].Save == true) 
                { 
                    Session[tempNoteTextKey] = txtUserNote.Text; 
                    newNote = userName + pendingStatus + dateTime + " " + noteText; 
                     
                    txtUserNote.Text = notes[i].Text; 
                } 
 
                else 
                { 
                    CreateRPI(userName, dateTime, noteText); 
                } 
 
                counter++; 
            } 
 
 
            if (this.noteText.Length != 0) 
            { 
                return true; 
            } 
 
            return false; 
        } 
        #endregion 
 
        #region protected methods 
 
        protected void CancelButton_Click(object sender, EventArgs e) 
        { 
            txtUserNote.Text = string.Empty; 
            txtUserNote.Visible = false; 
            CancelButton.Visible = false; 
            SaveButton.Visible = false; 
        } 
 
 
        protected void SaveButton_Click(object sender, EventArgs e) 
        { 
            Note note; 
            CIS.Common.Business.Objects.InvoiceRouter.Notes notes; 
            bool isThereANewNote; 
 
            if (txtUserNote.Text.Length != 0) 
            { 
                notes = (Notes)Session[this.sessionNoteKey]; 
 
                isThereANewNote = false; 
 
                foreach(Note n in notes) { 
                    if (n.Save) 
                    { 
                        isThereANewNote = true; 
                        break; 
                    } 
                } 
 
                if (!isThereANewNote) 
                { 
                    note = new Note(); 
                    note.DateTime = System.DateTime.Now; 
                    if (Session[tempNoteTextKey] == null) 
                    { 
                        note.Text = txtUserNote.Text; 
                    } 
                    else 
                    { 
                        note.Text = Session[tempNoteTextKey].ToString(); 
                    } 
 
                    txtUserNote.Text = note.Text; 
                    note.Username = (Session[Key]).UserName.ToUpper(); 
                    note.Save = true; 
                    notes.Add(note); 
                } 
                else 
                { 
                    note = notes[notes.Count - 1]; 
                    note.DateTime = System.DateTime.Now; 
                    if (Session[tempNoteTextKey] == null) 
                    { 
                        note.Text = txtUserNote.Text; 
                    } 
                    else 
                    { 
                        note.Text = Session[tempNoteTextKey].ToString(); 
                    } 
 
                    txtUserNote.Text = note.Text; 
                     
                    note.Save = true;                     
                } 
                 
                LoadNoteHistory(notes); 
                 
            } 
            txtUserNote.Visible = true; 
            CancelButton.Visible = true; 
            SaveButton.Visible = true; 
        } 
 
        protected void txtUserNote_TextChanged(object sender, EventArgs e) 
        { 
            this.userNote = txtUserNote.Text; 
        } 
        #endregion 
 
        #region event handlers 
 
 
 
        #endregion 
 
        #region IPostBackDataHandler Members 
 
        public bool LoadPostData(string postDataKey, System.Collections.Specialized.NameValueCollection postCollection) 
        { 
            return true; 
        } 
 
        public void RaisePostDataChangedEvent() 
        { 
            //Not Implemented 
        } 
 
        #endregion 
 
        #region RadPanelItem Creation 
 
 
        RadPanelItem CreateRPI(String panelItemName1, String panelItemName2, String panelItems1) 
        { 
            RadPanelItem rpi = new RadPanelItem(); 
            rpi.Text = panelItemName1 + " " + panelItemName2; 
            rpi.Font.Size = 8; 
            RadPanelItem rpItem = new RadPanelItem(); 
            rpItem.Text = panelItems1; 
            rpItem.Font.Size = 8; 
            rpi.Items.Add(rpItem); 
            RadPanelBar1.Items.Add(rpi); 
            return rpi; 
        } 
 
        RadPanelItem CreateNewNote(String panelItemName1, String pendingItem, String panelItemName2, String panelItems1) 
        { 
            RadPanelItem rpi = new RadPanelItem(); 
            rpi.Text = panelItemName1 + pendingItem + panelItemName2; 
            rpi.Font.Size = 8; 
            RadPanelItem rpItem = new RadPanelItem(); 
            rpItem.Text = panelItems1; 
            rpItem.Font.Size = 8; 
            rpi.Items.Add(rpItem); 
            RadPanelBar1.Items.Add(rpi); 
            return rpi; 
        } 
         
 
 
        #endregion 
    } 
 
 
 

Yana
Telerik team
 answered on 29 Oct 2009
2 answers
147 views
Hi
   I need Javascript for showdrop visible=true when not showing dropdown

For ex
    var combo =$find("<%= ddlGC.ClientID %>");
If(combo.showdropdown==false){
combo.showdropdown;
}
But when i set like this its flickering.
pasam Anna
Top achievements
Rank 1
 answered on 29 Oct 2009
1 answer
93 views
hi,
is it possible to set panel bar items with images only?

thanks
puneet

Princy
Top achievements
Rank 2
 answered on 29 Oct 2009
1 answer
126 views
Hi

Please Help Me
I was Using Radcontext Menu To Display radwindow ....can u explain anyone of the solution For that
Shinu
Top achievements
Rank 2
 answered on 29 Oct 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?