473,662 Members | 2,352 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Confused about events and when they get fired.

I have a grid control (inherits from Placeholder) that has a few
buttons on it. On this grid there is a filter form, which allows the
user to filter/search the table for specific information. My problem
is, that the order in which the event gets called. What is basically
happening is that the control is instantiated, I call my initialize
method, then I wait for the user to call GenerateGrid, in case they
wanted to make any last minute changes to the grid that I don't have a
constructor for, or possibly add/remove event handlers from the grids
buttons, etc. The problem is that unless I actually generate and add
the grid control to a page, the filter event never fires off. And then
when it does, I generate the grid, add it to the page, then the filter
event fires off and REgenerates the grid. I have tried putting the code
that calls the GenerateGrid function in the pages pre-render method,
last step before rendering, but then the filter event never even fires.

I know this sounds complicated, but please bear with me and hopefully
we can get this figured out...

AB

May 23 '06 #1
7 3108
now I got confused :-(

without confusing me more ... what's the final propose?

--

Bruno Alexandre
(a Portuguese in Københanv, Danmark)
<An************ @gmail.com> escreveu na mensagem
news:11******** ************@j7 3g2000cwa.googl egroups.com...
I have a grid control (inherits from Placeholder) that has a few
buttons on it. On this grid there is a filter form, which allows the
user to filter/search the table for specific information. My problem
is, that the order in which the event gets called. What is basically
happening is that the control is instantiated, I call my initialize
method, then I wait for the user to call GenerateGrid, in case they
wanted to make any last minute changes to the grid that I don't have a
constructor for, or possibly add/remove event handlers from the grids
buttons, etc. The problem is that unless I actually generate and add
the grid control to a page, the filter event never fires off. And then
when it does, I generate the grid, add it to the page, then the filter
event fires off and REgenerates the grid. I have tried putting the code
that calls the GenerateGrid function in the pages pre-render method,
last step before rendering, but then the filter event never even fires.

I know this sounds complicated, but please bear with me and hopefully
we can get this figured out...

AB

May 23 '06 #2
The final purpose is to use my custom grid control, with built in
headers, footers, pagers and filter form on my pages. The microsoft
grid is nice and all, but my grid works with any table in the database,
without any extra setup. All of the captions and help topics associated
with tables and fields are in the DB, as well as all the field types.
Because it is all in there, I can use one grid control and one filter
form in one page, not making a different ASPX page for each table in
the DB. I am working on the opensource project located at
http://www.codeproject.com/aspnet/RapidWebAppDev.asp
Basically all of the captions, add/edit forms and all of the other
common things that most people who create grids have to implement are
all defined in metadata. I am now to the point where I am customizing
the grids behavior by changing the button events before they are
generated and placed in the placeholders control collection. For
example, I have a checkbox column that you can display, and by default
under that collumn, I have "edit selected rows" and "delete selected
rows" buttons. In one case, I want to remove those buttons and, while
still using the grids checkboxe column, do something entirely different
with the selected rows.

So, again, the problem is that a button is causing a post back, the
grid is generating itself once, THEN firing the event handler for the
button that caused the postback in the first place, then it has to
generate itself again. I am trying to avoid the creation of the grid
(building a table with 100 some odd rows of content and buttons), just
to have the filter event fire, and regenerate a different grid, with
the main difference being the rows that it displays...

I looked into the bubble event, but I can't get the onbubble event to
fire unless I actually add the grid control to a page (thus requireing
that I generate the grids "table" member, and populate the base
placeholder classes Control Collection with the appropriate controls,
just to have it generate itself again).

I basically want the grids filter button event to be the first thing
called on the postback, pretending that the grid is still in memory on
the server I guess. It doesn't look like this is possible, although I
was told to pretend that ASP.Net is not a stateless environment like
previous versions of ASP...

Please let me know if I am making sense or not...

Andrew Baldwin

May 23 '06 #3
well,

I liked to help you, but I will not download that control just to help you
with that, sorry... to much work!

I never have any problem with sql/grid... I always show a GridView in the
page, cause I just love that control, and I do everything with it (took me a
while, but now I'm unstopable) :-)

in page.load ... in page.ispostback I get the data and fill up a DataTable,
and since then to the user click Save back to Database I never ask anything
to the DB... always use the DT to sort, filter, add and remove

using a DT I could create my own Database Class to do all of that moves and
procedures ... I still perfer workin' like that cause using other guys
controls... there is always a thing we wanna add or remove and then we need
to investigate to see how can we do that... it will take more time is I
build one time only my class... and everytime I need to add something, I
just go to the class and add it, and it will be available for future
websites, or even in the same website ...

I perfer this way.

--

Bruno Alexandre
(a Portuguese in Københanv, Danmark)
<mu**********@g mail.com> escreveu na mensagem
news:11******** **************@ j73g2000cwa.goo glegroups.com.. .
The final purpose is to use my custom grid control, with built in
headers, footers, pagers and filter form on my pages. The microsoft
grid is nice and all, but my grid works with any table in the database,
without any extra setup. All of the captions and help topics associated
with tables and fields are in the DB, as well as all the field types.
Because it is all in there, I can use one grid control and one filter
form in one page, not making a different ASPX page for each table in
the DB. I am working on the opensource project located at
http://www.codeproject.com/aspnet/RapidWebAppDev.asp
Basically all of the captions, add/edit forms and all of the other
common things that most people who create grids have to implement are
all defined in metadata. I am now to the point where I am customizing
the grids behavior by changing the button events before they are
generated and placed in the placeholders control collection. For
example, I have a checkbox column that you can display, and by default
under that collumn, I have "edit selected rows" and "delete selected
rows" buttons. In one case, I want to remove those buttons and, while
still using the grids checkboxe column, do something entirely different
with the selected rows.

So, again, the problem is that a button is causing a post back, the
grid is generating itself once, THEN firing the event handler for the
button that caused the postback in the first place, then it has to
generate itself again. I am trying to avoid the creation of the grid
(building a table with 100 some odd rows of content and buttons), just
to have the filter event fire, and regenerate a different grid, with
the main difference being the rows that it displays...

I looked into the bubble event, but I can't get the onbubble event to
fire unless I actually add the grid control to a page (thus requireing
that I generate the grids "table" member, and populate the base
placeholder classes Control Collection with the appropriate controls,
just to have it generate itself again).

I basically want the grids filter button event to be the first thing
called on the postback, pretending that the grid is still in memory on
the server I guess. It doesn't look like this is possible, although I
was told to pretend that ASP.Net is not a stateless environment like
previous versions of ASP...

Please let me know if I am making sense or not...

Andrew Baldwin

May 23 '06 #4
Hmm, maybe you can answer this, at what point does a buttons click
event fire, and does it have to be added to the pages control
collection for it's fire event to be called? I have found that it runs
like so:

Derived Page class's onload fires
Grid is initialized, controls generated and put in the placeholders
control collection
BasePage's onload event fires
Grid's filter event is called, and grid is subsequently regenerated,
which is a lot of overhead, The page only gets rendered once, but it
physically constructs the grid two times.

I tried to do it like so

Derived pages onload fires
The derived onload initialized the grid, but does not tell it to
generate it's controls (Well, it doesn't generate the actual table, all
of the buttons are instantiated and their events wired, they are just
not added to the placeholder's control collection).
BasePage's onload event fires
Derived pages prerender event filres, and tells the grid to generate
it's controls and put them on the placeholder, but then the grids fire
event doesn't fire.

I guess the next step is to have the page load add the buttons to the
page in the derived pages onload event, even if there is not a table on
the page to display it's associated data...

Again, the Bubble event is never fired unless the grid is populated,
the controls generated, then added to a page's placeholder.
AB

May 23 '06 #5
a button event can execute as PostBack or CallBack...

postback will execute the hole page, and for that the hole events for the
page ... (that's why we use sometimes if page.ispostback

the callback will execute a Script Function (like AJAX) normally in
Javascript, like rollover in images... you can build everything running in a
callback, see atlas website for a quick look on what you can do without a
page refresh

Atlas : http://atlas.asp.net/
Atlas Toolkit : http://atlas.asp.net/atlastoolkit/

--

Bruno Alexandre
(a Portuguese in Københanv, Danmark)
<mu**********@g mail.com> escreveu na mensagem
news:11******** *************@g 10g2000cwb.goog legroups.com...
Hmm, maybe you can answer this, at what point does a buttons click
event fire, and does it have to be added to the pages control
collection for it's fire event to be called? I have found that it runs
like so:

Derived Page class's onload fires
Grid is initialized, controls generated and put in the placeholders
control collection
BasePage's onload event fires
Grid's filter event is called, and grid is subsequently regenerated,
which is a lot of overhead, The page only gets rendered once, but it
physically constructs the grid two times.

I tried to do it like so

Derived pages onload fires
The derived onload initialized the grid, but does not tell it to
generate it's controls (Well, it doesn't generate the actual table, all
of the buttons are instantiated and their events wired, they are just
not added to the placeholder's control collection).
BasePage's onload event fires
Derived pages prerender event filres, and tells the grid to generate
it's controls and put them on the placeholder, but then the grids fire
event doesn't fire.

I guess the next step is to have the page load add the buttons to the
page in the derived pages onload event, even if there is not a table on
the page to display it's associated data...

Again, the Bubble event is never fired unless the grid is populated,
the controls generated, then added to a page's placeholder.
AB

May 23 '06 #6
I have looked at Atlas already and have not seen anything like that,
any examples of exactly one would do that?

AB

May 24 '06 #7
http://atlas.asp.net/atlastoolkit/Co...irmButton.aspx

the ConfirmButton runs a callback to the server and execute a function, in
this case something like:
label.text = "You clicked " & buttonClickedNa me.text & " you're safe"

without any postback to the page (you can see that the fucntion is performed
without refreshing the webpage).
and tha'ts what you want, a callback button/or link to perform your
operation.
--

Bruno Alexandre
(a Portuguese in Københanv, Danmark)
<mu**********@g mail.com> escreveu na mensagem
news:11******** **************@ j55g2000cwa.goo glegroups.com.. .
I have looked at Atlas already and have not seen anything like that,
any examples of exactly one would do that?

AB

May 24 '06 #8

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

Similar topics

1
1356
by: e-mid | last post by:
i registered two events with a button. when i press it , how can i know which is fired first? or is there a way to make one of them get fired before the other one? in fact i made a experiment about it : i put message boxes in the events, when i press button only one event is fired and other is never. why does that happens?
0
1201
by: Manuel D. Jim?nez | last post by:
Hi, we are developing an ActiveX control which plays a video streaming. We have used Visual Studio .net wizard to develop almost all the control interface, however we have trouble with event firing, because some events are not fired. If the users does 'Play' then the control starts a thread playing the video and fires an event called 'playing'. While this secondary thread is playing the video, the main thread is waiting for any new...
3
252
by: Ferdinand Zaubzer | last post by:
As far as I know events are fired by invoking a method. Is it possible that events are fired if a boolean property changes its value? Thanks Ferdinand
2
5520
by: meska | last post by:
Hi all, Scenario: I have a MonthCalendar control, and DataGridView. Depending on dates displayed in MonthCalendar I want to update information from database. The Possible Solution: So I must use DateChanged and/or DateSelected events to get the new dates
0
909
by: mosscliffe | last post by:
I have a textbox, with TextChanged implemented and AutoPostback = TRUE I make changes to the Textbox, the TextChanged Routine is not called. I have a Button which does something with the TEXTBOX, when that is selected, the Textbox.TextChanged gets executed, but not the Button code. If I don't have the TextChanged event, then the Button event gets executed.
6
1741
by: Steve Hershoff | last post by:
Hi everyone, I've got a strange one here. There are two datagrids on my page, one nested within the other. I'll refer to them as the topmost and secondary datagrids. In the topmost datagrid's OnItemDataBound() method we check for the row in which it's appropriate to add the secondary datagrid. Exactly one row in the topmost grid will contain the secondary grid.
0
2417
by: hmm | last post by:
Hi all I have two problems: Problem #1: I'm using a .NET Form with the property 'FormBorderStyle' set to 'None'. The idea is to completely cover the area of that Form with a UserControl. In order to be able to move that Form around with the mouse I have to implement EventHandlers for the MouseDown, MouseUp and MouseMove event. Now the problem I have is these Events will never be fired because the entire dialog is covered by the...
10
3618
by: Martijn Mulder | last post by:
A general question and a specific one. 1. Is there a Spy utility that shows events for a .NET application 2. What events are fired when calling Form.Show() ?
2
6825
by: Peter | last post by:
Hi, I have a problem with Listview using checkboxes. If i check items by code BEFORE the form is shown the Listview.Items are confused during the ItemChecked Event !!! After showing the form every thing works fine: checking items by code
0
8856
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...
1
8545
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
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7365
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...
0
4179
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2762
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
2
1992
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1747
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.