Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
316 views
I have a screen with a radgird that has a master table and a detail table.  When I Expand a record that has no detail information the grid expands and shows No Child Record To Display, but when I click on a record that has detail information nothin happens.

<telerik:RadGrid ID="RadGrid1" runat="server" Skin="Office2007" AllowPaging="True" EnableLinqExpressions="false" AllowCustomPaging="true" AutoGenerateColumns="False" GridLines="None" AllowSorting="true" AllowFilteringByColumn="false" AlternatingItemStyle-BackColor="#eeeeee" ShowGroupPanel="False" ShowStatusBar="True" OnNeedDataSource="RadGrid1_NeedDataSource"                                  OnPreRender="RadGrid1_PreRender" OnDetailTableDataBind="HistoryDetail_NeedDataSource">
             <AlternatingItemStyle BackColor="#EEEEEE"></AlternatingItemStyle>
             <MasterTableView DataKeyNames="MarketingID"  PagerStyle-Mode="NextPrevNumericAndAdvanced" >
                    <GroupByExpressions>
                            <telerik:GridGroupByExpression>
                                   <SelectFields>
                                            <telerik:GridGroupByField FieldAlias="ClientName" HeaderText="Client" FieldName="ClientName"
                                                     HeaderValueSeparator=" : "></telerik:GridGroupByField>
                                   </SelectFields>
                      <GroupByFields>
                          <telerik:GridGroupByField FieldName="ClientName" HeaderText="Client" SortOrder="Ascending">
                          </telerik:GridGroupByField>
                      </GroupByFields>
                   </telerik:GridGroupByExpression>
              </GroupByExpressions>
              <RowIndicatorColumn>
                 <HeaderStyle Width="20px"></HeaderStyle>
               </RowIndicatorColumn>
               <ExpandCollapseColumn>
                     <HeaderStyle Width="20px"></HeaderStyle>
               </ExpandCollapseColumn>
                    <Columns>
                           <telerik:GridBoundColumn DataField="MarketingID" HeaderText="MarketingID" SortExpression="MarketingID"  UniqueName="MarketingID" Visible="false">
                           </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ClientID" UniqueName="ClientID" Visible="false">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="MarketingFormattedID" HeaderText="Marketing ID"
                                       ItemStyle-Width="85" SortExpression="MarketingFormattedID" UniqueName="MarketingFormattedID"
                                        Visible="true" ItemStyle-VerticalAlign="Top">
                             </telerik:GridBoundColumn>
                             <telerik:GridBoundColumn DataField="MarketingTypeName" HeaderText="Marketing Type"
                                              ItemStyle-VerticalAlign="Top" SortExpression="" AllowSorting="false"  UniqueName="MarketingTypeName"        Visible="true">
                             </telerik:GridBoundColumn>
                   </Columns>
                  <PagerStyle Mode="NextPrevNumericAndAdvanced"></PagerStyle>
                                          
                  <DetailTables>
                       <telerik:GridTableView DataKeyNames="MarketingID"  runat="server"  >
                             <ParentTableRelation>
                                     <telerik:GridRelationFields DetailKeyField="MarketingID" MasterKeyField="MarketingID" />
                             </ParentTableRelation>
                             <Columns>
                                    <telerik:GridBoundColumn HeaderText="Status"  DataField="MarketingStatusTypeName" UniqueName="MarketingStatusTypeName">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn  HeaderText="Changed By"  DataField="ChangedBy" UniqueName="ChangedBy">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn HeaderText="Date Changed"  DataField="DateChanged" UniqueName="DateChanged">
                                    </telerik:GridBoundColumn>
                        </Columns>                                                
              </telerik:GridTableView>
         </DetailTables>
      </MasterTableView>
     <ClientSettings AllowDragToGroup="True">
          <Selecting AllowRowSelect="True" />
     </ClientSettings>
     <FilterMenu Skin="Office2007" EnableTheming="True">
          <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
     </FilterMenu>
  </telerik:RadGrid>

