.NETGURU
Sub control event firing
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngcontrolscs' list.


SRoche@uk.imshealth.com
Hi,

I have a page that has a 'search' user control on it, with a single
placeholder. Depending
on some options set in the search control, hitting the search button causes
one of a number
of datagrids to be loaded dynamically, and added to the placeholder
(Page.LoadControl).

This is fine.

However, the datagrid has sorting enabled, and hence hitting the header of a
column causes an
OnDataGridSort method to be fired. What I am finding is that upon postback,
unless this
dynamically created datagrid exists, the event will not fire. At present, I
load a default
datagrid in the ispostback=false section of the page_load method, so this
means on postback
there is no datagrid, and hence the event does not fire.

This seems to be a real basic problem but for the life of me I can't find a
solution ! Any
help much appreciated.

Steve...

Reply to this message...
 
    
Schannach, Pat
I had a similar problem with events not firing on a datagrid for which I
dynamically added columns. The grid & any columns you want posted back must
exist before PageLoad fires. Create the grid and any dynamically added
columns in a PageInit event handler and I bet things work.

-----Original Message-----
From: Click here to reveal e-mail address [mailto:Click here to reveal e-mail address]
Sent: Monday, August 12, 2002 8:59 AM
To: aspngcontrolscs
Subject: [aspngcontrolscs] Sub control event firing

Hi,

I have a page that has a 'search' user control on it, with a single
placeholder. Depending
on some options set in the search control, hitting the search button causes
one of a number
of datagrids to be loaded dynamically, and added to the placeholder
(Page.LoadControl).

This is fine.

However, the datagrid has sorting enabled, and hence hitting the header of a
column causes an
OnDataGridSort method to be fired. What I am finding is that upon postback,
unless this
dynamically created datagrid exists, the event will not fire. At present, I
load a default
datagrid in the ispostback=false section of the page_load method, so this
means on postback
there is no datagrid, and hence the event does not fire.

This seems to be a real basic problem but for the life of me I can't find a
solution ! Any
help much appreciated.

Steve...

| [aspngcontrolscs] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngcontrolscs.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
    
SRoche@uk.imshealth.com
Pat,

[Original message clipped]

No, doesn't help. Remember, I do not know which datagrid to load since
it can be one of many - hence I cannot load it in pageinit or pageload.
I do load it first time round (via page.ispostback==false), but when the
event is fired on the datagrid, I want it to be handled without having to
instantiate the datagrid.

I have a sample C# project (very small) that illustrates the problem if you
are interested.

Steve...

[Original message clipped]

Reply to this message...
 
 
System.Web.UI.Page




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification