473,769 Members | 5,878 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Default control value in detailsview control

Dear Experts,

In my web application, I have a Master/Detail display of records using
Gridview and DetailsView controls. Whenever, I made a selection of a record
from the Gridview control, the detail information of the record will be
displayed in the DetailsView control. Information in the editable in the
detailsview by allowing user to have the edit option. On top of that I also
allow user to add new record through the detailsview control.

Secondly, I have an additional button to allow the user to add record based
on 2 parameters (which I called it MainType and SubType). The filtering of
the gridview control is based on these 2 parameters. I have converted the 2
fields in the detailsview control into a TemplateField. So basically, there
are 2 sets of MainType and SubType fields which all are dropdownlist
controls.

My question is that, am I able to set the default value of the MainType and
SubType in the detailsview control when it is in "DetailsViewMod e.Insert"
mode to be same as the MainType and SubType being selected earlier. Please
advise.

Many thanks in advance.

Regards,
SB
Apr 29 '06 #1
0 1246

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

Similar topics

1
3241
by: sck10 | last post by:
Hello, I have a GridView that list all the employees in our group. My select button (link) when clicked will open a DetailsView control of the employee selected. I have one BoundField in the form that I want to fill in programatically ("UpdatedBy"). So when the user selects the "edit" link, the field is pre-populated with this value. This value needs to submitted when the user clicks "update". Any help with this would be greatly...
5
23301
by: sck10 | last post by:
Hello, I am using the code below to set the values of a DetailsView template field using FindControl. My question is how would you find a control if its a Boundfield control? For example, how would I reference the following BoundField ("NTAccount") in the Sub dvDetail_PreRender sub? Any help would be appreciated... <asp:BoundField DataField="NTAccount" HeaderText="NT Account" />
3
3127
by: stuart.d.jones | last post by:
Hi, I have a DetailsView control bound to a SqlDataSource. I've got everything working nearly as I want, but here's my problem. I have a table which has a Guid as a Primary Key, and a VarChar field (a Title) which is also unique. If the user edits the Title field in the DetailsView to make it a duplicate, and hits Update, an exception is thrown (SQLException - statement cancelled as it would violate the key restrictions).
0
1989
by: Marek | last post by:
I have DetialsView control and DropDownList control on the same page. I use DropDownList.SelectedVlue as key for DetailsView control. I use SELECT ... FROM table WHERE id_kont = @id_kont where @id_kont is equal DropDownList.SelectedValue and it is work. But when I try to do (for DetailsView control): INSERT INTO table (id_kont,....) VALUES ( @id_kont,....)
0
1636
by: tom c | last post by:
I am going through "Walkthrough: Editing and Inserting Data in Web Pages with the DetailsView Web Server Control" found at http://msdn2.microsoft.com/en-us/library/sdba1d59.aspx I am using Access instead of SQL Server. Everything works fine until I get to the last step, where I try to insert a record. When I hit the New link it lets me add the new data, but then when I hit Insert, I get the yellow page which I have paseted below. I...
0
1861
by: miketayloruk | last post by:
I'm using a detailsview control that I want to use to insert data to a table. One of the fields is a date field and I want that to default to todays date. In classic asp I would do it like this: <input name="textfield" type="text" value="<%=now()%>" /> How do I do this in ASP.NET, heere is my current code: <asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True" AutoGenerateRows="False" DataKeyNames="data_key"
3
2763
by: =?Utf-8?B?QW5nZWw=?= | last post by:
I seem to understand how the control works as long as I mated to SqlDataSource or ObjDataSource it works fine. But I do not want to flatten my design in this manner. I am interested in how I can programmatically manipulate the control. In other words maybe just use the data source then extract from the control the information do with it as I see fit. The opposite is also true. I want to be able to add or modify the data in the...
0
1111
by: esi | last post by:
New to ASP.NET so any help you can offer would be great! I have been searching the web all day to try and figure out how I can add a default value to a field on a DetailsView control. I did find a few examples on the web and I understand what the code is trying to do, but I cannot get it to work for me. Here is my code: <asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True"
1
2031
by: ranger979 | last post by:
I am using the emptydatatemplate for a gridview control. I have a detailsview control within the emptydatatemplate. In the detailsview I have a templatefield that contains an imagebutton control and a textbox control. <EmptyDataTemplate> &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <asp:DetailsView ID="DetailsView1"...
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9996
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8872
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6674
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3964
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 we have to send another system
2
3564
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.