Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Preset fields in detailsview.

Reply
Thread Tools

Preset fields in detailsview.

 
 
Alan Morris
Guest
Posts: n/a
 
      10-08-2006
I am trying to preset some values on a detailsview for inserting a
record. If I try:-

DetailsView1.Rows(0).Cells(1).Text = "My text2"

then the text looks like a label and is not editable - not in the
textbox of the field concerned. Am I right in thinking I have to
'cast' the boundfield in some way.

I am rather baffled by this.

Any help appreciated.

Alan
 
Reply With Quote
 
 
 
 
Phil H
Guest
Posts: n/a
 
      10-14-2006
Hi Alan

I don't know of any way to pre-enter them in the text boxes but if what
you are trying to do is create some default values then you can specify
them by configuring the INSERT command of the SqlDataSource.

Use the Propeties window for the DataSource not the "Configure
DataSource" wizard. You'll be able to link the parameters to the
DetailsView control and specify default values.

One way you could indicate default values to the user is to edit the
Head text of the field something like this:

First name (Fred)
Last name (Blogs)

 
Reply With Quote
 
 
 
 
Phil H
Guest
Posts: n/a
 
      10-14-2006
Hi Again Alan

A further thought. You might consider using a FormView rather than a
DetailsView for entering new records. Its all based on templates and
you'll have more control over the appearance in different modes.

 
Reply With Quote
 
Alan Morris
Guest
Posts: n/a
 
      10-16-2006
Phil,

Thanks your reply, what I am trying to do is create a data entry form,
where certain fields will be common from one record to the next. Thus
to save the user retyping everything I was planning to catch the
relevant fields from the previous submit and use these values to
populate the form.

Hope that makes sense.

Regards,


On 13 Oct 2006 18:14:34 -0700, "Phil H" <(E-Mail Removed)> wrote:

>Hi Again Alan
>
>A further thought. You might consider using a FormView rather than a
>DetailsView for entering new records. Its all based on templates and
>you'll have more control over the appearance in different modes.


 
Reply With Quote
 
Alan Morris
Guest
Posts: n/a
 
      11-23-2006
Phil,

Thanks your further reply, I researched your idea of a FormView and
came up with some suggestions on the web of how to achieve what I
wanted with such. I was then able to apply these to the details view
in the following way:-

I converted the relevant fiellds of the DetailsView to Template items
and then set the value of each of these as follows:-

DirectCast(Me.DetailsView1.FindControl("TextBox1") , TextBox).Text =
expression.

Thanks again.

On 13 Oct 2006 18:14:34 -0700, "Phil H" <(E-Mail Removed)> wrote:

>Hi Again Alan
>
>A further thought. You might consider using a FormView rather than a
>DetailsView for entering new records. Its all based on templates and
>you'll have more control over the appearance in different modes.


 
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
Question about preset zoom on TVs and DVD players. Peter Jason DVD Video 0 07-08-2006 12:48 AM
switching tgo a preset ip address Jeff Wireless Networking 1 12-31-2005 09:59 PM
White-balance preset question Cooter Digital Photography 12 06-24-2004 02:34 PM
Any software that will shut down computer at preset time? John Computer Support 5 06-23-2004 02:22 PM
What are the WB setting in Landscape preset - OLY 740 Michael Badt Digital Photography 2 05-09-2004 04:33 PM



Advertisments