|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Set focus inside a repeaterI'm using a repeater for editing, but having a devil of a time setting the
focus to a textbox inside the repeater. Does anyone have an example of how to do this? -- Thanks, CGW Try something like:
TextBox TextBox1 = (TextBox) Repeater1.FindControl("TextBox1"); TextBox1.Focus(); Since it is a repeater, you may have to go to the Row level before invoking the FindControl method. -- Show quoteChristopher A. Reed "The oxen are slow, but the earth is patient." "CGW" <C**@discussions.microsoft.com> wrote in message news:FEF26119-421B-4E03-81C0-8F5537AEC0BE@microsoft.com... > I'm using a repeater for editing, but having a devil of a time setting the > focus to a textbox inside the repeater. Does anyone have an example of how > to > do this? > -- > Thanks, > > CGW Great! I had worked around it with tabindexing but I'll give this a shot.
-- Show quoteThanks, CGW "Christopher Reed" wrote: > Try something like: > > TextBox TextBox1 = (TextBox) Repeater1.FindControl("TextBox1"); > TextBox1.Focus(); > > Since it is a repeater, you may have to go to the Row level before invoking > the FindControl method. > > -- > Christopher A. Reed > "The oxen are slow, but the earth is patient." > > "CGW" <C**@discussions.microsoft.com> wrote in message > news:FEF26119-421B-4E03-81C0-8F5537AEC0BE@microsoft.com... > > I'm using a repeater for editing, but having a devil of a time setting the > > focus to a textbox inside the repeater. Does anyone have an example of how > > to > > do this? > > -- > > Thanks, > > > > CGW > > > Didn't work. Focus, Focused, etc. don't seemed to be recogognized as members.
-- Show quoteThanks, CGW "Christopher Reed" wrote: > Try something like: > > TextBox TextBox1 = (TextBox) Repeater1.FindControl("TextBox1"); > TextBox1.Focus(); > > Since it is a repeater, you may have to go to the Row level before invoking > the FindControl method. > > -- > Christopher A. Reed > "The oxen are slow, but the earth is patient." > > "CGW" <C**@discussions.microsoft.com> wrote in message > news:FEF26119-421B-4E03-81C0-8F5537AEC0BE@microsoft.com... > > I'm using a repeater for editing, but having a devil of a time setting the > > focus to a textbox inside the repeater. Does anyone have an example of how > > to > > do this? > > -- > > Thanks, > > > > CGW > > > Are you using 1.1 or 2.0?
-- Show quoteChristopher A. Reed "The oxen are slow, but the earth is patient." "CGW" <C**@discussions.microsoft.com> wrote in message news:84C95A3E-B20F-4897-B44D-D1B408F58BDE@microsoft.com... > Didn't work. Focus, Focused, etc. don't seemed to be recogognized as > members. > -- > Thanks, > > CGW > > > "Christopher Reed" wrote: > >> Try something like: >> >> TextBox TextBox1 = (TextBox) Repeater1.FindControl("TextBox1"); >> TextBox1.Focus(); >> >> Since it is a repeater, you may have to go to the Row level before >> invoking >> the FindControl method. >> >> -- >> Christopher A. Reed >> "The oxen are slow, but the earth is patient." >> >> "CGW" <C**@discussions.microsoft.com> wrote in message >> news:FEF26119-421B-4E03-81C0-8F5537AEC0BE@microsoft.com... >> > I'm using a repeater for editing, but having a devil of a time setting >> > the >> > focus to a textbox inside the repeater. Does anyone have an example of >> > how >> > to >> > do this? >> > -- >> > Thanks, >> > >> > CGW >> >> >> Sorry... been out on vacation. We're using 1.1
-- Show quoteThanks, CGW "Christopher Reed" wrote: > Are you using 1.1 or 2.0? > -- > Christopher A. Reed > "The oxen are slow, but the earth is patient." > > "CGW" <C**@discussions.microsoft.com> wrote in message > news:84C95A3E-B20F-4897-B44D-D1B408F58BDE@microsoft.com... > > Didn't work. Focus, Focused, etc. don't seemed to be recogognized as > > members. > > -- > > Thanks, > > > > CGW > > > > > > "Christopher Reed" wrote: > > > >> Try something like: > >> > >> TextBox TextBox1 = (TextBox) Repeater1.FindControl("TextBox1"); > >> TextBox1.Focus(); > >> > >> Since it is a repeater, you may have to go to the Row level before > >> invoking > >> the FindControl method. > >> > >> -- > >> Christopher A. Reed > >> "The oxen are slow, but the earth is patient." > >> > >> "CGW" <C**@discussions.microsoft.com> wrote in message > >> news:FEF26119-421B-4E03-81C0-8F5537AEC0BE@microsoft.com... > >> > I'm using a repeater for editing, but having a devil of a time setting > >> > the > >> > focus to a textbox inside the repeater. Does anyone have an example of > >> > how > >> > to > >> > do this? > >> > -- > >> > Thanks, > >> > > >> > CGW > >> > >> > >> > > > Which explains things since my suggestions are for 2.0. With 1.1, you'll
have to figure out what the control is and use a dynamically created Javascript to set focus. You can use something like the Page.RegisterClientScriptBlock method to add your script dynamically. -- Show quoteChristopher A. Reed "The oxen are slow, but the earth is patient." "CGW" <C**@discussions.microsoft.com> wrote in message news:59E1AB63-D519-4356-A415-6B79E10BC12C@microsoft.com... > Sorry... been out on vacation. We're using 1.1 > -- > Thanks, > > CGW > > > "Christopher Reed" wrote: > >> Are you using 1.1 or 2.0? >> -- >> Christopher A. Reed >> "The oxen are slow, but the earth is patient." >> >> "CGW" <C**@discussions.microsoft.com> wrote in message >> news:84C95A3E-B20F-4897-B44D-D1B408F58BDE@microsoft.com... >> > Didn't work. Focus, Focused, etc. don't seemed to be recogognized as >> > members. >> > -- >> > Thanks, >> > >> > CGW >> > >> > >> > "Christopher Reed" wrote: >> > >> >> Try something like: >> >> >> >> TextBox TextBox1 = (TextBox) Repeater1.FindControl("TextBox1"); >> >> TextBox1.Focus(); >> >> >> >> Since it is a repeater, you may have to go to the Row level before >> >> invoking >> >> the FindControl method. >> >> >> >> -- >> >> Christopher A. Reed >> >> "The oxen are slow, but the earth is patient." >> >> >> >> "CGW" <C**@discussions.microsoft.com> wrote in message >> >> news:FEF26119-421B-4E03-81C0-8F5537AEC0BE@microsoft.com... >> >> > I'm using a repeater for editing, but having a devil of a time >> >> > setting >> >> > the >> >> > focus to a textbox inside the repeater. Does anyone have an example >> >> > of >> >> > how >> >> > to >> >> > do this? >> >> > -- >> >> > Thanks, >> >> > >> >> > CGW >> >> >> >> >> >> >> >> >> Thank you!
-- Show quoteCGW "Christopher Reed" wrote: > Which explains things since my suggestions are for 2.0. With 1.1, you'll > have to figure out what the control is and use a dynamically created > Javascript to set focus. You can use something like the > Page.RegisterClientScriptBlock method to add your script dynamically. > -- > Christopher A. Reed > "The oxen are slow, but the earth is patient." > > "CGW" <C**@discussions.microsoft.com> wrote in message > news:59E1AB63-D519-4356-A415-6B79E10BC12C@microsoft.com... > > Sorry... been out on vacation. We're using 1.1 > > -- > > Thanks, > > > > CGW > > > > > > "Christopher Reed" wrote: > > > >> Are you using 1.1 or 2.0? > >> -- > >> Christopher A. Reed > >> "The oxen are slow, but the earth is patient." > >> > >> "CGW" <C**@discussions.microsoft.com> wrote in message > >> news:84C95A3E-B20F-4897-B44D-D1B408F58BDE@microsoft.com... > >> > Didn't work. Focus, Focused, etc. don't seemed to be recogognized as > >> > members. > >> > -- > >> > Thanks, > >> > > >> > CGW > >> > > >> > > >> > "Christopher Reed" wrote: > >> > > >> >> Try something like: > >> >> > >> >> TextBox TextBox1 = (TextBox) Repeater1.FindControl("TextBox1"); > >> >> TextBox1.Focus(); > >> >> > >> >> Since it is a repeater, you may have to go to the Row level before > >> >> invoking > >> >> the FindControl method. > >> >> > >> >> -- > >> >> Christopher A. Reed > >> >> "The oxen are slow, but the earth is patient." > >> >> > >> >> "CGW" <C**@discussions.microsoft.com> wrote in message > >> >> news:FEF26119-421B-4E03-81C0-8F5537AEC0BE@microsoft.com... > >> >> > I'm using a repeater for editing, but having a devil of a time > >> >> > setting > >> >> > the > >> >> > focus to a textbox inside the repeater. Does anyone have an example > >> >> > of > >> >> > how > >> >> > to > >> >> > do this? > >> >> > -- > >> >> > Thanks, > >> >> > > >> >> > CGW > >> >> > >> >> > >> >> > >> > >> > >> > > > |
|||||||||||||||||||||||