Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
137 views
I have an application that has a RadPageView embedded with a RadGrid. I would like the webpage to pop up a radwindow when user click a row on the Radgrid. In the Radwindow, I would like to show data in a Datalist. Somehow, the Radwindow opens with no data in it.

I am trying to do the similar to this sample: http://demos.telerik.com/aspnet-ajax/window/examples/internalcontent/defaultcs.aspx . The difference is I would like the radwindow to pop up in stead of showing in the beginning. Also, I would like to use the Datalist to format the data more flexibly than the Dataview.

Please help. Thanks in advance!

<telerik:RadPageView ID="RadPageView2" runat="server">
            <br />
            <div>     
                <asp:HiddenField ID="HiddenField1" Value="50125" runat="server" />
                 
                <telerik:RadGrid ID="RadGridClaimPayments" runat="server" AutoGenerateColumns="false" Skin="Office2007" Width="98%"
                    EnableViewState="true"  AutoGenerateHierarchy="false" OnDetailTableDataBind="RadGridClaimPayments_DetailTableDataBind" 
                    DataKeyNames="CheckNo">
                    <clientsettings AllowKeyboardNavigation="true" EnablePostBackOnRowClick="true" >
                        <Scrolling AllowScroll="false" ScrollHeight="300px" UseStaticHeaders="false" />
                        <Selecting AllowRowSelect="true"/>
                        <ClientEvents OnRowSelected="RadGridClaimPayments_RowSelected" />
                    </clientsettings>
                    <mastertableview datakeynames="CheckNo" Name="CheckInfo" EnableViewState="true" ClientDataKeyNames="CheckNo" >
                        <Columns>
                            <telerik:GridBoundColumn DataField="TranYear" HeaderText="TranYear" ItemStyle-HorizontalAlign="Left"
                                ReadOnly="True" SortExpression="TranYear"  Visible="false"/>
                            <telerik:GridBoundColumn DataField="crdate" HeaderText="Check Date" ItemStyle-HorizontalAlign="Left"
                                ReadOnly="True" SortExpression="crdate" DataFormatString="{0:MM/dd/yyyy}" />
                            <telerik:GridBoundColumn DataField="CheckNo" HeaderText="Check No" ItemStyle-HorizontalAlign="Left"
                                ReadOnly="True" SortExpression="CheckNo" />
                            <telerik:GridBoundColumn DataField="amount" HeaderText="Check Amount" ItemStyle-HorizontalAlign="Left"
                                ReadOnly="True" SortExpression="amount" DataFormatString="{0:C}" />
                            <telerik:GridBoundColumn DataField="Status" HeaderText="Status" ItemStyle-HorizontalAlign="Left"
                                ReadOnly="True" SortExpression="Status" Visible="false" />
                            <telerik:GridBoundColumn DataField="payment" HeaderText="Check Description" ItemStyle-HorizontalAlign="Left"
                                ReadOnly="True" SortExpression="payment" />
                            <telerik:GridBoundColumn DataField="claimno" HeaderText="Claim No." ItemStyle-HorizontalAlign="Center"
                                ReadOnly="True" SortExpression="claimno" Visible="false" />
                            <telerik:GridBoundColumn DataField="lossdate" HeaderText="Loss Date" ItemStyle-HorizontalAlign="Left"
                                ReadOnly="True" SortExpression="lossdate" DataFormatString="{0:MM/dd/yyyy}" Visible="false" />
                            <telerik:GridBoundColumn DataField="reporteddate" HeaderText="Report Date" ItemStyle-HorizontalAlign="Left"
                                ReadOnly="True" SortExpression="reporteddate" DataFormatString="{0:MM/dd/yyyy}"
                                Visible="false" />
                            <telerik:GridBoundColumn DataField="Adjuster" HeaderText="Adjuster" ItemStyle-HorizontalAlign="Left"
                                ReadOnly="True" SortExpression="Adjuster" Visible="false" />
                            <telerik:GridBoundColumn DataField="OutstandingRes" HeaderText="Outstanding Res"
                                ItemStyle-HorizontalAlign="Left" ReadOnly="True" SortExpression="OutstandingRes"
                                DataFormatString="{0:C}" Visible="false" />
                        </Columns>
                        <GroupByExpressions>
                            <telerik:GridGroupByExpression>
                                <GroupByFields>
                                    <telerik:GridGroupByField FieldName="TranYear" HeaderText="Year" />
                                </GroupByFields>
                                <SelectFields>
                                    <telerik:GridGroupByField FieldName="TranYear" HeaderText="Year" />
                                </SelectFields>
                            </telerik:GridGroupByExpression>
                        </GroupByExpressions>
                        <detailtables >
                            <telerik:GridTableView runat="server" Name="CheckDetails" HierarchyLoadMode="ServerOnDemand" >
                                <ParentTableRelation>
                                 <telerik:GridRelationFields
                                    DetailKeyField="CheckNo"
                                    MasterKeyField="CheckNo" />
                                </ParentTableRelation>
                                <Columns>
                                    <telerik:GridBoundColumn DataField="CheckNo" HeaderText="Check No" ItemStyle-HorizontalAlign="Left"
                                        ReadOnly="True" SortExpression="CheckNo" Visible="false"/>
                                    <telerik:GridBoundColumn DataField="checkgroup" HeaderText="Check Type" ItemStyle-HorizontalAlign="Left"
                                        ReadOnly="True" SortExpression="checkgroup"/>                                   
                                    <telerik:GridBoundColumn DataField="lossdate" HeaderText="Loss Date" ItemStyle-HorizontalAlign="Left"
                                        ReadOnly="True" SortExpression="lossdate" DataFormatString="{0:MM/dd/yyyy}" />                                   
                                    <telerik:GridBoundColumn DataField="insuredprimary" HeaderText="Insured" ItemStyle-HorizontalAlign="Left"
                                        ReadOnly="True" SortExpression="Insured" />
                                    <telerik:GridBoundColumn DataField="claimant" HeaderText="Claimant" ItemStyle-HorizontalAlign="Left"
                                        ReadOnly="True" SortExpression="claimant" />
                                    <telerik:GridBoundColumn DataField="companyname1" HeaderText="Insolvent Company" ItemStyle-HorizontalAlign="Left"
                                        ReadOnly="True" SortExpression="companyname1" />
                                    <telerik:GridBoundColumn DataField="claimno" HeaderText="Claimno" ItemStyle-HorizontalAlign="Left"
                                        ReadOnly="True" SortExpression="claimno" />
                                    <telerik:GridBoundColumn DataField="policyno" HeaderText="Policy Number" ItemStyle-HorizontalAlign="Left"
                                        ReadOnly="True" SortExpression="policyno" />
                                    <telerik:GridBoundColumn DataField="issuedt" HeaderText="Date Issued" ItemStyle-HorizontalAlign="Left"
                                        ReadOnly="True" SortExpression="issuedate" DataFormatString="{0:MM/dd/yyyy}" Visible="false"/>
                                    <telerik:GridBoundColumn DataField="payeeidno" HeaderText="IRS NO" ItemStyle-HorizontalAlign="Left"
                                        ReadOnly="True" SortExpression="IRSNO" />
                                    <telerik:GridBoundColumn DataField="checkamount" HeaderText="Amount" ItemStyle-HorizontalAlign="Left"
                                        ReadOnly="True" SortExpression="amount" DataFormatString="{0:C}" />
                                    <telerik:GridBoundColumn DataField="amounttext" HeaderText="Comments" ItemStyle-HorizontalAlign="Left"
                                        ReadOnly="True" SortExpression="amounttext" />                                   
                                    <telerik:GridBoundColumn DataField="mailtoname1" HeaderText="Address" ItemStyle-HorizontalAlign="Left"
                                        ReadOnly="True" SortExpression="mailtoname1" />
                                    <telerik:GridBoundColumn DataField="mailtoname2" HeaderText="Address1" ItemStyle-HorizontalAlign="Left"
                                        ReadOnly="True" SortExpression="mailtoname2" />
                                    <telerik:GridBoundColumn DataField="mailtoaddr1" HeaderText="Address3" ItemStyle-HorizontalAlign="Left"
                                        ReadOnly="True" SortExpression="mailtoaddr1" />
                                </Columns>
                            </telerik:GridTableView>
                        </detailtables>
                    </mastertableview>
                </telerik:RadGrid>
 
                 
                <telerik:RadWindow ID="CheckImageRadWin" runat="server" Title="Check Image Window" Width="900"
                    Height="536" VisibleOnPageLoad="false" Behaviors ="Minimize, Move, Resize, Maximize,Close"
                        OffsetElementID="RadGridClaimPayments" Left="140" Top="50" EnableShadow="true"  >
                    <ContentTemplate>
 
                        <div style="text-align: center; border-bottom-width: 8px;">
                            Check No: <asp:Label ID="lblcheckno" Runat="server" Visible="true"></asp:Label>
                             
                            <asp:Datalist ID="dlCheckImageInfo" runat="server" ShowHeader="true" Font-Size="Small"
                                BorderColor="black" CellPadding="3" GridLines="Both" DataSourceID="SqlDataSource1">
                                <HeaderTemplate>
                                    <table>
                                </HeaderTemplate>
                                <ItemTemplate>                                   
                                        <tr>
                                            <td colspan="2" rowspan="6">
                                            </td>
                                            <td>
                                                INSURED
                                            </td>
                                            <td>
                                                CLAIM NUMBER
                                            </td>                  
                                        </tr>
                                        <tr>
                                             <td>
                                                <%# DataBinder.Eval(Container.DataItem, "insuredprimary")%>
                                            </td>
 
                                            <td>
                                                <%# DataBinder.Eval(Container.DataItem, "claimno")%>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                CLAIMANT
                                            </td>
                                            <td>
                                                POLICY NUMBER
                                            </td>
                     
                                        </tr>
                                        <tr>
                                            <td>
                                                <%# DataBinder.Eval(Container.DataItem, "claimant")%>
                                            </td>
                                            <td>
                                                <%# DataBinder.Eval(Container.DataItem, "policyno")%>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                INSOLVENT COMPANY
                                            </td>
                                            <td>
                                                DATE ISSUED
                                            </td>                   
                                        </tr>
                                        <tr>
                                           <td>
                                                <%# DataBinder.Eval(Container.DataItem, "companyname1")%>
                                            </td>
                                            <td>
                                                <%# DataBinder.Eval(Container.DataItem, "issuedate")%>
                                            </td>
                                        </tr>
 
                                        <tr>
                                            <td>
                                                CHECK TYPE
                                            </td>
                                            <td>
                                                DATE OF LOSS
                                            </td
                                            <td>
                                                IN PAYMENT OF
                                            </td>
                                            <td>
                                                IRS NO
                                            </td>                   
                                        </tr>
                                        <tr>
                                            <td>
                                                <%# DataBinder.Eval(Container.DataItem, "checkgroup")%>
                                            </td>
                                            <td>
                                                <%# DataBinder.Eval(Container.DataItem, "lossdate")%>
                                            </td>
                                           <td>
                         
                                            </td>
                                            <td>
                                                <%# DataBinder.Eval(Container.DataItem, "payeeidno")%>
                                            </td>
                                        </tr>
 
                                        <tr>
                                            <td colspan="3" rowspan="2">
                                                <%# DataBinder.Eval(Container.DataItem, "amounttext")%>
                                            </td>
                                            <td>
                                                AMOUNT
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <%# DataBinder.Eval(Container.DataItem, "amount")%>
                                            </td>
                                        </tr>
                                    </table>
                                </ItemTemplate>
                                <FooterTemplate>
                                    </table>
                                </FooterTemplate>
                            </asp:Datalist>
                        </div>
                       <asp:ObjectDataSource  DataSourceMode="DataReader"
                            ID="SqlDataSource1"
                            runat="server"                   
                            SelectCommand = "spu_payment_checkprint_cfp_web"
                            SelectCommandType = "StoredProcedure"
                            ConnectionString ="<%$ ConnectionStrings:SiteSqlServer" %>">   
                            <SelectParameters>
                                <asp:ControlParameter Name="CheckNo" ControlID="RadGridClaimPayments" PropertyName="SelectedValue" Type="String" />
                            </SelectParameters>
                        </asp:ObjectDataSource>
                         
                    </ContentTemplate>
                </telerik:RadWindow>
            </div>
        </telerik:RadPageView>
