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

ItemDataBound not being caught

Jon
Hello everyone,

We're using ASP.net 1.1 and when we load a control dynamically, using
LoadControl, the ItemDataBound of the DataGrid that sits in this dynamically
loaded control does not get hit. Does anyone know why at all?

Any help would be great. Thanks,

Jon
Apr 10 '06 #1
3 2190
Hi Jon,

Where are you setting the event handler for ItemDataBound?

Can you please give me the code that you use for loading the datagrid?

I think that we have to basically do something like this:

DataGrid usersGrid = (DataGrid)LoadControl("something.ascx");
usersGrid.ItemDataBound += this.somemethod;
usersGrid.DataSource = ----------
usersGrid.DataBind();

Regards,
Jim

Apr 10 '06 #2
Jon
Hi Jim.

The ItemDataBound event is within the UserControl, and the LoadControl is
called in a ItemRender event of a separte grid.

Thanks,

Jon

"jim4u" wrote:
Hi Jon,

Where are you setting the event handler for ItemDataBound?

Can you please give me the code that you use for loading the datagrid?

I think that we have to basically do something like this:

DataGrid usersGrid = (DataGrid)LoadControl("something.ascx");
usersGrid.ItemDataBound += this.somemethod;
usersGrid.DataSource = ----------
usersGrid.DataBind();

Regards,
Jim

Apr 10 '06 #3
Hi Jon,

How about providing the code? Just the relevant code will do.

'The ItemDataBound event is within the UserControl': This means the
datagrid is in the user control, right.

'and the LoadControl is called in a ItemRender event of a separte
grid.':- Did you mean the DataGridItem.PreRender event? I am curious
about the requirement, and would you mind letting me know why you have
to call LoadControl in the prerender event for each item in the
datagrid?

Regards,

Jim

Apr 13 '06 #4

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

Similar topics

2
by: Steve Klett | last post by:
Hi- I am developing a hierarchical navigation system. I have a DataList with the root level items, on the ItemDataBound event, I check for the selected item, when found I'm adding an additional...
3
by: Clouds | last post by:
Hi ! How do I add the dynamic event handler for a dropdownlist present in the itemtemplate of a datalist !! I am doing it in the itemdatabound event of the datalist but it doesnt work... I am...
1
by: Roy | last post by:
Hey all, This is a fairly broad question, but why is it that my datagrid hits the ItemDataBound event 3 times? Basically, I placed a response.write in all sub and functions in my codebehind and...
0
by: KJ | last post by:
I noticed the following behavior: With 2 repeaters nested, such as: <asp:repeater id=rptrParentRepeater runat="server"> <ItemTemplate> <asp:Repeater id="rptrChildRepeater" runat="server"...
4
by: Girish | last post by:
Im trying to create a grid within a grid programmatically. Ive been successful in doing this but I need the embedded grid to fire its ItemDataBound event so I can handle it. The event does not seem...
2
by: samir dsf | last post by:
hi I had been using this datagrid for long. all well...but suddenly the itemdatabound event is not at all getting called...i dont see my links..initally it worked well here is the page_load...
2
by: Ken Slight | last post by:
In C#, I use the following to bind ItemDataBound to a DataGrid: grid.ItemDataBound += new DataGridItemEventHandler(OnContentItemDataBound); Does anyone know the equivalent of this in vb.net? ...
1
by: greenb | last post by:
I'm using the ItemDataBound event of the DataGrid to highlight cells that are outside an acceptable range. Each row has a button column (CommandName='Select'), that is used to display addtional...
5
by: Nathan Sokalski | last post by:
I have a control that I want displayed in all items except the last one. I figured the best way to do this was to determine whether the current item was the last from within the ItemDataBound event...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
0
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...

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.