CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

MS SQL 2008 on ASP.NET Hosting
Free 3 Months



Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 6/7/2004 1:57:41 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 4 Views: 93 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
5 Items, 1 Pages 1 |< << Go >> >|
sieggy
Asp.Net User
Setting check box state in custom datagrid6/7/2004 1:57:41 PM

0/0

I have a custom extension of the datagrid that I have been building. The data grid includes a check box column (checking the column does not immediately post pack, the user can select a button to initiate that). I'm trying to get the boxes that were selected but I'm not sure how I can do this. Any suggestions would be appreciated.

Thanks,

Sieg
sieggy
Asp.Net User
Re: Setting check box state in custom datagrid6/7/2004 2:57:43 PM

0/0

Some additional information but my trying to figure this out. The grid I'm building uses custom Template Columns, built programatically and the grid itself exists as a member of a composite control. On the post back the composite c'str is called immediately, followed by CreateChildControls. So I have no choice but to rebuild the grid and add them. No "value" in the composite is set when I put a breakpoint in the c'str before I reallocate the grid. I had a simplier issue (TextBox in a composite) and implemented INamingContainer solved the issue. The basic question is how do I get information from client side changes to register themselves with my controls on postback? Is there additional work or code that I have to do. I've seen examples reading values from a normal datagrid with a template column (using checkboxes) and they simply walk through the grid's items, of which I have none on postback.

Thx again,

Sieg
AndrewSeven
Asp.Net User
Re: Setting check box state in custom datagrid6/7/2004 3:22:09 PM

0/0

How about using the checked changed event.
sieggy
Asp.Net User
Re: Setting check box state in custom datagrid6/7/2004 3:54:49 PM

0/0

My final grid needs to have support for about 25 items per page. Doing a server post for each check click would be too slow for the user. I know the state can be posted back (I've seen examples similiar to what I'm doing relying on such techniques). I'm guessing that perhaps it is a naming problem. Trying a much simplier example with a small composite control to see if can nail down the error.

sieggy
Asp.Net User
Re: Setting check box state in custom datagrid6/7/2004 6:38:12 PM

0/0

After considerably more debugging the problem seems to stem from when CreateChildControls is called for a Composite Control. For a regular page call it is called after Page_Load and all your expected db calls, page construction code, etc. On a post back, CreateChildControls is called BEFORE Page_Load. Handlers so such things as buttons or paging links are called after both CreateChildControls and Page_Load. The framework will then rehydrate state from all your controls as long they were constructed in the CreateChildControls call. No control alloc'd in the method (or in the Composite's c'str) and no rehydration.

The best method I am using for now is storing the data being bound to, rebinding the grid in CreateChildControls to recover its control structure. I then recover the check box state and process paging links, etc. The drawback is that for clicking my Next link for instance is that I bind twice. However, as I cache the data source, I do not make multiple db calls.

It appears I'm back an track but feel free to share any additional brilliance on the subject :-)

Sieggy
5 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
ADO.NET Cookbook Authors: Bill Hamilton, Pages: 605, Published: 2003
Foundation Flash CS3 for Designers Authors: Thomas J Green, Tom Green, David Stiller, Pages: 570, Published: 2007
Sams Teach Yourself ASP.NET in 21 Days Authors: Chris Payne, Pages: 1104, Published: 2002
Pro ASP.NET 2.0 in C# 2005 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1255, Published: 2005
Pro ASP.NET 2.0 in VB 2005: From Professional to Expert Authors: Laurence Moroney, Matthew MacDonald, Pages: 1253, Published: 2006
Sams Teach Yourself Visual Basic .NET Web Programming in 21 Days Authors: Peter Aitken, Phil Syme, Pages: 544, Published: 2001
.NET Programming 10-minute Solutions: 10-Minute Solutions Authors: A. Russell Jones, Mike Gunderloy, Pages: 433, Published: 2004
Professional ASP.NET 2.0 Databases Authors: Thiru Thangarathinam, Pages: 504, Published: 2007
Flex 3 Cookbook: Code-Recipes, Tips, and Tricks for RIA Developers Authors: Joshua Noble, Joey Lott, Todd Anderson, Chafic Kazoun, Pages: 673, Published: 2008
Cobol Programming Using the .NET Framework Authors: Ron Reeves, Pages: 336, Published: 2002

Web:
Maintaining checkbox "checked" state in ASP.NET DataGrid When I get the PostBack, I loop thru the DataGrid, check the state of the .... and added a custom event that was fired from the CheckBox's "CheckedChanged" ...
Building a Full-Featured Custom DataGrid Control - developerFusion ... Your Datagrid is very useful. I have built a custom DG with paging set for Months .... Items In A DataGrid/GridView - Part 2: Maintaining CheckBox State Acr ...
CodeProject: Implementing Custom DataGrid Selection Column Step by ... Feb 20, 2008 ... Now you have to set two inherited properties of our custom column ... you are able to add a check box column with check All , uncheck All ...
Want bi-state not tri-state checkbox in datagrid I am adding a checkbox to a datagrid in the normal way (see below), but I end up with a tri-state checkbox. I only want a bi-state one and I ...
Alex’s Flex Closet: CheckBox selection in DataGrid and List Feb 29, 2008 ... Using just a custom function for selection with inthe checkBox ... Both require storing some knowledge of the selection state in the ...
Selecting, Confirming & Deleting Multiple Checkbox Items In A ... Nor is the DataGrid set up in allowing a way of adding a main "select all" checkbox to easily select all of the boxes, and then applying any particular ...
Adding a CheckBox to a DataGrid at Runtime required that I create a custom CheckBox class, which I thought was the long way around. > 3. Use the DataGrid events. ...
Check box column and datagrid paging (Windows Control) : Windows ... I am using a simple windows custom paging functionality described here ... Is there a way to maintain the edited checkbox state of items between pages? ...
How to use a checkbox in a datagrid template column. can anybody help me how to check the state of a check box with out setting autopost back =true. # re: How to use a checkbox in a datagrid template column. ...
DataGrid and CheckBox Controls DataGrid and CheckBox Controls By Sushila Patel June 17, 2003 ... and then allow the user to click on it and record the new checkbox state in the database. ...




Search This Site:










my own regiser and login page

allow user to change windows account password from web

forms authentication over ldaps -- problem

membership provider

localizing failuretext

problem with login

problem configuring membership provider

asp.net 2.0 security question

web.config for sub-directory

system.web.httpexception issue

error using form authentication method.

controls embedded within the loginview control cannot be accessed in code-behind?

problem with windows authentication

help configuring partial trust asp.net app..

hashing password

login control only works on certain pages

use profile in base class

asp.net 2.0

strangest thing ever o_o

message queue problem.

createuserwizard error event

onloggingin event does not fire from the login control

user database for 2 different websites

authentication - timeout ,path details

please help with https page

128 bit encryption

extend sqlmembershipprovider, add my own web.config attributes

custom username in login view

how to protect against xsrf (cross site request forgery)?

adding user to role in code gives duplicate user - please help?

  Privacy | Contact Us
All Times Are GMT