and here is the OnDetailTableDataBind Code
protected void HistoryDetail_NeedDataSource(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
        {
  
            GridDataItem dataItem = e.DetailTableView.ParentItem;
  
            ClientDataContext db = new ClientDataContext();
            var query = from m in db.MarketingStatusChangeLogs
                        where (m.MarketingID == int.Parse(dataItem.GetDataKeyValue("MarketingID").ToString()))
                        select new
                        {
                            m.MarketingStatusType.MarketingStatusTypeName,
                            m.ChangedBy,
                            m.DateChanged
                        };
            e.DetailTableView.DataSource = query;
        }


am I missing something?
Angel Petrov
Telerik team
 answered on 29 Sep 2012
3 answers
230 views
Hi,

I am using RadSplitter , RadSplitBar and RadPane in one of my project, I have design my page like
<RadSplitter > 
    <RadPane1 > </RadPane1 > 
    <RadSplitBar CollapseMode="Both"> </RadSplitBar >
     <RadPane2> </RadPane2>
</RadSplitter >

 

I kept my RadSplitBar  at middle but when I try to perform any action on RadSplitBar its not persisting the position, first its going to down and when I perform the action then again its comming to middle

but I need to Keep my RadSplitBar  at Fixed location that is on middle of page even if i perfrom any action over it(expand / collpase)

Can anyone suggest any solution for this

Vessy
Telerik team
 answered on 29 Sep 2012
2 answers
68 views
hi
I have RadAjaxPanel and a RadComboBox in it.

and I use a RadAjaxLoadingPanel to display server dealy in comboBox reload.

(I handle most of ComboBox events with javascript.)

I have 2 problems :

1- After that LoadingPanel is shown, page refresh or any event that cause postback lead to this alert :

    "Unable to get value of the property 'focus': the object is null or undefined"

    this massege is not in my code and if I delete RadAjaxLoadingPanel (and not show loadingPanel) everything is normal.

2- After that LoadingPanel is shown, the ComboBox shape is alterd and be a little ugly. why?

thanks
Fatima
Top achievements
Rank 1
 answered on 29 Sep 2012
2 answers
30 views
Hi everyone!

I used a RadAjaxLoadingPanel in my web page. In addition I have a RadComboBox within a RadAjaxPanel that during its post-back, LoadingPanel must be shown.

Everything work correct at first. But if I repeat page post-back for second, it isn't shown. But at third times it will work correctly.

I means that it works sometimes well but sometimes not.

What is its problem??

Thanks
Fatima
Top achievements
Rank 1
 answered on 29 Sep 2012
4 answers
83 views
I have a tab strip paired with a multi-page control, latest release for 2012.

Sometimes the content accessed via ContentURL is larger than the size of the PageView page.

This triggers scroll bars.

I have set scrollbars on the parent multi-page to "none" and also on the particular page view container itself.

Neither of these settings suppress the scroll bars.

How to do I get rid of them?

I want the excess content in the URL to be clipped.
Chad Hensley
Top achievements
Rank 1
 answered on 29 Sep 2012
1 answer
48 views
This isn't so much a RadControls question but I'm not sure if there is anything special in the RadGrid which will help here, and other RadGrid developers might find this helpful, so....

I have a huge grid that's about 1600px wide, and can contain around 1000 rows which the user does not want to page.

When displayed in the browser we get both horizontal and vertical scrolls for the browser.
To allow for a fixed header I have to assign a height to the grid. That height is 800px but needs to be smaller.
What's happening is that the user needs to scroll the browser to find the bottom of the grid, then browser horizontally to find the right margin of the grid, then scroll the grid vertically.

We have two sets of scrollbars, and that's just a pain.

1) I'm wondering if we can fix a grid header on a page without setting the height. The effect being that the browser scroll would reveal more rows but the grid header would float in-place. I doubt this is possible now but it might be a valid enhancement for RadGrid in the future.

2) (The real question here) What's the best way to give users easier access to a huge grid like this? I'm thinking about eliminating the scrollbars on the browser so that the user only sees the scrollbars on the grid. I would need to check the height of the browser visible area and adjust the grid height dynamically so that the grid horizontal scroll is always at the bottom.

3) Is there any way to scroll a grid horizontally or vertically with a mechanism other than the traditional hscroll and vscroll at the bottom and right of the control? What about floating scrollbars or a similar mechanism within the current window? I could put the grid in a smaller viewport, but the user wants to see as much data as possible (ergo no paging) and a huge number of columns rather than a hierarchical grid, a secondary grid, or popups.

4) Does anyone already have code to share for #2, to remove browser scrollbars and dynamically set the size of the grid? The problem here is that every browser is different - I'm hoping jQuery will help.

5) Any other ideas on elegant ways to render this amount of data?

Thanks!
TonyG
Top achievements
Rank 1
 answered on 28 Sep 2012
