473,385 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Input validation on detailsview

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
Jun 1 '06 #1
4 7702
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

Jun 1 '06 #2
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


Jun 2 '06 #3
Something like this:

<asp:DetailsView 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>
</asp:DetailsView>

-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

Jun 2 '06 #4
Thank you Allen! Worked like a charm!

"Brock Allen" wrote:
Something like this:

<asp:DetailsView 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>
</asp:DetailsView>

-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


Jun 26 '06 #5

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

Similar topics

1
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...
12
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...
3
by: jparlato | last post by:
I'm using the detailsview to perform edit and insert of new records via an object datasource. If an error occurs on the insert, I want to preserve the data the operator tried to input, along with...
0
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...
1
by: Microsoft News Group | last post by:
I am trying to validate two textboxes as their values are the same, or both are null do not insert the data. I do not just want one to try to be null, I want both of them, so the requirevalidator...
2
by: Cas | last post by:
Hi, I use a detailsview control for inputtng data. I want to check the user input before it is sent to the database (min. /max value, not empty, only some values allowed ...). When clicking on...
0
by: sehguh | last post by:
Hiya Folks, I am Currently using windows xp. Also using Visual Web Developer 2005 and Microsoft Sql server 2005. The main page consists of an aspx page and a master page. The page also...
1
by: sehguh | last post by:
Hello folks I have recently been studying a book called "sams teach yourself asp.net 2.0 in24 hours by scott mitchell. I have reached page 614 but when i tried to run an asp page called...
5
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:...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.