Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / June 2006

Tip: Looking for answers? Try searching our database.

template column checkbox problem in grid view

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Smokey Grindle - 27 Jun 2006 21:33 GMT
I have the following on my page... a link button that will send the command
name "use" to the command handler and a grid view with the following columns

0 - Template column - just a checkbox (asp.net control)
1 - Bound column - DisplayName from data table

the checkbox is just a template i made by placeing an asp.net control into
the item template

when I check items on the grid then click the link and execute the following
code in it

Protected Sub ToolbarCommand(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.CommandEventArgs) Handles
lnkUseRecipients.Command, lnkCancel.Command

Select Case e.CommandName.Trim.ToCharArray

Case "USE"

For Each _gvRow As GridViewRow In Me.GridView1.Rows

' perform the selected command on all checked messages

If DirectCast(_gvRow.Cells(0).Controls(1), CheckBox).Checked Then

'do something here

End If

Next

end sub

when I run through it, all the items come back as unchecked... but the
strange thing... similar method on another page doing it the same way and it
comes back with items checked! why would one post back the checked items and
the other not? what should I look for? any suggestions on how to help?
thanks!
Smokey Grindle - 27 Jun 2006 21:44 GMT
I should probably add the grid is databound to a typed collection that
inherited from the collectionbase on the page that doesnt work, and the page
that does work is tied to a datatable

>I have the following on my page... a link button that will send the command
>name "use" to the command handler and a grid view with the following
[quoted text clipped - 36 lines]
> items and the other not? what should I look for? any suggestions on how to
> help? thanks!
Smokey Grindle - 28 Jun 2006 02:01 GMT
nevermind im stupid today.. i was rebinding on postback in page load.. which
was clearing the data..

>I should probably add the grid is databound to a typed collection that
>inherited from the collectionbase on the page that doesnt work, and the
[quoted text clipped - 40 lines]
>> items and the other not? what should I look for? any suggestions on how
>> to help? thanks!

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.