Genti
Telerik team
 answered on 15 Jul 2011
1 answer
66 views
The Telerik controls do not work in Visual Studio 2010 if they are installed to a directory other than the default.

Here is what I did:

1. Uninstalled Telerik RadControls for ASP.NET AJAX (2011.1.519) using Control Panel

2. Installed Telerik RadControls for ASP.NET AJAX (2011.2.712) to a custom folder ("C:\Program Files (x86)\Telerik\RadControls for ASP.NET AJAX")

3. Ran Microsoft Visual Studio 2010 Professional

The Telerik controls appear in the VS Toolbox but won't work. They won't render in design view and you can't drag and drop a control onto an ASPX page (nothing happens).

To work around I had to uninstall the controls and then reinstall them to the default location ("C:\Program Files (x86)\Telerik\RadControls for ASP.NET AJAX Q2 2011").

Is there an easy way to install the controls to a directory other than the default?
Petar
Telerik team
 answered on 15 Jul 2011
1 answer
154 views
Good Afternoon,

I had a general question concerning RadListBox scroll positions after a RadAjaxManager update.

The scenario is as follows:

I have a radtreeview that holds product categories and product names
I have a radlistbox that holds Image Logos that can be assigned to each product.

When a person clicks on a node in the product tree I grab a LogoID from the node (if one exists) and then search my RadListBox of logos to see if I can match up the ID. If I find the appropriate LogoID in my RadListBox of Logos I set the SelectedIndex to the position in the RadListBox of the appropriate Logo.

