Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > CheckBox inside DataGrid problem

Reply
Thread Tools

CheckBox inside DataGrid problem

 
 
popobawa61
Guest
Posts: n/a
 
      10-02-2003
I have a DataGrid (ID=DataGrid1) and a PlaceHolder on an aspx page. In
the Init phase of the page, I dynamically add a template column
containing a CheckBox to DataGrid1. In the Load phase of the page, I
instantiate a DataGrid (ID=DataGrid2), add a template column
containing a checkbox to that grid and then add the DataGrid to the
placeholder.

The 1st time the page is hit, no CheckBoxes are selected in either
grid. Using my browser, I select a CheckBox in both of the grids, then
navigate to another page in one of the grids, forcing a postback to
the server.

My server code checks to see if any of the CheckBoxes are checked
within either of the grids. I perform this check in 2 phases of the
page lifecycle:
1: Page_Load (after adding DataGrid2 to the PlaceHolder on the page)
2: the event handler for the clicking on a page of the DataGrid.

For DataGrid2, the CheckBox reflects my client-side check only in case
#2, whereas DataGrid1 reflects my client-side check in both case 1 &
2.

It is my understanding that when a control is added to a page, it
plays catch-up within the page life cycle until it reaches the current
phase of the page. Since the page is in the Load phase when I added
DataGrid2 to it, DataGrid2 should have loaded its PostBack data and
thus reflect the client-side change I made by the time I scan the
CheckBoxes.

Does anyone know why my CheckBoxes do not reflect client-side checks I
made within DataGrid2 within Page_Load?

Thanks, Popo
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataGrid and embeded Checkbox..How to find if checkbox clicked =?Utf-8?B?RG90TmV0RGV2?= ASP .Net 1 10-06-2006 04:11 PM
CheckBox Validation inside a Datagrid kleykir ASP .Net 0 08-18-2005 02:40 PM
Howto bind CheckBox to the datagrid/ Then update the database field when the checkbox is clicked. Joey Pang ASP .Net Datagrid Control 4 06-13-2005 02:29 AM
Assoicate a primary key with a checkbox inside a datagrid Mark ASP .Net 3 04-28-2005 02:47 AM
CheckBox template always evaluate to False even if checked in a DataGrid hosted inside a TabStrip mehul ASP .Net 0 05-03-2004 12:07 PM



Advertisments