Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
160 views
Hello - I have a grid that has a Quantity, a Cost, and a Total column.  Currently, the Total Column is a TemplateColumn and on ItemDataBound I manaully calculate the Total (which is Quantity * Cost) for each row.  This presents a problem when there are 100+ rows, performance wise.  I know I can change it to a Calculated Column, which would erase the need to manually calculate it in the code behind.  My problem is that the user needs to see the new Total while they are still editing the row.  With the Template column, I can use JavaScript to udpdate it, but am unable to use JS when I change it to a Calculated Column.  This seems like a pretty basic question...  Any ideas?
TPerry
Top achievements
Rank 1
 answered on 29 Jul 2010
3 answers
153 views
Hi,

I'm trying to move a recurring appointment, but when the serverside-event OnAppointmentUpdate fires, the recurrencerule is not changed. For some reason we always use weekly recurrences, even if there's only one occurrence.

In the following example the start and enddate are changed one day earlier, but the recurrencerule is the same after moving the appointment and choosing "Move the series". How can I change the recurrencerule too?

Appointment before move:
Start = 22-07-2010 08:00
End = 22-07-2010 09:00
RecurrenceRule:
DTSTART:20100722T080000Z
DTEND:20100722T090000Z
RRULE:FREQ=WEEKLY;UNTIL=20100722T090000Z;INTERVAL=1;BYDAY=TH

Appointment after move:
Start: 21-07-2010 08:00
End: 21-07-2010 09:00
RecurrenceRule:
DTSTART:20100722T080000Z
DTEND:20100722T090000Z
RRULE:FREQ=WEEKLY;UNTIL=20100722T090000Z;INTERVAL=1;BYDAY=TH
T. Tsonev
Telerik team
 answered on 29 Jul 2010
2 answers
232 views
This is the first time I've tried to make a detail table in a radgrid editable. I have a grid with 3 detail tables. I when I've made one of them updatable so far, but when I enter the new information and hit update the form closes and no data is updated. No error is generated either. I'm using ASP:SqlDataSources for my data. Do I need anything extra to get the details table to run an update?

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="CourseList.ascx.cs" Inherits="edu.yale.som.courses.CourseList" %>
<%@ Register TagPrefix="telerik" Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" %>
<telerik:RadGrid runat="server" ID="GridCourses" AutoGenerateColumns="true" DataSourceID="CourseDataSource"
    Skin="WebBlue" AllowAutomaticUpdates="true">
    <MasterTableView DataKeyNames="SOMCourseID" HierarchyDefaultExpanded="False" AutoGenerateColumns="false"
        ExpandCollapseColumn-Display="true">
        <Columns>
            <telerik:GridBoundColumn DataField="SOMCourseID" UniqueName="SOMCourseID" HeaderText="SOMCourseID"
                Visible="false" />
            <telerik:GridBoundColumn DataField="CourseID" UniqueName="CourseID" HeaderText="CRN" />
            <telerik:GridBoundColumn DataField="NumberSection" UniqueName="CourseNumber" HeaderText="Course Number" />
            <telerik:GridBoundColumn DataField="CourseTitle" UniqueName="Title" HeaderText="Title" />
            <telerik:GridBoundColumn DataField="CourseSession" UniqueName="Session" HeaderText="Session" />
            <telerik:GridBoundColumn DataField="Units" UniqueName="Units" HeaderText="Units" />
            <telerik:GridBoundColumn DataField="TermCode" UniqueName="TermCode" HeaderText="TermCode" />
            <telerik:GridBoundColumn DataField="Cohort" UniqueName="Cohort" HeaderText="Cohort" />
        </Columns>
        <DetailTables>
            <telerik:GridTableView DataKeyNames="SOMCourseID" DataSourceID="CourseTimeDataSource"
                runat="server" AutoGenerateColumns="False" AllowAutomaticUpdates="true">
                <Columns>
                    <telerik:GridBoundColumn DataField="ClassTime" UniqueName="ClassTime" HeaderText="Schedule"
                        ReadOnly="true" />
                    <telerik:GridBoundColumn DataField="Day" UniqueName="Day" HeaderText="Day" Visible="false" />
                    <telerik:GridBoundColumn DataField="StartTime" UniqueName="StartTime" HeaderText="Start Time"
                        Visible="false" />
                    <telerik:GridBoundColumn DataField="EndTime" UniqueName="EndTime" HeaderText="End Time"
                        Visible="false" />
                    <telerik:GridBoundColumn DataField="RecordID" UniqueName="RecordID" HeaderText="RecordID"
                        ReadOnly="true" Visible="true" />
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumnCourseTime" />
                </Columns>
                <EditFormSettings ColumnNumber="1">
                    <FormTableItemStyle Width="100%" Height="29px" />
                    <FormTableStyle GridLines="None" CellPadding="2" CellSpacing="0" />
                    <FormStyle Width="100%" BackColor="#eef2ea" />
                    <EditColumn ButtonType="ImageButton" CancelText="Cancel" UpdateText="Update" InsertText="Add" />
                </EditFormSettings>
                <ParentTableRelation>
                    <telerik:GridRelationFields DetailKeyField="SOMCourseID" MasterKeyField="SOMCourseID" />
                </ParentTableRelation>
            </telerik:GridTableView>
        </DetailTables>
        <DetailTables>
            <telerik:GridTableView DataKeyNames="SOMCourseID" DataSourceID="CourseDescriptionDataSource"
                runat="server" AutoGenerateColumns="False">
                <Columns>
                    <telerik:GridBoundColumn DataField="CourseDescription" UniqueName="Description" HeaderText="Description" />
                </Columns>
                <ParentTableRelation>
                    <telerik:GridRelationFields DetailKeyField="SOMCourseID" MasterKeyField="SOMCourseID" />
                </ParentTableRelation>
            </telerik:GridTableView>
        </DetailTables>
        <DetailTables>
            <telerik:GridTableView DataKeyNames="SOMCourseID" DataSourceID="SpecializationDataSource"
                runat="server" AutoGenerateColumns="False">
                <Columns>
                    <telerik:GridBoundColumn DataField="Specialization" UniqueName="Specialization" HeaderText="Specialization(s)" />
                </Columns>
                <ParentTableRelation>
                    <telerik:GridRelationFields DetailKeyField="SOMCourseID" MasterKeyField="SOMCourseID" />
                </ParentTableRelation>
            </telerik:GridTableView>
        </DetailTables>
        <DetailTables>
            <telerik:GridTableView DataKeyNames="SOMCourseID" DataSourceID="InstructorDataSource"
                runat="server" AutoGenerateColumns="False">
                <Columns>
                    <telerik:GridBoundColumn DataField="LastName" UniqueName="LastName" HeaderText="Last Name" />
                    <telerik:GridBoundColumn DataField="FirstName" UniqueName="FirstName" HeaderText="First Name" />
                    <telerik:GridHyperLinkColumn DataTextField="Email" DataNavigateUrlFields="EmailLink"
                        HeaderText="Email" />
                </Columns>
                <ParentTableRelation>
                    <telerik:GridRelationFields DetailKeyField="SOMCourseID" MasterKeyField="SOMCourseID" />
                </ParentTableRelation>
            </telerik:GridTableView>
        </DetailTables>
    </MasterTableView>
    <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
