Home All Groups Group Topic Archive Search About

Set focus inside a repeater

Author
6 Jun 2006 6:19 PM
CGW
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

Author
12 Jun 2006 1:18 AM
Christopher Reed
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."

Show quote
"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
Author
12 Jun 2006 1:54 PM
CGW
Great! I had worked around it with tabindexing but I'll give this a shot.
--
Thanks,

CGW


Show quote
"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
>
>
>
Author
16 Jun 2006 8:53 PM
CGW
Didn't work. Focus, Focused, etc. don't seemed to be recogognized as members.
--
Thanks,

CGW


Show quote
"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
>
>
>
Author
5 Jul 2006 11:23 AM
Christopher Reed
Are you using 1.1 or 2.0?
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

Show quote
"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
>>
>>
>>
Author
12 Jul 2006 2:18 PM
CGW
Sorry... been out on vacation. We're using 1.1
--
Thanks,

CGW


Show quote
"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
> >>
> >>
> >>
>
>
>
Author
13 Jul 2006 11:41 AM
Christopher Reed
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."

Show quote
"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
>> >>
>> >>
>> >>
>>
>>
>>
Author
13 Jul 2006 8:06 PM
CGW
Thank you!
--


CGW


Show quote
"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
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>
>

AddThis Social Bookmark Button