Hello and Good Day. REALLY LOST.
Running ASP.NET 1.1
Becuase I think I'm using my own controls smartnavigation does not
appear to work for me.
Stardard issue: I've got a datagrid thats displaying pages and pages of
rows. When I edit some row below pages 1 the post refreshes back to
page one, requiring me to page down to do the input.
I have found some C# code that looks promising, but can't seem to make
it work in VB ..
I'm just taking shots in the dark now.
When I attempt to execute this code I get javascript error that
responsible is not defined. when I view source, ofcourse the datagrid
has used clientid to rename ids.. something like:
id="UserGrid__c tl2_responsible "
Below is my really bad attempt at getting this to work:
<beginning of code>
Public Sub UserGrid_Edit (Source As Object, E As
DataGridCommand EventArgs)
UserGrid.EditIt emIndex = E.Item.ItemInde x
BindData()
' the below code is to force dropdown to display preset value in
database first so
'update does not take the wrong value!
'make dropdowns remember current value
Dim ddlResponsible As DropDownList =
UserGrid.Items( e.Item.ItemInde x).FindControl( "responsibl e")
Dim colIndex As Integer = 2
Dim resp As String = CType(e.Item.Ce lls(colIndex).C ontrols(1),
Label).Text.Tri m
For I As Integer = 0 To ddlResponsible. Items.Count - 1
If ddlResponsible. Items(I).Text.T rim.Equals(resp ) Then
ddlResponsible. SelectedIndex = I
Exit For
End If
Next
Dim ddlstatus As DropDownList =
UserGrid.Items( e.Item.ItemInde x).FindControl( "status")
Dim colIndexb As Integer = 3
Dim stat As String = CType(e.Item.Ce lls(colIndexb). Controls(1),
Label).Text.Tri m
For I As Integer = 0 To ddlstatus.Items .Count - 1
If ddlstatus.Items (I).Text.Trim.E quals(stat) Then
ddlstatus.Selec tedIndex = I
Exit For
End If
Next
'here's where trying to focus, but can't figure out how to address the
new id
Dim strBuilder As StringBuilder = New StringBuilder()
strBuilder.Appe nd("<script language='javas cript'>function
window.onload() {")
strBuilder.Appe nd("
document.elemen ts(responsible. clientid).focus ();")
strBuilder.Appe nd("}"+chr(60)+ "/script>")
RegisterStartup Script("FR", strBuilder.ToSt ring)
End Sub
<end of code>
And, while on the subject - is there any way in javascript to just go
to the second field? in this case its a dropdown select.
Here are my two senseless attempts.
<body onload="documen t.forms[0].fields[1].focus()">
does not work, nor does
<body onload="documen t.forms[0].elementsbyid(( *responsible'). focus()">
THANK YOU FOR ANY HELP OR INFORMATION!!!! 2 1965
I have a sample in VB that sets the focus to the edit box: http://www.webswapp.com/webswapp.aspx?i=11
--- www.societopia.net
"ja***@cyberpin e.com" wrote: Hello and Good Day. REALLY LOST.
Running ASP.NET 1.1
Becuase I think I'm using my own controls smartnavigation does not appear to work for me.
Stardard issue: I've got a datagrid thats displaying pages and pages of rows. When I edit some row below pages 1 the post refreshes back to page one, requiring me to page down to do the input.
I have found some C# code that looks promising, but can't seem to make it work in VB ..
I'm just taking shots in the dark now.
When I attempt to execute this code I get javascript error that responsible is not defined. when I view source, ofcourse the datagrid has used clientid to rename ids.. something like: id="UserGrid__c tl2_responsible "
Below is my really bad attempt at getting this to work:
<beginning of code>
Public Sub UserGrid_Edit (Source As Object, E As DataGridCommand EventArgs) UserGrid.EditIt emIndex = E.Item.ItemInde x BindData()
' the below code is to force dropdown to display preset value in database first so 'update does not take the wrong value!
'make dropdowns remember current value Dim ddlResponsible As DropDownList = UserGrid.Items( e.Item.ItemInde x).FindControl( "responsibl e") Dim colIndex As Integer = 2 Dim resp As String = CType(e.Item.Ce lls(colIndex).C ontrols(1), Label).Text.Tri m For I As Integer = 0 To ddlResponsible. Items.Count - 1 If ddlResponsible. Items(I).Text.T rim.Equals(resp ) Then ddlResponsible. SelectedIndex = I Exit For End If Next
Dim ddlstatus As DropDownList = UserGrid.Items( e.Item.ItemInde x).FindControl( "status") Dim colIndexb As Integer = 3 Dim stat As String = CType(e.Item.Ce lls(colIndexb). Controls(1), Label).Text.Tri m For I As Integer = 0 To ddlstatus.Items .Count - 1 If ddlstatus.Items (I).Text.Trim.E quals(stat) Then ddlstatus.Selec tedIndex = I Exit For End If Next
'here's where trying to focus, but can't figure out how to address the new id
Dim strBuilder As StringBuilder = New StringBuilder() strBuilder.Appe nd("<script language='javas cript'>function window.onload() {") strBuilder.Appe nd(" document.elemen ts(responsible. clientid).focus ();") strBuilder.Appe nd("}"+chr(60)+ "/script>") RegisterStartup Script("FR", strBuilder.ToSt ring)
End Sub
<end of code>
And, while on the subject - is there any way in javascript to just go to the second field? in this case its a dropdown select. Here are my two senseless attempts.
<body onload="documen t.forms[0].fields[1].focus()">
does not work, nor does
<body onload="documen t.forms[0].elementsbyid(( *responsible'). focus()">
THANK YOU FOR ANY HELP OR INFORMATION!!!!
I have a sample in VB that sets the focus to the edit box: http://www.webswapp.com/webswapp.aspx?i=11
--- www.societopia.net
"ja***@cyberpin e.com" wrote: Hello and Good Day. REALLY LOST.
Running ASP.NET 1.1
Becuase I think I'm using my own controls smartnavigation does not appear to work for me.
Stardard issue: I've got a datagrid thats displaying pages and pages of rows. When I edit some row below pages 1 the post refreshes back to page one, requiring me to page down to do the input.
I have found some C# code that looks promising, but can't seem to make it work in VB ..
I'm just taking shots in the dark now.
When I attempt to execute this code I get javascript error that responsible is not defined. when I view source, ofcourse the datagrid has used clientid to rename ids.. something like: id="UserGrid__c tl2_responsible "
Below is my really bad attempt at getting this to work:
<beginning of code>
Public Sub UserGrid_Edit (Source As Object, E As DataGridCommand EventArgs) UserGrid.EditIt emIndex = E.Item.ItemInde x BindData()
' the below code is to force dropdown to display preset value in database first so 'update does not take the wrong value!
'make dropdowns remember current value Dim ddlResponsible As DropDownList = UserGrid.Items( e.Item.ItemInde x).FindControl( "responsibl e") Dim colIndex As Integer = 2 Dim resp As String = CType(e.Item.Ce lls(colIndex).C ontrols(1), Label).Text.Tri m For I As Integer = 0 To ddlResponsible. Items.Count - 1 If ddlResponsible. Items(I).Text.T rim.Equals(resp ) Then ddlResponsible. SelectedIndex = I Exit For End If Next
Dim ddlstatus As DropDownList = UserGrid.Items( e.Item.ItemInde x).FindControl( "status") Dim colIndexb As Integer = 3 Dim stat As String = CType(e.Item.Ce lls(colIndexb). Controls(1), Label).Text.Tri m For I As Integer = 0 To ddlstatus.Items .Count - 1 If ddlstatus.Items (I).Text.Trim.E quals(stat) Then ddlstatus.Selec tedIndex = I Exit For End If Next
'here's where trying to focus, but can't figure out how to address the new id
Dim strBuilder As StringBuilder = New StringBuilder() strBuilder.Appe nd("<script language='javas cript'>function window.onload() {") strBuilder.Appe nd(" document.elemen ts(responsible. clientid).focus ();") strBuilder.Appe nd("}"+chr(60)+ "/script>") RegisterStartup Script("FR", strBuilder.ToSt ring)
End Sub
<end of code>
And, while on the subject - is there any way in javascript to just go to the second field? in this case its a dropdown select. Here are my two senseless attempts.
<body onload="documen t.forms[0].fields[1].focus()">
does not work, nor does
<body onload="documen t.forms[0].elementsbyid(( *responsible'). focus()">
THANK YOU FOR ANY HELP OR INFORMATION!!!!
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: ED M. |
last post by:
Hello all...I'm new to the board. I have a problem that I hope someone here
might be able to solve for me.
I am doing some clientside validation using Javascript. The text I am
testing is within a textbox that is part of a datagrid. To complicate
things, the datagrid is part of a user control. The following code is all
part of the user control.
The validation part of the script works fine. However, when I try to set
the focus...
|
by: Shravan |
last post by:
Hi,
I have a Windows Forms Custom DataGrid, which is put in a
usercontrol, which on setting DataSource is setting focus
to grid. The call stack for setting the focus is as
follows. This is not happened always whenever DataSource
is set, only called sometimes, in a series of setting
DataSource, I could get this setting focus only one time .
Can anybody help me how to stop this one.
system.windows.forms.dll!
|
by: JoRo |
last post by:
I am working on a project where I want a very user-friendly interface.
I have a datagrid of categories that uses the EditCommandColumn to do
in-line editing of the category name. On the page is also a textbox
field with an "Add" button to create new categories (This is outside of
the datagrid).
When the page first loads I use
Page.RegisterHiddenField("__EVENTTARGET", "btnAdd");
|
by: Mark Rae |
last post by:
Hi,
VS.NET 2003 on WinXPPro, both with all the latest patches and updates,
etc...
I've got a very simple WebForm which is used either to add a new record to a
SQL Server database or edit a record. Depending on whether I'm adding or
editing, I need to do slightly different validation, so I'm trying to set
the form's Save button's onclick property dynamically at run-time
client-side with JavaScript, as follows:
|
by: Nate Hekman |
last post by:
I'm making a simple page with an edit box and a Submit button. When a user
arrives at the page, I'd like the focus to be in the edit box. I can do it
with javascript, but it seems to me there must be a way to do it with
asp.net. What's the "proper" way to do this?
Thanks.
Nate Hekman
Calgary, Alberta, Canada
| |
by: Bonj |
last post by:
Hi
I've got an ASP.NET datagrid control, and in the footer, there is a series
of controls for typing in new values to add an item.
e.g.
<asp:DataGrid runat="Server".... >
<Columns>
...
<asp:TemplateColumn HeaderText="Name">
...
<FooterTemplate>
|
by: Jerry Camel |
last post by:
Once the datalist is in edit mode and the text boxes and all happily appear,
how can I force the textbox to be the control with focus, so the user can
start editing without having to click the textbox first? Thanks.
Jerry
|
by: DC |
last post by:
Hi,
I am doing something like this in the ItemCreated event (ASP.Net 1.1):
DataGridItem pagerRow = e.Item;
TableCell pagerCell = pagerRow.Cells;
Control addedControl = new Control();
addedControl.ID = "addedControl";
pagerCell.Controls.Add(addedControl);
|
by: Brad Isaacs |
last post by:
Good morning friends,
I am working with Visual Studio 2005, ASP.NET 2.0
I am working with the Login controls provided my .NET 2.0, trying to make
the Login1 control UserName textbox obtain SetFocus upon load of the .aspx
web page but I cannot for the life of me get this to work. I tried using
the defaultfocus on the Form but that did not work.
|
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,...
|
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...
| |
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...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |