DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Mon, 20 Aug 2007 14:34:09 -0700,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    unknown
          2    mike


unbound controls in GridView   
Hi,
I got a grid control, i bind it to a datatable, but it has some extra
fields, with textboxes, checkboxes, dropdowns etc (in a template
field) that are not bound. they are not auto-postback either. user
changes values in them, then clicks submit. anybody knows how i can
get the values in those controls, per each record? (ideally, i could
know which record's controls have been updated  and get only to them.
then i have my own code to deal with those new values)

thanks
Date:Mon, 20 Aug 2007 14:34:09 -0700   Author:  

Re: unbound controls in GridView   
I do something similar with my GridViews. In view mode, I just have a
representaton of the value. When I switch to Edit mode is when I want
to show my checkboxes and such.

To get values out of them you need to handle the GridView.RowUpdating
event. The code below (my GridView.RowUpdating event) finds the
txtCareerHi control in the selected GridView row and mirrors it in a
TextBox control stored in memory. On my form, the TextBox is a multi-
line TextBox and I want to preserve the vbCrLf characters. The funny
thing is that in view mode, I need to render them as HTML "<br />"
tags while in the TextBox, I need vbCrLf. I store the <br /> tags in
my database.

        ' converts vbCrLf to <br /> tag for browser display. The <br /

> tags are stored in the database

        Dim career As TextBox
        career =
CType(gridCareer.Rows(e.RowIndex).FindControl("txtCareerHi"), TextBox)

        Dim strCareer As String
        strCareer = career.Text.Replace(vbCrLf, "<br />")

        e.NewValues.Add("career_hi", strCareer)

        gridCareer.DataBind()


My problem is that the values I want for my RadioButtonLists and
DropDownLists are stored in my database. I need a value and text. How
can I bind the RadioButtonList with value and text properties? They
only exist when the row enters Edit mode.

Cheers
Mike
Date:Mon, 20 Aug 2007 17:08:15 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us