Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Input validation on detailsview

Reply
Thread Tools

Input validation on detailsview

 
 
=?Utf-8?B?S2plbGwgQXJuZQ==?=
Guest
Posts: n/a
 
      06-01-2006
Hi!

I have a detailsview control in a webpart with some templated fields on. I
set the ValidationGroup property to som value on these fields to distinguish
from other web parts on the page. However, I'm not able to set the same
ValidationGroup on the submit controls on the detailsview. Those
linkbuttons(update, insert) are auto generated now.

1. Is it possible to set ValidationGroup on the detailsview?
2. How would I go about implementing the linkbuttons myself? Could you
please provide an example. Want the same functionality as the build in
linkbuttons give me.
3. Any other way (best practice)?

Thanks in advance.

Kjelli
 
Reply With Quote
 
 
 
 
=?Utf-8?B?S2plbGwgQXJuZQ==?=
Guest
Posts: n/a
 
      06-02-2006
Can you please provide some more details?
The detailsview is already using templates for the fields (ItemTemplate and
EditItemTemplate based on IBindableTemplate).

If I set AutoGenerateInsertButton = false, and create my own button with
CommandName = "New", wouldn't the detailsview provide the Insert (without
ValidationGroup property set) and Cancel buttons for me? I don't see how I
can replace all linkbuttons with my own implementation. I fail to see the
template here.

Code sample?

Thanks for your reply by the way


!
"Brock Allen" wrote:

> You can provide a template for the buttons and as long as you assign well-known
> CommandName properties to the Button's then they'll behavor the same. The
> well-known values are: "Edit", "Update", "Cancel", "Delete" and "New", IIRC.
>
> -Brock
> http://staff.develop.com/ballen
>
>
> > Hi!
> >
> > I have a detailsview control in a webpart with some templated fields
> > on. I set the ValidationGroup property to som value on these fields to
> > distinguish from other web parts on the page. However, I'm not able to
> > set the same ValidationGroup on the submit controls on the
> > detailsview. Those linkbuttons(update, insert) are auto generated
> > now.
> >
> > 1. Is it possible to set ValidationGroup on the detailsview?
> > 2. How would I go about implementing the linkbuttons myself? Could you
> > please provide an example. Want the same functionality as the build in
> > linkbuttons give me.
> > 3. Any other way (best practice)?
> > Thanks in advance.
> >
> > Kjelli
> >

>
>
>

 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      06-02-2006
Something like this:

<aspetailsView runat="server" ..... >
<Fields>
<asp:TemplateField>
<ItemTemplate>
<asp:Button runat="server" Text="Edit" CommandName="Edit" />
</ItemTemplate>
<EditItemTemplate>
<asp:Button runat="server" Text="Update" CommandName="Update"
ValidationGroup="YourValGroup" />
<asp:Button runat="server" Text="Cancel" CommandName="Cancel"
/>
</EditItemTemplate>
</asp:TemplateField>
</Fields>
</aspetailsView>

-Brock
http://staff.develop.com/ballen


> Can you please provide some more details?
> The detailsview is already using templates for the fields
> (ItemTemplate and
> EditItemTemplate based on IBindableTemplate).
> If I set AutoGenerateInsertButton = false, and create my own button
> with CommandName = "New", wouldn't the detailsview provide the Insert
> (without ValidationGroup property set) and Cancel buttons for me? I
> don't see how I can replace all linkbuttons with my own
> implementation. I fail to see the template here.
>
> Code sample?
>
> Thanks for your reply by the way
>
> !
> "Brock Allen" wrote:
>> You can provide a template for the buttons and as long as you assign
>> well-known CommandName properties to the Button's then they'll
>> behavor the same. The well-known values are: "Edit", "Update",
>> "Cancel", "Delete" and "New", IIRC.
>>
>> -Brock
>> http://staff.develop.com/ballen
>>> Hi!
>>>
>>> I have a detailsview control in a webpart with some templated fields
>>> on. I set the ValidationGroup property to som value on these fields
>>> to distinguish from other web parts on the page. However, I'm not
>>> able to set the same ValidationGroup on the submit controls on the
>>> detailsview. Those linkbuttons(update, insert) are auto generated
>>> now.
>>>
>>> 1. Is it possible to set ValidationGroup on the detailsview?
>>> 2. How would I go about implementing the linkbuttons myself? Could
>>> you
>>> please provide an example. Want the same functionality as the build
>>> in
>>> linkbuttons give me.
>>> 3. Any other way (best practice)?
>>> Thanks in advance.
>>> Kjelli
>>>



 
Reply With Quote
 
=?Utf-8?B?S2plbGwgQXJuZQ==?=
Guest
Posts: n/a
 
      06-26-2006
Thank you Allen! Worked like a charm!

"Brock Allen" wrote:

> Something like this:
>
> <aspetailsView runat="server" ..... >
> <Fields>
> <asp:TemplateField>
> <ItemTemplate>
> <asp:Button runat="server" Text="Edit" CommandName="Edit" />
> </ItemTemplate>
> <EditItemTemplate>
> <asp:Button runat="server" Text="Update" CommandName="Update"
> ValidationGroup="YourValGroup" />
> <asp:Button runat="server" Text="Cancel" CommandName="Cancel"
> />
> </EditItemTemplate>
> </asp:TemplateField>
> </Fields>
> </aspetailsView>
>
> -Brock
> http://staff.develop.com/ballen
>
>
> > Can you please provide some more details?
> > The detailsview is already using templates for the fields
> > (ItemTemplate and
> > EditItemTemplate based on IBindableTemplate).
> > If I set AutoGenerateInsertButton = false, and create my own button
> > with CommandName = "New", wouldn't the detailsview provide the Insert
> > (without ValidationGroup property set) and Cancel buttons for me? I
> > don't see how I can replace all linkbuttons with my own
> > implementation. I fail to see the template here.
> >
> > Code sample?
> >
> > Thanks for your reply by the way
> >
> > !
> > "Brock Allen" wrote:
> >> You can provide a template for the buttons and as long as you assign
> >> well-known CommandName properties to the Button's then they'll
> >> behavor the same. The well-known values are: "Edit", "Update",
> >> "Cancel", "Delete" and "New", IIRC.
> >>
> >> -Brock
> >> http://staff.develop.com/ballen
> >>> Hi!
> >>>
> >>> I have a detailsview control in a webpart with some templated fields
> >>> on. I set the ValidationGroup property to som value on these fields
> >>> to distinguish from other web parts on the page. However, I'm not
> >>> able to set the same ValidationGroup on the submit controls on the
> >>> detailsview. Those linkbuttons(update, insert) are auto generated
> >>> now.
> >>>
> >>> 1. Is it possible to set ValidationGroup on the detailsview?
> >>> 2. How would I go about implementing the linkbuttons myself? Could
> >>> you
> >>> please provide an example. Want the same functionality as the build
> >>> in
> >>> linkbuttons give me.
> >>> 3. Any other way (best practice)?
> >>> Thanks in advance.
> >>> Kjelli
> >>>

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to validate input of a detailsview? Cas ASP .Net Web Controls 2 10-20-2006 04:05 PM
how to validate input of a detailsview? Cas ASP .Net Datagrid Control 2 10-20-2006 04:05 PM
how to validate input of a detailsview? Cas ASP .Net 2 10-20-2006 04:05 PM
Detailsview control for data input Alan Morris ASP .Net Web Controls 1 10-08-2006 10:59 AM
DetailsView - Changing to Insert Mode (Not By Using the Insert Button In the DetailsView Control) Feege ASP .Net Web Controls 0 12-20-2005 12:28 AM



Advertisments