473,761 Members | 2,824 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

GridView - binding data programmaticall y

Hi, I have a code that sort of works. The event flow is as follows:
In a user control of type "FilterCont rol" 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 "FilterSubmitte d". 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\nParame ter 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.Argument NullException was unhandled by user code
Message="Value cannot be null.\r\nParame ter name: propName"
Source="System. Web"
ParamName="prop Name"
StackTrace:
at System.Web.UI.D ataBinder.GetPr opertyValue(Obj ect container,
String propName)
at
System.Web.UI.W ebControls.Grid View.CreateChil dControls(IEnum erable
dataSource, Boolean dataBinding)
at
System.Web.UI.W ebControls.Comp ositeDataBoundC ontrol.PerformD ataBinding(IEnu merable
data)
at
System.Web.UI.W ebControls.Grid View.PerformDat aBinding(IEnume rable data)
at
System.Web.UI.W ebControls.Data BoundControl.On DataSourceViewS electCallback(I Enumerable
data)
at System.Web.UI.D ataSourceView.S elect(DataSourc eSelectArgument s
arguments, DataSourceViewS electCallback callback)
at System.Web.UI.W ebControls.Data BoundControl.Pe rformSelect()
at System.Web.UI.W ebControls.Base DataBoundContro l.DataBind()
at System.Web.UI.W ebControls.Grid View.DataBind()
at Pricing_PriceRe bate.Filter_Sub mitted(Object sender,
FilterSubmitEve ntArgs e) in
c:\Dev\Projects \GainShare.root \GainShare\Gain Share\Pricing\P ricingInput.asp x.cs:line
122
at
UserControls_Fi lterControl.OnF ilterSubmit(Fil terSubmitEventA rgs e) in
c:\Dev\Projects \GainShare.root \GainShare\Gain Share\UserContr ols\FilterContr ol.ascx.cs:line
49
at UserControls_Fi lterControl.btn Submit_Click(Ob ject sender,
EventArgs e) in
c:\Dev\Projects \GainShare.root \GainShare\Gain Share\UserContr ols\FilterContr ol.ascx.cs:line
118
at System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e)
at System.Web.UI.W ebControls.Butt on.RaisePostBac kEvent(String
eventArgument)
at
System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring
eventArgument)
at System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
sourceControl, String eventArgument)
at System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection
postData)
at System.Web.UI.P age.ProcessRequ estMain(Boolean
includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint)

May 16 '06 #1
0 3038

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

Similar topics

3
5677
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 GridView to allow entry of quantity and Y/N switch for
7
14818
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 want to look at that data and filter it based on what is in it. I know that this could have been done with data sets and data views in asp.net 1.1 but how is this done now in asp.net 2.0?
7
5471
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 loop through the filtered GridView to identify the selected rows and assemble some XML to be sent to a stored proc. The problem I have is that when looping through the GridView, it doesn't
5
15332
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 works fine, however programmatically, while the grid will display data that exsists in the database, any operation on the data ( editing/updating/deleting ) seems to cause a rowdeleting/updating etc error. Or is this simply not meant to be done?
4
2609
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 stored proc as follows: qGetSearchResults: SELECT Adverts.AdvertID,
2
8764
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 programmatically create the GridView Column/ TemplateField definitions at runtime.... because I do not know the number of applicable columns until runtime. The addition of the GridView Column/ TemplateFields work fine, however the "Eval" expressions do not...
2
13198
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 fields to be included in the table, which is to be bound to the gridview. The web form looks like so (Don't worry about the stupidity of this web form for now.):
8
7736
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 containing a single gridview - enable paging and give enough data to page. add checkbox with auto postback enable add button with auto postback enable in the GridView1_PreRender method add the following : GridView1.HeaderRow.Enabled =
2
6393
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 the reader, and then call DataBind(), but I cannot seem to figure out how to build the GridView row by row with anything except text. I need the 2nd column of the Grid to be a hyperlink or a button, and this is where I am having an issue. I can...
0
9554
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9377
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10136
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9989
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9925
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8814
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
3913
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3509
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2788
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.