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 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
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
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
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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:...
|
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...
|
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...
|
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$) {
}
...
|
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...
|
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...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
| |