473,748 Members | 7,142 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Datagrid ItemCreated happens Before Postback???

Hi! I'm so confused right now..

I have a Page that load a datagrid with a a bunch of radiobuttons in three
columns which are then checkes or uncheck in the ItemCreated.(it 's supposed
to be a permission setting for different things in my application)
There is a save button on the page to save the permissions set in the grid.

The BindGrid() is called if it is NOT a postback in the PageLoad.

Then, in debugging, when the User presses the Save button update the
permissions, for some reason.. the ItemCreated is breaking before I have
even gotten to the PageLoad... and in there the Radiobuttons are set so that
the radiobutton for "no access" is checked, this means the selection of
Radiobuttons the user made is overwritten.

THEN is goes to the PageLoad and THEN is updates the Permissions... thru the
btnSave_Click()

Why on Earth is the ItemCreated Happening before the PageLoad...??? I see no
point in this and is there a way to stop it from happening?

Best Regards/
Lars
Nov 18 '05 #1
1 1373
I believe I fought with this before too. I think I moved my stuff to the
ItemDataBound event to make it happy.

Greg

"Lars Netzel" <[stop_spam]@host.topdomain > wrote in message
news:ev******** *******@TK2MSFT NGP14.phx.gbl.. .
Hi! I'm so confused right now..

I have a Page that load a datagrid with a a bunch of radiobuttons in three
columns which are then checkes or uncheck in the ItemCreated.(it 's
supposed
to be a permission setting for different things in my application)
There is a save button on the page to save the permissions set in the
grid.

The BindGrid() is called if it is NOT a postback in the PageLoad.

Then, in debugging, when the User presses the Save button update the
permissions, for some reason.. the ItemCreated is breaking before I have
even gotten to the PageLoad... and in there the Radiobuttons are set so
that
the radiobutton for "no access" is checked, this means the selection of
Radiobuttons the user made is overwritten.

THEN is goes to the PageLoad and THEN is updates the Permissions... thru
the
btnSave_Click()

Why on Earth is the ItemCreated Happening before the PageLoad...??? I see
no
point in this and is there a way to stop it from happening?

Best Regards/
Lars

Nov 18 '05 #2

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

Similar topics

3
4927
by: vinayak | last post by:
Hi I am displaying data in Datagrid in ASP.NET with Edit/Update functionality for each row. On the same page I have 2 Button controls which submits the request to server. These button controls are Web Control & not HTML control. One of these buttons whose title is Delete is added on the aspx page in design view & also I double clicked on this button in design view to get the onclick code for this button in the code behind page. & for...
2
1189
by: Jason | last post by:
I have a datagrid inside a user control. I use the itemcreated event to manipulate column values. I then add those values up and place the total in the footer of the datagrid. I have wrapped the function used to obtain the data for this datagrid in a page.ispostback=false condition. Everything displays accurately when an event(in the user control) posts the page back to the server, but if a control outside the user control posts the page...
2
1642
by: kgs | last post by:
I dynamically added a DropDownListBox to a footer of datagrid on itemcreated event. In which event in postback can i access the selected item. Interesting thing i noted that even though i create it, every time on postback of the page the selected item is preserved. thanks!!!
2
2399
by: Bruce W.1 | last post by:
There's something I can't figure out. I added some javascript behavior to my datagrid, just like in this article, except in C# instead of VB: http://www.dotnetbips.com/displayarticle.aspx?id=205 If I bind the datagrid to the dataset at all times, whether Postback or not, then everything works fine. However if I only bind it when Page is not Postback (just like
9
2332
by: Manuel | last post by:
I have a Datagrid with 9 elements. The problem is that when I sort the grid by a column, it present more columns than there are. This is my code for the ItemCreated event: Private pNo As Integer = 0 Private Sub grd_ItemCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles grd.ItemCreated
1
1637
by: wh1974 | last post by:
I'm not sure if i'm heading in the right direction so would appreciate any comments on what I'm trying to do. Basically I have a DataGrid on a page which has columns whose width's I set in the DataGrid's ItemCreated event and which need to be remembered after a postback. I bind to the DataGrid in the Page_Load event when PostBack is false. The DataGrid displays the data horizontally so I set the RepeatColumns
5
1358
by: Richard Myers | last post by:
Hello I have a datagrid that has a TemplatedColumn containing a dropdown list (DDL). This DDL is filled for each datagrid row via the itemcreated created event. The first time i postback none of the selections made by the user are available for each dropdownlist on the server. They all simply have values equal to the first record of the datasource.... which is not very useful.
9
6105
by: Steve | last post by:
How I can remove an AutoGenerated column? I wnat to inlcude the primary key in the resultset for creating some custom LinkButtons, but I don't want it (the PK) displayed in the DataGrid. I tried searching the columnheader text, but found that AutoGenerated columns are members of the Columns collection. From the msdn documentation: Note: When the AutoGenerateColumns property is set to true, the columns created by the DataGrid control are...
2
6758
by: DC | last post by:
Hi, I am doing something like this in the ItemCreated event (ASP.Net 1.1): DataGridItem pagerRow = e.Item; TableCell pagerCell = pagerRow.Cells; Control addedControl = new Control(); addedControl.ID = "addedControl"; pagerCell.Controls.Add(addedControl);
0
8991
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
8830
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,...
1
9321
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
8242
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
6074
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3312
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
2782
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
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.