Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
201 views
 Protected Sub ButtonAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)  
 
 Session("employeeIsBeingAdded") = True  
 End Sub  
 
Protected Sub BureausGrid_ItemCreated(ByVal sender As Object, ByVal e As GridItemEventArgs) Handles BureausGrid.ItemCreated  
 
If Session("bureauIsBeingSavedOrAdded") = True Then  
                If TypeOf e.Item Is GridDataItem Then  
 
                    Dim dataitem As GridDataItem = CType(e.Item, GridDataItem)  
                    Dim viewButton As ImageButton = CType(dataitem("viewColumn").Controls(0), ImageButton)  
   
                  viewButton.Attributes("onclick") = "return confirm('Quit editing this employee?')"  
           
                End If  
End Sub 
I have an image button that I need to assign an onclick property to when a button outside of the grid is clicked. I was going to use the ItemCreated event and determine whether to assign the property based on a session variable that gets assigned when the button outside the grid is clicked, but the ItemCreated event is executed before the handler for the button, so the session variable is not read. I was wondering if anyone had any thoughts about getting around this?

Thanks
William
Top achievements
Rank 1
 answered on 05 Mar 2009
0 answers
114 views
I have noticed that in IE6 using a  customized skin in ie6 using the Menu.Default.css that thelast menu item (ie rmLast) from the rootgroup suffers from the peekaboo bug on hover. Using sliding doors technique for the rounded corners to display dynamic tabs that stretch and contract. Anyone have any suggestions? Using zoom: 100% does not work but it displays the two images and blows up the menu huge. Basically I want the item to have hasLayout. This is an IE6 specific issue.

Python
None
Top achievements
Rank 1
 asked on 05 Mar 2009
2 answers
349 views
Hi All,

I have a RadTabStrip/RadMultiPage arrangement patterned after the Load on Demand and the Dynamic Page View examples.  In one view (ReportsPage) I have a user control that contains a RadSplitter with 2 RadPanes and a RadSplitBar.  In the two panes I want to dynamically add controls based on the value of a session object.  However I haven't got that far due to another issue.  Initially in the left pane I have another user control (ReportSelection) that contains a RadTreeView which is populated as expected in the page load of the parent control.  When I click on another tab and return to the original tab the user control with the tree view no longer appears so it seems like a view state issue.  Code snippets are below.  If anyone can help me with this I'd appreciate it.

Thanks,
Jim

Mainpage.aspx:              
        <script type="text/javascript"
            function onTabSelecting(sender, args)  
            { 
                if (args.get_tab().get_pageView())  
                { 
                    if (args.get_tab().get_pageView().get_id())  
                    { 
                        args.get_tab().set_postBack(false); 
                    } 
                } 
            }              
        </script>  
                <telerik:RadTabStrip ID="TopTabStrip" runat="server"  
                    MultiPageID="TopMultiPage" SelectedIndex="3" 
                    Skin="Office2007" style="padding-left:50px;"  
                    ontabclick="TopTabStrip_TabClick" onclienttabselecting="onTabSelecting"
                </telerik:RadTabStrip> 
                <telerik:RadMultiPage ID="TopMultiPage" runat="server" Height="100%"   
                    SelectedIndex="2" CssClass="MultipageWrapper"  
                    onpageviewcreated="TopMultiPage_PageViewCreated" Width="100%"
                </telerik:RadMultiPage> 
 

Mainpage .cs:
        protected void Page_Load( object sender, EventArgs e ) 
        { 
            if ( !Page.IsPostBack ) 
            { 
                AddTab( "Admin" ); 
                AddTab( "Configure" ); 
                RadTab tab = AddTab( "Reports" ); 
                AddTab( "Help" ); 
                AddPageView( this.TopTabStrip.FindTabByText( "Reports" ) ); 
                tab.PageView.Selected = true
                this.TopTabStrip.SelectedIndex = 2
            } 
        } 
 
        private RadTab AddTab( string tabName ) 
        { 
            RadTab tab = new RadTab(); 
            tab.Text = tabName
            this.TopTabStrip.Tabs.Add( tab ); 
            return tab; 
        } 
 
        private void AddPageView( RadTab tab ) 
        { 
            RadPageView pageView = new RadPageView(); 
            pageView.ID = tab.Text; 
            this.TopMultiPage.PageViews.Add( pageView ); 
            tab.PageViewID = pageView.ID; 
        } 
 
        protected void TopMultiPage_PageViewCreated( object sender, RadMultiPageEventArgs e ) 
        { 
            string userControlName = e.PageView.ID;// +"CS.ascx"; 
            if ( null != userControlName ) 
            { 
                Control userControl = null
                if ( "Admin".Equals( userControlName ) ) 
                { 
                    userControl = Page.LoadControl( "AdminPage.ascx" ); 
                    userControl.ID = e.PageView.ID + "_userControl"; 
                } 
                else if ( "Configure".Equals( userControlName ) ) 
                { 
                    userControl = Page.LoadControl( "Configuration.ascx" ); 
                    userControl.ID = e.PageView.ID + "_userControl"; 
                } 
                else if ( "Reports".Equals( userControlName ) ) 
                { 
                    userControl = Page.LoadControl( "ReportsPage.ascx" ); 
                    userControl.ID = e.PageView.ID + "_userControl"; 
                } 
                else if ( "Help".Equals( userControlName ) ) 
                { 
                    userControl = Page.LoadControl( "HelpPage.ascx" ); 
                    userControl.ID = e.PageView.ID + "_userControl"; 
                } 
                if ( null != userControl ) 
                    e.PageView.Controls.Add( userControl ); 
            } 
        } 
 
        protected void TopTabStrip_TabClick( object sender, RadTabStripEventArgs e ) 
        { 
            AddPageView( e.Tab ); 
            e.Tab.PageView.Selected = true
        } 
 

