473,399 Members | 2,774 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

gridview not waiting for user to hit go

I have three dropdowns, one is populated, the other two I'm just putting in values myself (facility, year, month). I have a gridview running a stored procedure that is waiting for values from the dropdowns so it can populate the grid.

I'd like to wait to populate the grid until the user selects values and hits go, but for some reason, it's just populating automatically. I tried putting in a "Please Select" in one of them, but then it complains that my input value is not right.

All three dropdowns are autopostback = false (advice from someone else).

Is there a property in the gridview I need to set?
here's the gridview code
Expand|Select|Wrap|Line Numbers
  1. <asp:GridView ID="gv_cust1" runat="server" AutoGenerateColumns="False" DataSourceID="udsp_SCCust1" CellPadding="4" ForeColor="#333333" GridLines="None">
  2.                         <Columns>
  3.                             <asp:BoundField DataField="Measure1" HeaderText="Measure1" ReadOnly="True" SortExpression="Measure1" />
  4.                             <asp:BoundField DataField="Measure2" HeaderText="Measure2" ReadOnly="True" SortExpression="Measure2" />
  5.                             <asp:BoundField DataField="Score" HeaderText="Score" ReadOnly="True" SortExpression="Score" />
  6.                         </Columns>
  7.                         <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
  8.                         <RowStyle BackColor="#EFF3FB" />
  9.                         <EditRowStyle BackColor="#2461BF" />
  10.                         <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
  11.                         <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
  12.                         <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
  13.                         <AlternatingRowStyle BackColor="White" />
  14.                     </asp:GridView>
  15.  
here's the sql that it runs
Expand|Select|Wrap|Line Numbers
  1. <asp:SqlDataSource ID="udsp_SCCust1" runat="server" ConnectionString="<%$ ConnectionStrings:Cypress_APPConnectionString %>"
  2.                         SelectCommand="udsp_ScorecardQuarterly" SelectCommandType="StoredProcedure">
  3.                         <SelectParameters>
  4.                             <asp:ControlParameter ControlID="ddlQuarter" Name="qtr" PropertyName="SelectedValue"
  5.                                 Type="Int32" />
  6.                             <asp:ControlParameter ControlID="ddlYear" Name="year" PropertyName="SelectedValue"
  7.                                 Type="Int32" />
  8.                             <asp:ControlParameter ControlID="ddlFacility" Name="entID" PropertyName="SelectedValue"
  9.                                 Type="Int32" />
  10.                         </SelectParameters>
  11.                     </asp:SqlDataSource>
  12.  
Any ideas?
Jun 18 '07 #1
2 1262
nateraaaa
663 Expert 512MB
I have three dropdowns, one is populated, the other two I'm just putting in values myself (facility, year, month). I have a gridview running a stored procedure that is waiting for values from the dropdowns so it can populate the grid.

I'd like to wait to populate the grid until the user selects values and hits go, but for some reason, it's just populating automatically. I tried putting in a "Please Select" in one of them, but then it complains that my input value is not right.

All three dropdowns are autopostback = false (advice from someone else).

Is there a property in the gridview I need to set?
here's the gridview code
Expand|Select|Wrap|Line Numbers
  1. <asp:GridView ID="gv_cust1" runat="server" AutoGenerateColumns="False" DataSourceID="udsp_SCCust1" CellPadding="4" ForeColor="#333333" GridLines="None">
  2.                         <Columns>
  3.                             <asp:BoundField DataField="Measure1" HeaderText="Measure1" ReadOnly="True" SortExpression="Measure1" />
  4.                             <asp:BoundField DataField="Measure2" HeaderText="Measure2" ReadOnly="True" SortExpression="Measure2" />
  5.                             <asp:BoundField DataField="Score" HeaderText="Score" ReadOnly="True" SortExpression="Score" />
  6.                         </Columns>
  7.                         <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
  8.                         <RowStyle BackColor="#EFF3FB" />
  9.                         <EditRowStyle BackColor="#2461BF" />
  10.                         <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
  11.                         <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
  12.                         <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
  13.                         <AlternatingRowStyle BackColor="White" />
  14.                     </asp:GridView>
  15.  
here's the sql that it runs
Expand|Select|Wrap|Line Numbers
  1. <asp:SqlDataSource ID="udsp_SCCust1" runat="server" ConnectionString="<%$ ConnectionStrings:Cypress_APPConnectionString %>"
  2.                         SelectCommand="udsp_ScorecardQuarterly" SelectCommandType="StoredProcedure">
  3.                         <SelectParameters>
  4.                             <asp:ControlParameter ControlID="ddlQuarter" Name="qtr" PropertyName="SelectedValue"
  5.                                 Type="Int32" />
  6.                             <asp:ControlParameter ControlID="ddlYear" Name="year" PropertyName="SelectedValue"
  7.                                 Type="Int32" />
  8.                             <asp:ControlParameter ControlID="ddlFacility" Name="entID" PropertyName="SelectedValue"
  9.                                 Type="Int32" />
  10.                         </SelectParameters>
  11.                     </asp:SqlDataSource>
  12.  
