473,499 Members | 1,576 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Aug 20 '07 #1
1 2512
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("txt CareerHi"), 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

Aug 21 '07 #2

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

Similar topics

3
4989
by: MLH | last post by:
I have a form, bound to a query. Its RecordSource property is a query named frmEnterLienAmounts. The form has a few bound controls and some unbound controls. The unbound controls are calculated...
3
19321
by: Martin | last post by:
Hi, I have a very frustrating problem that I have researched for countless hours to no avail. There are many posts asking very similar things, however none usefull in my situation. I am using VS...
7
1791
by: Max | last post by:
I've included the needed tables in the DataSource. Those tables that are bound to controls I can workwith. But how do you get access to the DataAdaptors that are not bound? me.Dataset1.table...
1
2957
by: keithb | last post by:
How can I relate data in the bound columns of a GridView control to an unbound checkbox in a template column in the same row? The checkboxes indicate which rows are to be deleted when an update...
1
3057
by: planetthoughtful | last post by:
Hi All, I have a mainform with a subform in which I show some task summary data. On the mainform I have a number of unbound controls that reflect values relevant to each task in the subform....
18
3764
by: TORQUE | last post by:
Hi, Im wondering if anyone can help me with a problem. I have a form with more than 50 unbound fields. Some of the fields will be blank from time to time. This seems to be where im having...
1
3492
by: Martin | last post by:
Hi, I'm having a problem with a datagridview control when trying to read the value of an unbound checkbox cell. The code below works fine if I click on any text cell, bound or unbound, and...
7
6765
by: ARC | last post by:
I've noticed that if you use code for the before update command for unbound controls, it doesn't really work. I tried the following: Me!ExportedYN.undo Cancel = True DoCmd.CancelEvent Exit...
2
2800
by: GISmatters | last post by:
I have unbound checkboxes in a nested gridview to allow multi-selection of "child" rows. For context, the parent gridview rows are for large "reports", the child rows are for various specific files...
0
7132
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,...
0
7009
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...
0
7178
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6899
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...
0
5475
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,...
1
4919
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4602
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...
0
1427
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 ...
1
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.