ReportsPage.ascx:
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server"
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="RadTreeView1"
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="ReportPane" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
    </AjaxSettings> 
</telerik:RadAjaxManagerProxy> 
<telerik:RadSplitter ID="ReportPageSplitter" Runat="server" Skin="Office2007"  
    Height="100%" Width="100%" > 
    <telerik:RadPane ID="LeftPane" Runat="server" Height="" Width="30%"
    </telerik:RadPane> 
    <telerik:RadSplitBar ID="RadSplitBar1" Runat="server" CollapseMode="Both" /> 
    <telerik:RadPane ID="RightPane" runat="server" Height=""
    </telerik:RadPane> 
</telerik:RadSplitter> 
 

ReportsPage.cs:
        protected void Page_Load( object sender, EventArgs e ) 
        { 
            if ( !Page.IsPostBack ) 
            { 
                // Check for session variables to determine what to display in each pane. 
                object obj = Session[ "ReportMode" ]; 
                string reportMode = ""
                if ( null == obj ) 
                { 
                    reportMode = "ReportSelection"
                    Session[ "ReportMode" ] = reportMode; 
                } 
 
                if ( "ReportSelection".Equals( reportMode ) ) 
                { 
                    // Show the report selection control. 
                    ReportSelection rptSelect = (ReportSelection) LoadControl( "ReportSelection.ascx" ); 
                    this.LeftPane.Controls.Add( rptSelect ); 
                } 
                else 
                { 
                    // Show the report parameter control. 
                    ReportParameters rptParms = (ReportParameters) LoadControl( "ReportParameters.ascx" ); 
                    this.LeftPane.Controls.Add( rptParms ); 
                } 
            } 
        } 
 

ReportSelection.ascx:
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server"
</telerik:RadAjaxManagerProxy> 
<telerik:RadTreeView ID="RptSelectTreeView" Runat="server" Skin="Office2007"  
    onnodeclick="RptSelectTreeView_NodeClick"
</telerik:RadTreeView> 
 

ReportSelection.cs:
        protected void Page_Load( object sender, EventArgs e ) 
        { 
            if ( !Page.IsPostBack ) 
            { 
                // Build the tree. 
                // TODO - build this based on info from the database. 
                RadTreeNode rootNode = new RadTreeNode( "Reports" ); 
                rootNode.PostBack = false
                rootNode.Expanded = true
                RadTreeNode directReportsNode = new RadTreeNode( "Category 1" ); 
                directReportsNode.PostBack = false
                RadTreeNode childNode = new RadTreeNode( "Report1" ); 
                directReportsNode.Nodes.Add( childNode ); 
                childNode = new RadTreeNode( "Report2" ); 
                directReportsNode.Nodes.Add( childNode ); 
                rootNode.Nodes.Add( directReportsNode ); 
                this.RptSelectTreeView.Nodes.Add( rootNode ); 
            } 
        } 
 



Jim
Top achievements
Rank 1
 answered on 05 Mar 2009
2 answers
208 views
Hello all, I can't seem to get lowercase filtering to work.  I have a client table with last names as such 'Jones', 'Adams' ect

Filtering on that column in lowercase such as typing in 'jones' and using contains will not show in the grid even if I step through and see that I am returning a row of data.  Typing in 'Jones' and filtering that way works fine.  I think i am doing something wrong with my NeedDataSource event.