2 answers
181 views
I have an app that dynamically loads several different user controls into a Panel control defined in a content page.  This Panel control is registered in the AjaxSettings property of the RADAjaxManager defined in my Master page.  I followed the examples on the Telerik website.

Inside one of these user controls (SearchName), is a RadTextBox (NameTextBox). If I reference that user control/textbox from the content page via,

nameTextBox = $find(

 

'<%= SearchName.FindControl("NameTextBox").ClientID %>');

 


...everything is fine.  I can even add a "add_keyPress" method to that textbox variable.

The problem arises when I try to move this textbox reference from the content page to within the user control via,

nameTextBox = $('#NameTextBox');

...and leave the variable itself (nameTextBox), defined in the content page as a global variable (I need to do things with it there). I'm trying to encapsulate as much as possible within the user control.

For some reason, after the user contol is loaded...the "nameTextBox" variable within the content page no longer has any of the Telerik methods defined within it, e.g. add_keyPress. I get an "Object doesn't support this property or method" error when I try to add this method to the textbox variable, e.g.

nameTextBox.add_keyPress(nameTextBox_KeyPress);

It almost seems like this textbox object is the ASP textbox control...and not the RAD textbox control???  Any help would be appreciated.

David
Top achievements
Rank 1
 answered on 28 Sep 2012
2 answers
128 views
Good morning, how do I modify the properties of a

<telerik: GridButtonColumn in my code behind?


appears when the grid <telerik: GridButtonColumn will be invisible,
however when I push the button to make visible the iré <telerik: GridButtonColumn ...

how can I perform this process?
Jhon
Top achievements
Rank 1
 answered on 28 Sep 2012
4 answers
195 views
I'm working on a pie chart that is close to working as expected - just not quite.  My problems revolve around the labels - something that a lot of people seem to struggle with.  In my case, it's the connectors.

I have three images attached, showing the same data with a few different settings for the pie:

DefaultPie is basically what i want to see, and i haven't tweaked the rotations or scales very much.  Note how the connectors are overlapping at the top.  Why are some of the labels being placed out of order?  This would be totally fine, provided that the top five items weren't in a bizarre order.

The other two images are the same data with rotations and scales applied to try to improve the display.  To no avail.  In all cases, the connectors end up crossing.  In the best case scenario, i might have one bizarrely placed label, and in the worst case, there might be five or six of them placed willy nilly.

What might i do here to fix this?