This all works fine. I added a RadAjaxManager so that when you select a RadTreeNode it tells the RadListBox to update itself so the new selection is shown on the appropriate logo image. Problem is everytime I do this even if the Listbox is already scrolled half way down the list for example it will always place the scroll position back to the top to the first Logo. If I remove the RadAjaxManager entry to update the RadListBox it stays at it's current scroll position of course because nothing has updated it (AutoPostBack is off on the ListBox, turning it on does nothing in this case).

I think this is also affecting my ability to scrollIntoView the selected item as it is always forcing it back to the top of the list. Any ideas why this is happening? I had assumed telling RadAjaxManager to update the RadListbox when a treenode is selected would have just highlighted in position.

Thanks,

Chris Eisnaugle
Genady Sergeev
Telerik team
 answered on 15 Jul 2011
1 answer
205 views
Hi,

Here with I attached my project code and chart.

The problem is If I remove the lable code the chart is working fine but ,
If I add label code on cs file my chart is not coming up.


<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="ResourceChart.aspx.cs" Inherits="ResourceChart" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="rad" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Charting" TagPrefix="rad" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<rad:RadChart ID ="RadChart1" runat="server" Height="750px" Width ="1700px" UseSession ="false"  >
<Series>
    <rad:ChartSeries Type ="Gantt" DataYColumn="EndDate" DataYColumn2="StartDate" DataXColumn ="ResourceId" DefaultLabelValue = "#Y" >
        <Appearance>
          
           <LabelAppearance  Visible="false" />
          
        </Appearance>
        
    </rad:ChartSeries>