</telerik:RadGrid>
<asp:SqlDataSource ID="CourseDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:edu_yale_som_courses_dataclasses_connectionString %>"
    ProviderName="System.Data.SqlClient" SelectCommand="Select *, TermCode + CourseID as SOMCourseID, CourseNumber + '-'+ Section as NumberSection from SOMCourses where Termcode = 201003">
</asp:SqlDataSource>
<asp:SqlDataSource ID="CourseTimeDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:edu_yale_som_courses_dataclasses_connectionString %>"
    ProviderName="System.Data.SqlClient" SelectCommand="Select RecordID, SOMCourseID, Day, StartTime, EndTime,  Day + ' ' + StartTime + '-' + EndTime as ClassTime  FROM CourseTime Where SOMCourseID = @SOMCourseID"
    UpdateCommand="Update CourseTime Set Day= '@Day', StartTime='@StartTime', EndTime='@EndTime' WHERE RecordID=@RecordID">
    <SelectParameters>
        <asp:SessionParameter Name="SOMCourseID" SessionField="SOMCourseID" Type="Int64" />
    </SelectParameters>
    <UpdateParameters>
        <asp:Parameter Name="RecordID" Type="Int32" />
    </UpdateParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="CourseDescriptionDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:edu_yale_som_courses_dataclasses_connectionString %>"
    ProviderName="System.Data.SqlClient" SelectCommand="Select *, TermCode + CourseID as SOMCourseID, CourseDescription from SOMCourses where (TermCode + CourseID) = @SOMCourseID ">
    <SelectParameters>
        <asp:SessionParameter Name="SOMCourseID" SessionField="SOMCourseID" Type="Int64" />
    </SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="InstructorDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:edu_yale_som_courses_dataclasses_connectionString %>"
    ProviderName="System.Data.SqlClient" SelectCommand="Select *, 'mailto:'+Email as EmailLink from View_BannerSOMCourseIDInstructorID where SOMCourseID = @SOMCourseID ">
    <SelectParameters>
        <asp:SessionParameter Name="SOMCourseID" SessionField="SOMCourseID" Type="Int64" />
    </SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="SpecializationDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:edu_yale_som_courses_dataclasses_connectionString %>"
    ProviderName="System.Data.SqlClient" SelectCommand="Select * from CourseSpecialization where SOMCourseID = @SOMCourseID ">
    <SelectParameters>
        <asp:SessionParameter Name="SOMCourseID" SessionField="SOMCourseID" Type="Int64" />
    </SelectParameters>
