473,401 Members | 2,127 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,401 software developers and data experts.

Databind and event

Hi all
Do I have to call my databind event for my control in the page_load event? I
try to call my databind event for my contorl in the loadcomplete event. but
seems it doesn't work at all

Pls help.
Cheers
May 21 '07 #1
4 1529
On May 21, 11:09 am, "Victor" <vic...@noemail.noemailwrote:
Hi all
Do I have to call my databind event for my control in the page_load event? I
try to call my databind event for my contorl in the loadcomplete event. but
seems it doesn't work at all

Pls help.
Cheers
Hi,

After load the new data .... do call the databind function...
i.e. grid.databind();
it could be in page load and in some events also

Thanks
Masudur

May 21 '07 #2
Hi Victor,

How is your complete page code looks like? According to ASP.NET Page Life
Cycle (http://msdn2.microsoft.com/en-us/library/ms178472.aspx), there's
only Control events between the Page's Load and LoadComplete event. Also,
I've tested using a simple webpage and following code works:

protected void Page_Load(object sender, EventArgs e)
{
this.LoadComplete += new EventHandler(_Default_LoadComplete);
}

void _Default_LoadComplete(object sender, EventArgs e)
{
BindGrid();
}

private void BindGrid()
{
DataTable dt = new DataTable();
dt.Columns.Add("Name");
dt.Rows.Add("Test");
GridView1.DataSource = dt;
GridView1.DataBind();
}
Please post your code. Thanks.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.


May 21 '07 #3
Hi Victor,

Have you seen my last reply? Please reply here if you want to continue work
on this. Thanks.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

May 24 '07 #4
Hi Walter.
The truth is I didn't reslove my problem. And I have no idea what is going
on there. My assumption is my onitembound method is my customized control is
not working properly, or not been updated after postback..
Anyway. i have changed my control and used another way. let's leave it for
now..
Thanks a lot for your help.

Cheers
Victor

"Walter Wang [MSFT]" <wa****@online.microsoft.comwrote in message
news:6j**************@TK2MSFTNGHUB02.phx.gbl...
Hi Victor,

Have you seen my last reply? Please reply here if you want to continue
work
on this. Thanks.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no
rights.

Jun 1 '07 #5

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

Similar topics

4
by: Stephen | last post by:
Hey everyone. I was wondering if someone could help me with a small problem. I have designed a user control and I would have inserted it on a aspz page (WebForm1). The User control is being used to...
3
by: Marty McDonald | last post by:
I have <asp:Table... </asp:Table> on my webform. In codebehind, I populate a DataTable whose data should appear in the asp:Table. I created my own code to populate the asp:Table with the...
10
by: aualias | last post by:
This seems like such a lame question, but how do you bind to a CheckBox with ASP.NET? With Windows Forms there is a DataBindings collection. I do not see it with the web version of the control,...
0
by: Bryce Budd | last post by:
Hi, I have a webform which has several server controls attached. The entire form is data bound to custom objects. The collection objects are cached using the Cache object. In my use case, I...
1
by: Tomislav Bartolin | last post by:
Hi, I have an aspx page which contains an ascx user control. I am using Page.DataBind in Page_Load event of the page to bind elements to page properties. The problem is the ascx uses its...
3
by: K B | last post by:
Hi again, I've narrowed down my problem and am hoping to get some help to get the final answer. Gridview with dynamic child controls loads gv1.Databind calls RowDataBound event fine On the...
2
by: cmay | last post by:
A common situation I come across is an ASCX control that being used as a lookup control. The ascx might be called "StatusLookup" or something, and it consists of 1 dropdown list that populates...
1
by: =?Utf-8?B?cmxt?= | last post by:
I have standard gridview in an updatePanel with an AJAX timer that refreshes the data every 5 seconds by calling the grids DataBind method in the tick event. This works great. However, I have a...
6
by: Jonathan Wood | last post by:
I have a databound dropdownlist control. Based on some other criteria, I need to specify the selected item in my pages Load event. The problem is that, in my load event, the control does not yet...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
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...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.