473,748 Members | 2,887 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

why does the detailsview not get the focus?

bob
Hi,
When running this code, the detailsview doesn't get the focus.
The fields of the detailsview are programmaticall y created. I use therefore
the dtreader.FieldC ount.

What's wrong with this code?
Thanks for helping.
Bob
Here part of the code:

in aspx file:
---------
....
<asp:SqlDataSou rce ID="SqlDataSour ce1" runat="server"
ConnectionStrin g="Provider = Microsoft.Jet.O LEDB.4.0; Data Source =
c:mytable"</asp:SqlDataSour ce>
<asp:DetailsVie w ID="DetailsView 1" runat="server" AutoGenerateRow s="False"
CellPadding="4" DataSourceID="S qlDataSource1" DefaultMode="In sert">
<Fields>
<asp:CommandFie ld ShowInsertButto n="True" InsertText="Bew aren"
CancelText="Opn ieuw"/>
</Fields>
</asp:DetailsView >

in aspx.vb file:
-------------
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArg s) Handles Me.Load
.....
sql = "select * from mytable;"
comd = New OleDbCommand(sq l, oConnection)
dtreader = comd.ExecuteRea der
nfield = dtreader.FieldC ount
Dim bf(nfield) As BoundField
For i = 1 To nfield
bf(i) = New BoundField
bf(i).DataField = "fld" & i
DetailsView1.Fi elds.Add(bf(i))
Next
dtreader.Close( )
.....

end sub

Protected Sub DetailsView1_It emCreated(ByVal sender As Object, ByVal e As
System.EventArg s) Handles DetailsView1.It emCreated
DetailsView1.Fo cus()
End Sub
Oct 18 '06 #1
0 1052

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

Similar topics

1
10072
by: Shawn Wildermuth | last post by:
I have a *single* SqlDataSource that loads up a single result set that I show in a GridView. In the GridView, i've added a "Select" button and handling the SelectedItem event. I also have a DetailsView (though FormView has this same issue) where I want to be able to set the current item to bind to from the DataSource. All the examples I've seen use two data sources and on every *select* they do another round-trip to the Database (which...
12
8703
by: Jim Hammond | last post by:
I am passing the whole object instead or parameters in my select and update methods. I can get the updated object if I set UpdateMethod, let ASP.NET autogenerate an update button, and then press update after making changes, but I don't want that update button. How can I get the updated object when the user presses one of my other action buttons?
1
4439
by: sck10 | last post by:
Hello, I am trying to change a value when a user goes into edit mode on a DetailsView control. I am trying to use the following, but can not figure out how to get to the bound field ("MyBoundField") to set its new value. Any help with this would be appreciated. Sub EmployeeDetailView_ModeChanged(ByVal sender As Object, ByVal e As EventArgs) Select Case CustomerDetailView.CurrentMode
2
3211
by: André | last post by:
Hi, I made a detailsview containing several fields for inserting only. I also made a dropdownlist which is invisible at start. Now, when clicking in a particular textbox, the dropdownlist must become visible (in order to put the selected value of the dropdownlist into the textbox of the detailsgrid.). I must say, the detailsview contains textboxes, but also a checkbox. I tried a lot of things, but i don't know which events to take:
0
1359
by: André | last post by:
Hi, I want I defined a detailsview connected to a datasource. The purpose is: when an user clicks into a particular field (when the focus is on that field), something must happen.My problem is: how to get that field in javascript, because i can't define an 'ID' for a boundfield. <asp:DetailsView ID="DetailsView1" runat="server" DataSourceID="SqlDataSource1" etc .../>
0
911
by: dave | last post by:
Hi, I have to know when the focus is on a specific field in a detailsview. Any way to do this? Thanks Dave
0
2552
by: mike | last post by:
Hi, When I programatically Bind a DataSource to DetailsView it does not fire "ModeChanged" event. This is first time i am trying to use ASP.NET DetailsView control. I have played with some of the sample provided by Microsoft and other comminity sites. Most of the samples were using Databinding using a DesignTime "SqlDataSource" Control and assigning its ID to DataSourceID property of DetailsView. However, in all of my application we DO...
1
5946
by: needin4mation | last post by:
Not sure what I'm doing wrong here. I have a gridview and a detailsview. The detailsview is set to insert by default. When I insert data the detailsview it works. The data goes in the database. The gridview on the page, however, never refreshes to show the new row. The sql for the gridview defaults to a LIKE % and when the page first loads I can see all the records. If after I try an edit a gridview record and delete or cancel, then...
5
3462
by: =?Utf-8?B?bXBhaW5l?= | last post by:
Hello, I am completely lost as to why I can't update a DropDownList inside a DetailsView after I perform an insert into an object datasource. I tried to simply it down to the core demostration: default.aspx:
0
8830
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,...
0
9544
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9324
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
8243
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
6074
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
4606
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2783
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
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.