Here is my code ( i am using Custom paging):

        protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            int count = 0;

            RadGrid1.DataSource = ClientBLL.GetPagedClients(RadGrid1.PageSize, RadGrid1.MasterTableView.CurrentPageIndex * RadGrid1.PageSize, RadGrid1.MasterTableView.FilterExpression, currentsort.Value, out count);
            RadGrid1.MasterTableView.VirtualItemCount = count;
                          
        }


    
Here is the code for retrieving the data:

        public static IQueryable<APAPortal.vw_client> GetPagedClients(int maximumRows, int startRowIndex, string filterExpression, string sortExpression, out int count)
        {
            APADataContext db = new APADataContext();
            var query = from c in db.vw_clients
                        select c;

            //Set filter expresion
            if (!String.IsNullOrEmpty(filterExpression))
            {
                query = query.Where(String.Format(@"{0}", filterExpression));
            }

            if (!String.IsNullOrEmpty(sortExpression))
            {
                query = query.OrderBy(sortExpression);
            }
            else
            {
                query = query.OrderBy("RecordAccountName Asc");
            }

            //Set the total row count
            count = query.Count();

            var pagedData = query.Skip(startRowIndex).Take(maximumRows);

            return pagedData;
        }




Chris Messineo
Top achievements
Rank 1
 answered on 05 Mar 2009
6 answers
136 views
Hi can someone please tell how can i do what the subject says

thnks
Gary
Top achievements
Rank 1
 answered on 05 Mar 2009
1 answer
207 views
How do I get the RadChart to bind to a date column from SQL on the X-Axis?
I have the following coming back from a stored proc (below are the column names and datatype as they are defined in the table and returned by the stored proc

taskname - string
startdate - datetime
enddate - datetime
duration - integer

I cannot for the life of me figure out how to the x-axis to display a date duration along the bottom that will at least take into account the earliest date and the latest date in the dataset returned from the stored proc.  Do I need to return start and end dates in the stored proc?  Configure it somewhere else?  Any help would be appreciated!


Giuseppe
Telerik team
 answered on 05 Mar 2009
5 answers
133 views
Hi guys,

I am trying to get the endtime of the appoitment on OnClientAppointmentMoveEnd client-side event.

The idea is that I want to restrict the user from bypassing the business hours set ( 9am - 6pm) while he is updating the apointment from client side.

I have the code to cancel the event but I am not able to find the new endtime of the appointment when he finishes dragging.

   function appointmentMoveEnd(sender, args) { 
 
 
             debugger; 
             var targetSlot = args.get_targetSlot(); 
             var startTime = targetSlot.get_startTime(); 
             var startTime = targetSlot.get_startTime(); 
             var appointment = args.get_appointment();  
             var originalStartTime = appointment.get_start(); 
 
             var newHour = originalStartTime.getHours(); 
             var newMinute = originalStartTime.getMinutes(); 
             var newSecond = originalStartTime.getSeconds(); 
              
              
 
             startTime.setHours(newHour); 
             startTime.setMinutes(newMinute); 
             startTime.setSeconds(newSecond); 
 
             var endTime = new Date(startTime.getTime() + appointment._getDuration()); 
              
              
             var date = args.get_appointment().get_end(); 
             alert(date); 
                 args.get_appointment().get_element().style.border = "1px solid Orange"
                 args.set_cancel(true); 
            
         } 

The above code is just an experimentation.

I just want to get the new endtime and see if the end time is outside the business hours so I can cancel updating.

--------------------------------

Other question :

In the scheduler, I want to make MinutesperRow = 60 and show each hour displayed in one row Like :

8am
9am
10am
....


Each hour shows one Row only of 60 minutes


Thanks a lot.
Peter
Telerik team
 answered on 05 Mar 2009
1 answer
99 views
I want to have a "Reply" link which scrolls the window down to my radeditor...kind of works now with this

    function ReplyClick(sender) {
        var editor = $find("<%=txtComment.ClientID%>");

        editor.setFocus();
    }

Once the user starts to type it moves down...but I dont think they'll know the cursor is in the radeditor unless the entire window moves.

Any ideas?



Tervel
Telerik team
 answered on 05 Mar 2009
1 answer
99 views
I set my HierarchyLoadMode is server but I have inner "Div" so I want to collapse by javascript besides using HierarchyLoadMode =client. I have facing a lot performance issues.
Sebastian
Telerik team
 answered on 05 Mar 2009
7 answers
229 views
hi

This is my grid value of the first column:

CustomerName
Allen
Ben
Charlie

I would like to extract the first character and pass it to a session. For example "Allen", Session("value") = "A".  "Ben", Session("value") = "B".  How should i go about it? thanks
L
Top achievements
Rank 1
 answered on 05 Mar 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?