Any ideas?
Where is the datasource assigned for this gridview? If it is in the Page_Load event that may be the problem. If you want your grid to populate on a button click or postback from a drop down list you will need to assign you datasource and databind calls in those methods, NOT in the Page_Load. Let us know if this works.

Nathan
Jun 18 '07 #2
prabunewindia
199 100+
hi friend,
make the populated dropdown list's autopostback as true
and code ur fill grid code in dropdown selected index changed event
Prabu

I have three dropdowns, one is populated, the other two I'm just putting in values myself (facility, year, month). I have a gridview running a stored procedure that is waiting for values from the dropdowns so it can populate the grid.

I'd like to wait to populate the grid until the user selects values and hits go, but for some reason, it's just populating automatically. I tried putting in a "Please Select" in one of them, but then it complains that my input value is not right.

All three dropdowns are autopostback = false (advice from someone else).

Is there a property in the gridview I need to set?
here's the gridview code
Expand|Select|Wrap|Line Numbers
  1. <asp:GridView ID="gv_cust1" runat="server" AutoGenerateColumns="False" DataSourceID="udsp_SCCust1" CellPadding="4" ForeColor="#333333" GridLines="None">
  2.                         <Columns>
  3.                             <asp:BoundField DataField="Measure1" HeaderText="Measure1" ReadOnly="True" SortExpression="Measure1" />
  4.                             <asp:BoundField DataField="Measure2" HeaderText="Measure2" ReadOnly="True" SortExpression="Measure2" />
  5.                             <asp:BoundField DataField="Score" HeaderText="Score" ReadOnly="True" SortExpression="Score" />
  6.                         </Columns>
  7.                         <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
  8.                         <RowStyle BackColor="#EFF3FB" />
  9.                         <EditRowStyle BackColor="#2461BF" />
  10.                         <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
  11.                         <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
  12.                         <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
  13.                         <AlternatingRowStyle BackColor="White" />
  14.                     </asp:GridView>
  15.  
here's the sql that it runs
Expand|Select|Wrap|Line Numbers
  1. <asp:SqlDataSource ID="udsp_SCCust1" runat="server" ConnectionString="<%$ ConnectionStrings:Cypress_APPConnectionString %>"
  2.                         SelectCommand="udsp_ScorecardQuarterly" SelectCommandType="StoredProcedure">
  3.                         <SelectParameters>
  4.                             <asp:ControlParameter ControlID="ddlQuarter" Name="qtr" PropertyName="SelectedValue"
  5.                                 Type="Int32" />
  6.                             <asp:ControlParameter ControlID="ddlYear" Name="year" PropertyName="SelectedValue"
  7.                                 Type="Int32" />
  8.                             <asp:ControlParameter ControlID="ddlFacility" Name="entID" PropertyName="SelectedValue"
  9.                                 Type="Int32" />
  10.                         </SelectParameters>
  11.                     </asp:SqlDataSource>
  12.  
Any ideas?
Jun 19 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: GaryDean | last post by:
I'm trying to load a GridView up with data manually, in code. I'm not using any datasource. Using this code.... ArrayList myRowArrayList; GridViewRow myGVR = new...
2
by: Greg | last post by:
Hello, I am trying to bind a GridView to a custom object I have created. First, here is what I'm trying to do: I have a wizard for adding/editing Users. When the wizard begins, a User...
0
by: LiamLiamLiam | last post by:
G'day all. I having a problem with my formview. I'll ty to explain my situation as best as i can. I have a page with a search field at the top which is just a simple asp:textbox. Below that i...
1
by: sheenaa | last post by:
Hello Members, I m creating my application forms in ASP.Net 2005 C# using the backend SQL Server 2005. What i have used on forms :: ? On my first form i have used some...
4
by: SEliel | last post by:
Hello everyone: I'm programming a custom GridView, adding column by column dynamically. Every column is a TemplateField, and I've made a class hierarchy for each template (TextColumnTemplate,...
3
by: gianfranco dalfiume | last post by:
Hi all, i'm new to this newsgroup. This is my problem: i have a form with a GridView. The first column of the grid is a ButtoFields (image type) column, with some code to manage the request for...
1
by: gianfranco dalfiume | last post by:
Hi all! I have a gridview with a templatefield and an imagebutton <asp:TemplateField> <ItemTemplate> <asp:ImageButton ID="Riepilogo" runat="server"...
11
by: Ed Dror | last post by:
Hi there, I'm using ASP.NET 2.0 and SQL Server 2005 with VS 2005 Pro. I have a Price page (my website require login) with GridView with the following columns PriceID, Amount, Approved,...
11
by: SAL | last post by:
Hello, I have a Gridview control (.net 2.0) that I'm having trouble getting the Update button to fire any kind of event or preforming the update. The datatable is based on a join so I don't know...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.