</Series>

 <PlotArea>
        <YAxis>
            <AxisLabel>
                <Appearance RotationAngle="360">
                </Appearance>
            </AxisLabel>
        </YAxis>
    </PlotArea>

  <ChartTitle>
        <Appearance Dimensions-Margins="1%, 1%, 1%, 1%" Position-AlignedPosition="Top">
        </Appearance>
        <TextBlock Text="ADS Resource Chart">
        </TextBlock>
    </ChartTitle>
    <Legend Appearance-ItemAppearance-Visible ="false"  >
    <Items>
       
    </Items>
        <TextBlock></TextBlock>
    </Legend>
</rad:RadChart>

 

 

 

</asp:Content>

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using NOVADS_Tracker;
using Telerik.Charting;
using System.Web.UI.HtmlControls;
using System.ComponentModel;
using System.Collections;
using DHAdmin;

public partial class ResourceChart : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        DataSet ds = ResourceList.ResourceChart_Data();

        this.RadChart1.DataSource = ds;

       
        this.RadChart1.PlotArea.YAxis.Appearance.ValueFormat = Telerik.Charting.Styles.ChartValueFormat.ShortDate;
        this.RadChart1.PlotArea.YAxis.Appearance.CustomFormat = "dd MMMM";
        this.RadChart1.PlotArea.YAxis.IsZeroBased = false;

        this.RadChart1.SeriesOrientation = Telerik.Charting.ChartSeriesOrientation.Horizontal;

        //this.RadChart1.PlotArea.XAxis.MaxItemsCount = 1;
        this.RadChart1.PlotArea.XAxis.AutoScale = false;

      
 
      
        RadChart1.PlotArea.Appearance.Dimensions.Margins.Top = 100;
        RadChart1.PrePaint += new EventHandler<EventArgs>(RadChart2_PrePaint);

 

        this.RadChart1.DataBind();

        this.RadChart1.Legend.Appearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.Right;
        for (int i = 0; i < RadChart1.Series[0].Items.Count; i++)
        {
            LabelItem lbi = new LabelItem();
            RadChart1.Legend.Items.Add(lbi);
            string mileName = ds.Tables[0].Rows[i]["MilestoneName"].ToString();
            string colorHex = ds.Tables[0].Rows[i]["ColorCode"].ToString();

            RadChart1.Legend.Items[i].TextBlock.Text = mileName;
            RadChart1.Legend.Items[i].Marker.Appearance.FillStyle.MainColor = System.Drawing.ColorTranslator.FromHtml(colorHex);
            RadChart1.Legend.Items[i].Marker.Appearance.FillStyle.SecondColor = System.Drawing.ColorTranslator.FromHtml(colorHex);
        }

 

 

 

        for (var i = 0; i < RadChart1.Series[0].Items.Count; i++)
        {
            string colorHex = ds.Tables[0].Rows[i]["ColorCode"].ToString();
            RadChart1.Series[0].Items[i].Appearance.FillStyle.MainColor = System.Drawing.ColorTranslator.FromHtml(colorHex);
            RadChart1.Series[0].Items[i].Appearance.FillStyle.SecondColor = System.Drawing.ColorTranslator.FromHtml(colorHex);

        }

 

      

        //for (int i = 0; i < RadChart1.Series[0].Items.Count;i++)
        //{
        //    RadChart1.PlotArea.XAxis[i].TextBlock.Text = ds.Tables[0].Rows[i]["ResourceName"].ToString();
        //}
       
       

 

       

        //this.RadChart1.PlotArea.XAxis.AutoScale = false;

        //List<string> lLabel = new List<string>();

        //foreach (DataRow dr in ds.Tables[0].Rows)
        //{
        //    if (!lLabel.Contains(dr["ResourceName"].ToString()))
        //        lLabel.Add(dr["ResourceName"].ToString());
        //}
       
        //RadChart1.PlotArea.XAxis.MaxItemsCount = 0;
       
       
        //RadChart1.PlotArea.XAxis.AddRange(1, lLabel.Count, 1);

        //for (int i = 0; i < lLabel.Count; i++)
        //{
        //    RadChart1.PlotArea.XAxis[i].TextBlock.Text = lLabel[i];
        //}

      

    }

    void RadChart2_PrePaint(object sender, EventArgs e)
    {

        //Double maxVal = RadChart1.PlotArea.XAxis.MaxValue;

        foreach (var item in RadChart1.PlotArea.XAxis.Items)
        {
            float x = item.Appearance.Position.X;
            float y = item.Appearance.Position.Y;

            item.Appearance.Position.Auto = false;

            item.Appearance.Position.Y = y;
            item.Appearance.Position.X = x + 620;
            //item.Appearance.Position.X = x + (float)(maxVal);
        }
    }
}

 

 