</asp:SqlDataSource>
Jon Ingersoll
Top achievements
Rank 1
 answered on 29 Jul 2010
7 answers
155 views
I have a point chart with ScrollMode=XOnly. After I drag a rectangle on the chart, the zoom window doesn't match the position of the rectangle. It is shifted left or right.

Here is the aspx page.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="LabChart.aspx.cs" Culture="en-US" Inherits="IWChronicle.UI.LabChart" %> 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Charting" 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"> 
    <head id="Head1" runat="server"> 
    <title>Laboratory Chart</title> 
    </head> 
    <body id="Body1" runat="server"> 
    <form id="Form1" method="post" runat="server"> 
                <asp:ScriptManager ID="scriptManager1" runat="server" EnablePartialRendering="True" EnablePageMethods="True" EnableScriptGlobalization="True" EnableScriptLocalization="True" /> 
                    <telerik:RadChart ID="LabRadChart" runat="server" DefaultType="Point"  
                        Height="500px" Width="850px"> 
                        <Series> 
                            <telerik:ChartSeries DefaultLabelValue="#Y" Name="Series 1"  
                            Type="Point"> 
                                <Appearance LegendDisplayMode="Nothing"> 
                                    <FillStyle MainColor="213, 247, 255"> 
                                    </FillStyle> 
                                </Appearance> 
                            </telerik:ChartSeries> 
                        </Series> 
                        <PlotArea> 
                            <XAxis IsZeroBased="False" MaxItemsCount="5"> 
                                <Appearance ValueFormat="ShortDate"> 
                                </Appearance> 
                            </XAxis> 
                            <Appearance Dimensions-Margins="18%, 5%, 12%, 10%"> 
                            </Appearance> 
                        </PlotArea> 
                        <ClientSettings ScrollMode="XOnly" /> 
                    </telerik:RadChart> 
        <asp:Button ID="ResetButton" runat="server" Text="Reset"  
                    onclick="ResetButton_Click" /> 
    </form> 
    </body> 
</html> 
 

Here is the code-behind.
#region "Using statements" 
 
using System; 
using System.Web.UI; 
using Telerik.Charting; 
#endregion 
 
 
namespace IWChronicle.UI { 
 
    partial class LabChart : Page { 
 
        protected void Page_Load(object sender, EventArgs e) { 
            if (!IsPostBack) { 
                LabRadChart.Series[0].Items.AddRange(GetItems(20)); 
                LabRadChart.DataBind(); 
            } 
        } 
 
        private ChartSeriesItem[] GetItems(int count) { 
            DateTime startDate = new DateTime(2000, 1, 1); 
            ChartSeriesItem[] items = new ChartSeriesItem[count]; 
            for (int i = 0; i < count; i++) 
                items[i] = new ChartSeriesItem(startDate.AddDays(i * 30).ToOADate(), i); 
 
            return items; 
        } 
 
        protected void ResetButton_Click(object sender, EventArgs e) { 
            LabRadChart.ClientSettings.XScale = 1.0f; 
        } 
} 
 
} 
 


Also attached are 2 screenshots showing the rectangle and the zoomed window.

This may cause confusion for end users. Is there a work-around?

Thanks!

Jing
dingjing
Top achievements
Rank 2
 answered on 29 Jul 2010
1 answer
147 views

HI,

I have Oracle database with 3,00,000 of records with around 500 users will be accessing the same data in single shot from multiple countries, so i am unable to handle performance issue since i am following the following mechanism

 

objSearchContactResultsDO =

BusinessFactory.SearchContact().SearchContact(objSearchDO);

 

grdSearchContact.DataSource = objSearchContactResultsDO.ContactResultsDO;

objSearchContactResultsDO :- is getting the data from database and pushing to grid.

I am unable to do filter operations of telerik grid since i am using grdsearchcontact.Databind() method.

so i am capturing my fileter conditions from telerik grid and sending to database and that result i am filling with "OnneedDatasource" mentod. so soritng also taking long time since i am doing soring with database.
 
when i do search and sorting, it is doing postback the page and taking long time to give the result.

So Please adivce me the best mechanism to handle bulk data with multiple users.

Thanks in Advance.

Cori
Top achievements
Rank 2
 answered on 29 Jul 2010
1 answer
120 views
Ok, so I implimented OnClientAppointmentsPopulating and I see my custom values posting back...

But in GetAppointments the schedulerInfo object doesnt seem to HAVE those values...?

Ok, so if I get them there somehow, how to I get those values from THERE over to the provider to query my DB?

Peter
Telerik team
 answered on 29 Jul 2010
