473,322 Members | 1,307 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,322 software developers and data experts.

GridView - binding data programmatically

Hi, I have a code that sort of works. The event flow is as follows:
In a user control of type "FilterControl" user selects certain values
from 3 related dropdown lists. (two of them have auto postback set to
true as I need to refresh the 2nd and 3rd list. Then clicks on Submit
button which fires a custom event "FilterSubmitted". Yes this a custom
control, as I will be using it in many places.

I have a GridView control on the page that displays the search results.

The problem is that when the 1st filter is selected, the postback
causes the page to refresh together with the GridView, which I would
like to keep unchanged until the Submit button of the FilterControl.

All stopping of the events in DataBound related evens using flags had
the same behaviour.

I have tried to remove the code from aspx to the code behind, where I
hit the following error
"Value cannot be null.\r\nParameter name: propName".
My understanding is that this is related to the Data Access Security
aspect.
As per MSDN - the "User" value is set correctly for the page.
I have no clue as to what to do next.

Is there any other way to stop the page from being refreshed?
How could I use client side refresh of the filter, such that the post
back only occurs on Submit button?

Any guidance would be greatly appreciated.

Thanks
bsaran

Below is the Stack Trace for consideration:
System.ArgumentNullException was unhandled by user code
Message="Value cannot be null.\r\nParameter name: propName"
Source="System.Web"
ParamName="propName"
StackTrace:
at System.Web.UI.DataBinder.GetPropertyValue(Object container,
String propName)
at
System.Web.UI.WebControls.GridView.CreateChildCont rols(IEnumerable
dataSource, Boolean dataBinding)
at
System.Web.UI.WebControls.CompositeDataBoundContro l.PerformDataBinding(IEnumerable
data)
at
System.Web.UI.WebControls.GridView.PerformDataBind ing(IEnumerable data)
at
System.Web.UI.WebControls.DataBoundControl.OnDataS ourceViewSelectCallback(IEnumerable
data)
at System.Web.UI.DataSourceView.Select(DataSourceSele ctArguments
arguments, DataSourceViewSelectCallback callback)
at System.Web.UI.WebControls.DataBoundControl.Perform Select()
at System.Web.UI.WebControls.BaseDataBoundControl.Dat aBind()
at System.Web.UI.WebControls.GridView.DataBind()
at Pricing_PriceRebate.Filter_Submitted(Object sender,
FilterSubmitEventArgs e) in
c:\Dev\Projects\GainShare.root\GainShare\GainShare \Pricing\PricingInput.aspx.cs:line
122
at
UserControls_FilterControl.OnFilterSubmit(FilterSu bmitEventArgs e) in
c:\Dev\Projects\GainShare.root\GainShare\GainShare \UserControls\FilterControl.ascx.cs:line
49
at UserControls_FilterControl.btnSubmit_Click(Object sender,
EventArgs e) in
c:\Dev\Projects\GainShare.root\GainShare\GainShare \UserControls\FilterControl.ascx.cs:line
118
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEven t(String
eventArgument)
at
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection
postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

May 16 '06 #1
0 3013

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: theKirk | last post by:
using Visual Studio 2005 C# ASP.NET I know there has to be a simple way to do this....I want to use C# in a code behind for aspx. Populate a GridView from an xml file Add Fields to the...
7
by: | last post by:
Hello, Does anyone have an idea on how I can filter the data in the gridview control that was returned by an sql query? I have a gridview that works fine when I populate it with data. Now I...
7
by: Ken | last post by:
Hi All - I have a filtered GridView. This GridView has a check box in the first column. This check box is used to identify specific rows for delete operations. On the button click event I...
5
by: Brian McClellan | last post by:
Just wondering if anyone has a simple example of creating a gridview completely programmatically, i'm not doing anything terribly sophisticated. When creating the gridview declaratively evertying...
4
by: Mike | last post by:
I'm having trouble getting a gridview to bind. I probably missing something completely obvious and would appreciate any help on offer. I'm passing parameters via querystring, and have created a...
2
by: Philip | last post by:
I can use a GridView and ObjectDataSource to bind my data using "Eval" expressions ... provided the GridView and related Column TemplateFields are defined as inline HTML. I prefer to...
2
by: antonyliu2002 | last post by:
I've been googling for some time, and could not find the solution to this problem. I am testing the paging feature of gridview. I have a very simple web form on which the user can select a few...
8
by: gerry | last post by:
The PagerSettings.Visible property is not being handled properly by the GridView control. The value assigned to this property is not applied until after a postback. Simplest test : .aspx...
2
by: John Straumann | last post by:
Hello all: I am trying to populate a GridView with data being read from a call to a web service. I have seen plenty of examples that simply execute a SQL data reader, set the Grid data source to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.