This is the small piece of code trying to get the label on right side.

Code value everything is correct but final output is not coming up with what I expected.



List<string> lLabel = new List<string>();

        foreach (DataRow dr in ds.Tables[0].Rows)
        {
            if (!lLabel.Contains(dr["ResourceName"].ToString()))
                lLabel.Add(dr["ResourceName"].ToString());
        }

        RadChart1.PlotArea.XAxis.MaxItemsCount = 0;

        RadChart1.PlotArea.XAxis.AddRange(1, lLabel.Count, 1);

        for (int i = 0; i < lLabel.Count; i++)
        {
            RadChart1.PlotArea.XAxis[i].TextBlock.Text = lLabel[i];
        }



See attached chart image files I would like to combine the both  means

Chart1.png one plotting is correct .

Chart2.png right side name is coming up correctly but chart is not correct like chart1.png.

I want chart1 chart  with lable like chart2.

please help how to fix this issue

-Dhamu

Yavor
Telerik team
 answered on 15 Jul 2011
1 answer
132 views
Hey there,

Love the new control, and looking forward to replace some rather old notification stuff we're currently using for our in-page ajax-y stuff.. Just a question: is it possible to have notifications stack so they're all visible? For example, if a notification is displayed, and say about 5 seconds later another one needs to be displayed, any way to get them to show up like the following? :