Here's the code i'm using for my chart (minus the individual series items, which i'm not making any appearance changes to):
this.Chart.DefaultType = ChartSeriesType.Pie;
this.Chart.IntelligentLabelsEnabled = true;
this.Chart.ChartTitle.Visible = false;
this.Chart.Legend.Visible = false;
this.Chart.PlotArea.Appearance.Dimensions.Margins = new Telerik.Charting.Styles.ChartMargins(0, 0, 0, 0);
 
ChartSeries seriesPrimary = new ChartSeries();
    seriesPrimary.Type = ChartSeriesType.Pie;
    seriesPrimary.Appearance.ShowLabelConnectors = true;
    seriesPrimary.Appearance.LabelAppearance.LabelConnectorStyle.Color = System.Drawing.Color.White;
                 
this.Chart.Series.Add(seriesPrimary);

Petar Kirov
Telerik team
 answered on 28 Sep 2012
1 answer
87 views
Hi,

I am very new to all of this I have seen a few examples of doing this but can't seem to get it to work. I have seen some about using CSS and some of using code. Just wanted to know which is better? I would like to use CSS. So here is what I got I have a RadScheduler with custom resources not sure that is what it is called. I have Therapists, Patients and Status. What I want to do is change the color of the appointment when the status is changed. Can you please provide me with what code I need to implement and maybe a sample of what the CSS should look like. thanks here is my code.
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="STSchedule.aspx.vb" Inherits="ScheduleUser_STSchedule" %>
 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
    <link href="../Styles.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    .style3
    {
        width: 165px;
        height: 120px;
    }
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">
    </telerik:RadStyleSheetManager>
    <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:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    <div id="content-container1">
    <div id="content-container2">
            <div id="section-navigation">
                <img alt="h2t" class="style3" src="../Pics/logoh2t.png" />
                <telerik:RadTabStrip ID="RadTabStrip1" runat="server" Skin="Transparent"
                    Width="161px" SelectedIndex="2" >
                <Tabs>
                    <telerik:RadTab runat="server" Text="PT"
                        NavigateUrl="~/ScheduleUser/PTSchedule.aspx">
                    </telerik:RadTab>
                    <telerik:RadTab runat="server" Text="OT"
                        NavigateUrl="~/ScheduleUser/OTSchedule.aspx">
                    </telerik:RadTab>
                    <telerik:RadTab runat="server" Text="ST" Selected="True"
                        NavigateUrl="~/ScheduleUser/STSchedule.aspx">
                    </telerik:RadTab>
                    <telerik:RadTab runat="server" Text="MT"
                        NavigateUrl="~/ScheduleUser/MTSchedule.aspx">
                    </telerik:RadTab>
                     <telerik:RadTab runat="server" Text="Patients"
                        NavigateUrl="~/ScheduleUser/Schedule.aspx">
                    </telerik:RadTab>
                </Tabs>
            </telerik:RadTabStrip>
                <asp:ListBox ID="ListBox1" runat="server" BackColor="#99CCFF"
                    DataSourceID="SqlDataSource6" DataTextField="TherapistName"
                    DataValueField="EmployeeID" Rows="30" Width="161px" AutoPostBack="True"></asp:ListBox>
                <asp:SqlDataSource ID="SqlDataSource6" runat="server"
                    ConnectionString="<%$ ConnectionStrings:H2T2SQLConnectionString %>" SelectCommand="SELECT        EmployeeID, TherapistFirstName, TherapistLastName, Occupation, TherapistLastName + ' ' + TherapistFirstName + ' ' + Occupation AS TherapistName
FROM            Therapist
WHERE        (Occupation = N'SLP') OR
                         (Occupation = N'SLPA')
ORDER BY TherapistLastName"></asp:SqlDataSource>
</div>
<div id="content">
     
    <telerik:RadScheduler ID="RadScheduler1" runat="server" Skin="Vista" DataEndField="EndTime"
        DataKeyField="ApptID" DataSourceID="SqlDataSource1" DataStartField="StartTime"
        DataSubjectField="Subject" DayEndTime="21:00:00"
        DisplayRecurrenceActionDialogOnMove="True" Height="700px"
        SelectedView="WeekView" ShowAllDayRow="False"
        ShowFooter="False" TimeZoneID="US Mountain Standard Time"
        TimeZoneOffset="-07:00:00" WorkDayEndTime="18:00:00"
        DataDescriptionField="Description"
        EnableDescriptionField="True" DataRecurrenceField="Recurrence"
    DataRecurrenceParentKeyField="RecurrencePartentID"
    DataReminderField="Reminder" style="margin-left: 3px"
        HoursPanelTimeFormat="htt" TimeLabelRowSpan="1">
        <ResourceTypes>
            <telerik:ResourceType DataSourceID="SqlDataSource2" ForeignKeyField="PatientID"
                KeyField="PatientID" Name="Patient" TextField="PatientName" />
            <telerik:ResourceType DataSourceID="SqlDataSource5" ForeignKeyField="StatusID"
                KeyField="ReasonID" Name="Status" TextField="Appointment" />
            <telerik:ResourceType DataSourceID="SqlDataSource7"
                ForeignKeyField="TherapistID" KeyField="EmployeeID" Name="Theraist"
                TextField="TherapistName" />
        </ResourceTypes>
        <AppointmentTemplate>
        <div class="AppointmentTemplate <%# Eval("Status.Text") %>">
            <h4><%# Eval("Subject") %></h4>
        </div>
        </AppointmentTemplate>
        <Localization HeaderTimeline="All Therapist " HeaderToday="Today" />
        <TimelineView GroupBy="Therapist"
            GroupingDirection="Vertical" />
        <MultiDayView ShowHoursColumn="False" />
        <Reminders Enabled="True" />
    </telerik:RadScheduler>
    </div>
             
             
             
    </div>
    </div>
   
   
    <asp:SqlDataSource ID="SqlDataSource5" runat="server"
        ConnectionString="<%$ ConnectionStrings:H2T2SQLConnectionString %>"
        SelectCommand="SELECT [Appointment], [ReasonID] FROM [StatusInfo]">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
        ConnectionString="<%$ ConnectionStrings:Insurance InfoConnectionString1 %>"
         
        SelectCommand="SELECT ApptID, RecurrencePartentID, PatientID, TherapistID, StatusID, TimeZoneID, StartTime, EndTime, Subject, Description, Reminder, Recurrence, LastModified FROM Schedule WHERE (TherapistID = @TherapistID)"
        DeleteCommand="DELETE FROM [Schedule] WHERE [ApptID] = @ApptID"
        InsertCommand="INSERT INTO [Schedule] ([RecurrencePartentID], [PatientID], [TherapistID], [StatusID], [TimeZoneID], [StartTime], [EndTime], [Subject], [Description], [Reminder], [Recurrence], [LastModified]) VALUES (@RecurrencePartentID, @PatientID, @TherapistID, @StatusID, @TimeZoneID, @StartTime, @EndTime, @Subject, @Description, @Reminder, @Recurrence, @LastModified)"
         
         
     
     
         
        UpdateCommand="UPDATE [Schedule] SET [RecurrencePartentID] = @RecurrencePartentID, [PatientID] = @PatientID, [TherapistID] = @TherapistID, [StatusID] = @StatusID, [TimeZoneID] = @TimeZoneID, [StartTime] = @StartTime, [EndTime] = @EndTime, [Subject] = @Subject, [Description] = @Description, [Reminder] = @Reminder, [Recurrence] = @Recurrence, [LastModified] = @LastModified WHERE [ApptID] = @ApptID">
        <DeleteParameters>
            <asp:Parameter Name="ApptID" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="RecurrencePartentID" Type="Int32" />
            <asp:Parameter Name="PatientID" Type="Int32" />
            <asp:Parameter Name="TherapistID" Type="Int32" />
            <asp:Parameter Name="StatusID" Type="Int32" />
            <asp:Parameter Name="TimeZoneID" Type="String" />
            <asp:Parameter Name="StartTime" Type="DateTime" />
            <asp:Parameter Name="EndTime" Type="DateTime" />
            <asp:Parameter Name="Subject" Type="String" />
            <asp:Parameter Name="Description" Type="String" />
            <asp:Parameter Name="Reminder" Type="String" />
            <asp:Parameter Name="Recurrence" Type="String" />
            <asp:Parameter Name="LastModified" Type="String" />
        </InsertParameters>
        <SelectParameters>
            <asp:ControlParameter ControlID="ListBox1" Name="TherapistID"
                PropertyName="SelectedValue" Type="Int32" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="RecurrencePartentID" Type="Int32" />
            <asp:Parameter Name="PatientID" Type="Int32" />
            <asp:Parameter Name="TherapistID" Type="Int32" />
            <asp:Parameter Name="StatusID" Type="Int32" />
            <asp:Parameter Name="TimeZoneID" Type="String" />
            <asp:Parameter Name="StartTime" Type="DateTime" />
            <asp:Parameter Name="EndTime" Type="DateTime" />
            <asp:Parameter Name="Subject" Type="String" />
            <asp:Parameter Name="Description" Type="String" />
            <asp:Parameter Name="Reminder" Type="String" />
            <asp:Parameter Name="Recurrence" Type="String" />
            <asp:Parameter Name="LastModified" Type="String" />
            <asp:Parameter Name="ApptID" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server"
        ConnectionString="<%$ ConnectionStrings:H2T2SQLConnectionString %>"
         
        SelectCommand="SELECT PatientID, PatientFirstName, PatientLastName, PatientDOB, PatientLastName + ' ' + PatientFirstName AS PatientName FROM Patients ORDER BY PatientLastName">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource3" runat="server"
        ConnectionString="<%$ ConnectionStrings:H2T2SQLConnectionString %>"
         
         
        SelectCommand="SELECT EmployeeID, TherapistFirstName, TherapistLastName, Occupation, TherapistLastName + ' ' + TherapistFirstName + ' ' + Occupation AS TherapistName FROM Therapist WHERE (Occupation = N'SLP') OR (Occupation = N'SLPA') ORDER BY TherapistLastName">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource7" runat="server"
        ConnectionString="<%$ ConnectionStrings:H2T2SQLConnectionString %>"
        SelectCommand="SELECT EmployeeID, TherapistFirstName + ' ' + TherapistLastName AS TherapistName FROM Therapist WHERE (EmployeeID = @EmployeeID)">
        <SelectParameters>
            <asp:ControlParameter ControlID="ListBox1" DefaultValue="32" Name="EmployeeID"
                PropertyName="SelectedValue" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource4" runat="server"
        ConnectionString="<%$ ConnectionStrings:H2T2SQLConnectionString %>"
        SelectCommand="SELECT Appointment FROM StatusInfo WHERE (NOT (Appointment IS NULL))">
    </asp:SqlDataSource>
</asp:Content>
Boyan Dimitrov
Telerik team
 answered on 28 Sep 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?