1 answer
118 views
I'm trying to do something similar with the Schedular to what's done with the DataGrid in this .
http://www.telerik.com/help/aspnet-ajax/grdlinqtosqlbindingcrudoperations.html example.

// Something like this but on the Schedular
protected void RadGrid1_ItemUpdated(object source, GridUpdatedEventArgs e)
       {
           if (e.Exception != null)
           {
               e.ExceptionHandled = true;
               ShowErrorMessage();
           }
       }


Is there any way of catching exceptions thrown from the persisting classes. I have the following check done and like to catch the exception and show it for the user when editing an appointment.

private void CheckPermission(DataContext db)
    {
        if (db.Projects.Where(p => p.id == this.project).Single().ProjectUsers.Where(p => p.user == AdUser.UserNr && p.isAdmin == true).Count() == 0)
        {
            throw new Exception(String.Format("No permission ({0})!", AdUser.Name));
        }
    }

Is there any other way to solve this then implementing all the inserting/updating and deleting in AppointmentInsert, AppointmentUpdate, AppointmentDelete

Peter
Telerik team
 answered on 29 Jul 2010
1 answer
159 views
Hello,

I have a web page that has 2 nested GridViews.  The second GridView has a user control that contains 10 RadToolTips, 5 for Buttons and 5 for LinkButtons.  The Buttons and LinkButtons cause a window to popup using the javascript window.open.  When the window closes the parent is going to refresh the content of the 10 RadTooltips via javascript.  I cannot get a reference to any of these RadTooltips.  I am not using the RadToolTipManager.  I have no problem getting a refernce to the user control contaiining these 10 RadTooltips.

Can you please help.

Regards
Rick
Petio Petkov
Telerik team
 answered on 29 Jul 2010
2 answers
52 views
Hi all,

I have a SharePoint page-layout with mutiple RadHTMLField controls on a single page.

We are running SharePoint in muti-label mode. So have have multiple site collections running on a single farm.
Currently the ConfigFile.xml is selectedbased on site collection GUID.
ConfigFile{collectionGuid}.xml and this is working fine all the "sites" get there own toolbars.

But I want more.
I want for the second contorle on the same page a different toolbar.
The second field is not a FullHTML field so It should only have the text options like, Bold Italic etc. (kinda like this edit form)
and no images / tables nothing fancy.

How can I accomplish to have two RadHTMLField controls but both with different tool bars ?

PS De versions where are running on the server are:
RadEditorMOSS_5_8_0_Dev.zip & Telerik.Web.UI_2010_2_713_Dev.msi
Willem Kip
Top achievements
Rank 1
 answered on 29 Jul 2010
4 answers
159 views
<telerik:RadComboBox ID="radComboCustomer" Skin="Sunset" runat="server" Width="50%"
     CssClass="ComboBox" OnClientSelectedIndexChanged="setSelectedCustomerData" EnableLoadOnDemand="true"
   OnItemsRequested="radComboCustomer_ItemsRequested" ShowMoreResultsBox="true"
      EnableVirtualScrolling="true"></telerik:RadComboBox>


 protected void radComboCustomer_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
    {
        MIDAS.DAL.CompanyFactory objCustomerFactory = new MIDAS.DAL.CompanyFactory(SessionScope.FactoryScope);

        CompanyCollection allCustomer = new CompanyCollection();
        ICriteria criteria = objCustomerFactory.GetBasicCriteria();
        List<ICriterion> filters = new List<ICriterion>();
       

        if (!string.IsNullOrEmpty(e.Text))
        {
            filters.Add(Restrictions.Like("CompanyName", e.Text, MatchMode.Start));
        }

        
        foreach (ICriterion filter in filters)
        {
            criteria.Add(filter);
        }

        allCustomer = objCustomerFactory.GetAll(criteria, "CompanyName ASC");


        int itemOffset = e.NumberOfItems;
        int endOffset = Math.Min(itemOffset + 10, allCustomer.Count);
        e.EndOfItems = endOffset == allCustomer.Count;

        for (int i = itemOffset; i < endOffset; i++)
        {            
            radComboCustomer.Items.Add(new RadComboBoxItem(allCustomer[i].CompanyName.ToString()  ,                              
            allCustomer[i].CompanyId.ToString()));
        }

        e.Message = GetStatusMessage(endOffset, allCustomer.Count);
    }

 private static string GetStatusMessage(int offset, int total)
    {
        if (total <= 0)
            return "No matches";

        return String.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", offset, total);
    }


When match mode is with MatchMode.Start then records are displyaing with search and all but when MatchMode.Anywhere
which is property of Nhibernate then records are coming from db and are assigning to Radcombo by RadComboBoxItem
property but i cant see the records in combo.But i can see count properly.
But it works fine with MatchMode.Start 



Simon
Telerik team
 answered on 29 Jul 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?