----------------------------
| Notification 2            |
----------------------------
----------------------------
| Notification 1            |
----------------------------
Sebastian
Telerik team
 answered on 15 Jul 2011
1 answer
291 views
Hi there,

I have a page where i make some calls via javascript ajaxRequest (ex. <%= RadAjaxManager1.ClientID %>.ajaxRequest('Move'); )

I do not have any rewriting modules...

When calling that ajax request, I am getting this javascript error:

Sys.Webforms.PageRequestManagerServerErrorException: an unknown error occured while processing the request on the server. The status code returned from the server was: 405

The error is in the ScriptResource.axd:868

thanks in advance

Kevin
Daniel
Telerik team
 answered on 15 Jul 2011
1 answer
49 views
Hi Team,

we develop a share point wiki page with the help of  RadEditor webpart .
In this RadEditor we need to add a customised tool tip, by selecting some text and  apply tool-tip for the selected text. this tooltip text includes with text and url link.which on hover should display some text with an hyperlink.
on click the hyperlink should do some action.
whether  this feature is available by default or if not can anyone provide any customized code as per our requirement.

Thanks in advance for your help.

Rumen
Telerik team
 answered on 15 Jul 2011
0 answers
93 views
Dear All,
  
Filter Css Problem Occured When useing Radajaxpanel. Radgrid is inside the usercontrol the problem occurs like attched screen. See the attached filter.jpg. It shows what am getting.

Some time it come good. Some time it come bad alighnment. pls sort out this problem. very urgent

regards,
vinoth
vinoth sansar
Top achievements
Rank 2
 asked on 15 Jul 2011
8 answers
205 views
I've just updated to 2008 Q2 release in a vein attempt to try to overcome an issue I have where i'm loading on demand 1000nodes.

In IE7 this seemed incredibly slow, and comes up with "Stop running this script?" dialog boxes a couple of times .. continuing to say NO, the nodes are shown on the tree.

Firefox manages this feat alot quicker (takes about 5-8seconds in total) and does not display 'Stop running this script?" dialogs.

IE7 even pressing NO immediately seems to be taking over 30seconds to do the same thing.   As I say i've just updated to Q2 ... with 2008 Q1 it was taking several minutes!!!


Apart from hacking the registery to increase the timeout period for the "Stop running this script?" dialog (as described here: http://support.microsoft.com/kb/175500) is there anything we can do to stop this dialog box and make the loading of 1000nodes quicker.

I've put a stopwatch around my NodeExpand() method, and whilst there are possibly some efficiencies I can make server-side the server-side method exits in under 1.5seconds after loading 1000nodes;    so the rest of the time is purely Client-side Javascript rendering the ajax results into the tree (I guess).

Help!!!!
Nikolay Tsenkov
Telerik team
 answered on 15 Jul 2011
1 answer
41 views
My master radgrid holds Locations and has a primary key of Location_ID

The details table below holds Activities related to the selected Location.

The datasource for the Activity grid included the act_Location_ID in it's where clause, like this.

WHERE act_Location_ID = @loc_Location_ID

All this works 100%. Clicking a Location updates the list of Activities and everyone is happy. :)

However, this page is a search (filter) page. That is, by setting values on a form you can limit the number of locations. Despite this the Location and Activity work in unison. The Activity table shows you the activities for the selected Location.

That is unless your filtering results in NO location returned. In this case the problem begins.

If there is no Locations returned, the Activity grid defaults to showing EVERY activity in the database, regardless of Location ID.

This is a show stopper. Why in the case of there being no Locations returned, does my Activity table disregard the Location ID WHERE clause in its DataSource and return all Activities?








Brad
Top achievements
Rank 1
 answered on 15 Jul 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?