473,739 Members | 7,416 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Datagrid add/insert row validation issue

Based upon some prevoius postings on what to do for adding a 'add' row to a
datagrid I utilize the footer to create the 'add' row. The only issue is that
I have it sharing the 'UpDate_Command ' and I use an argument to difference
between an 'edit' vs. and 'add. But since I have field validation on both
'footer' and 'edit' columns I can't submit my edits since the footer
validation kicks in.If I take the validation off then the both work fine (an
insert or an update to record)

Add link:
<FooterTemplate >
<asp:LinkButt on id="btnAddRow" runat="server" CssClass="gridq text"
Text="<u>Add</u>" CommandName="Up date" CommandArgument ="Insert">
</asp:LinkButton>
</FooterTemplate>

edit links:
<asp:EditComman dColumn ItemStyle-Width="75" ItemStyle-CssClass="gridt ext"
ButtonType="Lin kButton" UpdateText="Upd ate" CancelText="Can cel"
EditText="Edit" >
</asp:EditCommand Column>

they are both sharing the:
Private Sub gdconcerndetail _UpdateCommand( ByVal source As System.Object,
ByVal e As System.Web.UI.W ebControls.Data GridCommandEven tArgs) Handles
gdconcerndetail .UpdateCommand

Ideas? Thanx.
Nov 19 '05 #1
5 3246
just noticed post in Jan, but solution was there isn't one I guess?
Does anyone know some good customvalidator examples that maybe can be used
here?

thanx.

"Chris" wrote:
Based upon some prevoius postings on what to do for adding a 'add' row to a
datagrid I utilize the footer to create the 'add' row. The only issue is that
I have it sharing the 'UpDate_Command ' and I use an argument to difference
between an 'edit' vs. and 'add. But since I have field validation on both
'footer' and 'edit' columns I can't submit my edits since the footer
validation kicks in.If I take the validation off then the both work fine (an
insert or an update to record)

Add link:
<FooterTemplate >
<asp:LinkButt on id="btnAddRow" runat="server" CssClass="gridq text"
Text="<u>Add</u>" CommandName="Up date" CommandArgument ="Insert">
</asp:LinkButton>
</FooterTemplate>

edit links:
<asp:EditComman dColumn ItemStyle-Width="75" ItemStyle-CssClass="gridt ext"
ButtonType="Lin kButton" UpdateText="Upd ate" CancelText="Can cel"
EditText="Edit" >
</asp:EditCommand Column>

they are both sharing the:
Private Sub gdconcerndetail _UpdateCommand( ByVal source As System.Object,
ByVal e As System.Web.UI.W ebControls.Data GridCommandEven tArgs) Handles
gdconcerndetail .UpdateCommand

Ideas? Thanx.

Nov 19 '05 #2
Hi Chris,

If the problem is about validation, you might disable
client-side validation and use server-side validation.

If the problem is two buttons share UpDate_Command event,
you can change CommandName of button in footer, i.e. to
Add, then handle datagrid_ItemCo mmand Event:

If e.CommandName = "Add" Then
' process
End

Actually, ItemCommand Occurs when any button is clicked in
the DataGrid control.

HTH,

Elton Wang
el********@hotm ail.com
-----Original Message-----
Based upon some prevoius postings on what to do for adding a 'add' row to adatagrid I utilize the footer to create the 'add' row. The only issue is thatI have it sharing the 'UpDate_Command ' and I use an argument to differencebetween an 'edit' vs. and 'add. But since I have field validation on both'footer' and 'edit' columns I can't submit my edits since the footervalidation kicks in.If I take the validation off then the both work fine (aninsert or an update to record)

Add link:
<FooterTemplat e>
<asp:LinkButto n id="btnAddRow" runat="server" CssClass="gridq text"Text="<u>Add </u>" CommandName="Up date" CommandArgument ="Insert"></asp:LinkButton>
</FooterTemplate>

edit links:
<asp:EditComma ndColumn ItemStyle-Width="75" ItemStyle- CssClass="gridt ext"ButtonType="Li nkButton" UpdateText="Upd ate" CancelText="Can cel"EditText="Edit ">
</asp:EditCommand Column>

they are both sharing the:
Private Sub gdconcerndetail _UpdateCommand( ByVal source As System.Object,ByVal e As System.Web.UI.W ebControls.Data GridCommandEven tArgs)
Handlesgdconcerndetai l.UpdateCommand

Ideas? Thanx.
.

Nov 19 '05 #3
I'm trying to understand your response, maybe I'm not understanding it.
This is a validation issue, meaning the form ca not be submitted, etc.
So even though I have e.CommandArgume nt = "Insert" (see the tag in the first
post below) it never reaches it becuase the validation fails.
The strange thing is when I add a record, the validation is only for that
row The footer). When I enter into edit on a row then try to update that row
the validation fires first for add only('insert')?
the edit column doesn't have any arguments
edit links:
<asp:EditComma ndColumn ItemStyle-Width="75" ItemStyle- CssClass="gridt ext"
ButtonType="Li nkButton" UpdateText="Upd ate"

CancelText="Can cel"
EditText="Edit ">
</asp:EditCommand Column>



"Elton Wang" wrote:
Hi Chris,

If the problem is about validation, you might disable
client-side validation and use server-side validation.

If the problem is two buttons share UpDate_Command event,
you can change CommandName of button in footer, i.e. to
Add, then handle datagrid_ItemCo mmand Event:

If e.CommandName = "Add" Then
' process
End

Actually, ItemCommand Occurs when any button is clicked in
the DataGrid control.

HTH,

Elton Wang
el********@hotm ail.com
-----Original Message-----
Based upon some prevoius postings on what to do for

adding a 'add' row to a
datagrid I utilize the footer to create the 'add' row.

The only issue is that
I have it sharing the 'UpDate_Command ' and I use an

argument to difference
between an 'edit' vs. and 'add. But since I have field

validation on both
'footer' and 'edit' columns I can't submit my edits since

the footer
validation kicks in.If I take the validation off then the

both work fine (an
insert or an update to record)

Add link:
<FooterTemplat e>
<asp:LinkButto n id="btnAddRow" runat="server"

CssClass="gridq text"
Text="<u>Add </u>" CommandName="Up date"

CommandArgument ="Insert">
</asp:LinkButton>
</FooterTemplate>

edit links:
<asp:EditComma ndColumn ItemStyle-Width="75" ItemStyle-

CssClass="gridt ext"
ButtonType="Li nkButton" UpdateText="Upd ate"

CancelText="Can cel"
EditText="Edit ">
</asp:EditCommand Column>

they are both sharing the:
Private Sub gdconcerndetail _UpdateCommand( ByVal source

As System.Object,
ByVal e As

System.Web.UI.W ebControls.Data GridCommandEven tArgs)
Handles
gdconcerndetai l.UpdateCommand

Ideas? Thanx.
.

Nov 19 '05 #4
Hi Chris, I was on another thread that sounds like a match to this:
http://www.asp.net/Forums/ShowPost.a...&PostID=128371

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlu m.com
Creator of "Profession al Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Chris" <Ch***@discussi ons.microsoft.c om> wrote in message
news:E8******** *************** ***********@mic rosoft.com...
I'm trying to understand your response, maybe I'm not understanding it.
This is a validation issue, meaning the form ca not be submitted, etc.
So even though I have e.CommandArgume nt = "Insert" (see the tag in the
first
post below) it never reaches it becuase the validation fails.
The strange thing is when I add a record, the validation is only for that
row The footer). When I enter into edit on a row then try to update that
row
the validation fires first for add only('insert')?
the edit column doesn't have any arguments
edit links:
><asp:EditComma ndColumn ItemStyle-Width="75" ItemStyle-

CssClass="gridt ext"
>ButtonType="Li nkButton" UpdateText="Upd ate"

CancelText="Can cel"
>EditText="Edit ">
></asp:EditCommand Column>



"Elton Wang" wrote:
Hi Chris,

If the problem is about validation, you might disable
client-side validation and use server-side validation.

If the problem is two buttons share UpDate_Command event,
you can change CommandName of button in footer, i.e. to
Add, then handle datagrid_ItemCo mmand Event:

If e.CommandName = "Add" Then
' process
End

Actually, ItemCommand Occurs when any button is clicked in
the DataGrid control.

HTH,

Elton Wang
el********@hotm ail.com
>-----Original Message-----
>Based upon some prevoius postings on what to do for

adding a 'add' row to a
>datagrid I utilize the footer to create the 'add' row.

The only issue is that
>I have it sharing the 'UpDate_Command ' and I use an

argument to difference
>between an 'edit' vs. and 'add. But since I have field

validation on both
>'footer' and 'edit' columns I can't submit my edits since

the footer
>validation kicks in.If I take the validation off then the

both work fine (an
>insert or an update to record)
>
>Add link:
><FooterTemplat e>
><asp:LinkButto n id="btnAddRow" runat="server"

CssClass="gridq text"
>Text="<u>Add </u>" CommandName="Up date"

CommandArgument ="Insert">
></asp:LinkButton>
></FooterTemplate>
>
>edit links:
><asp:EditComma ndColumn ItemStyle-Width="75" ItemStyle-

CssClass="gridt ext"
>ButtonType="Li nkButton" UpdateText="Upd ate"

CancelText="Can cel"
>EditText="Edit ">
></asp:EditCommand Column>
>
>they are both sharing the:
> Private Sub gdconcerndetail _UpdateCommand( ByVal source

As System.Object,
>ByVal e As

System.Web.UI.W ebControls.Data GridCommandEven tArgs)
Handles
>gdconcerndetai l.UpdateCommand
>
>Ideas? Thanx.
>.
>

Nov 19 '05 #5
Hi

I didn't fully understand your question. Now I got it.

Client-side validation logic doesn't care, actually
doesn't know which button is clicked. To client-side it
either submit or not depending validated fields. So it's
difficult to control its workflow. In that case, you might
change it to server-side validation. On server-side, if
button in footer is clicked, you know you don't need worry
about textbox in edit field, so you only check text fields
in footer, vice versa. The disadvantage of server-side
validation is negative performance and there is no any pre-
built control. You have you're your own validation logic.
HTH

-----Original Message-----
I'm trying to understand your response, maybe I'm not understanding it.This is a validation issue, meaning the form ca not be submitted, etc.So even though I have e.CommandArgume nt = "Insert" (see the tag in the firstpost below) it never reaches it becuase the validation fails.The strange thing is when I add a record, the validation is only for thatrow The footer). When I enter into edit on a row then try to update that rowthe validation fires first for add only('insert')?
the edit column doesn't have any arguments
edit links:
><asp:EditComma ndColumn ItemStyle-Width="75" ItemStyle-

CssClass="gridt ext"
>ButtonType="Li nkButton" UpdateText="Upd ate"

CancelText="Can cel"
>EditText="Edit ">
></asp:EditCommand Column>

"Elton Wang" wrote:
Hi Chris,

If the problem is about validation, you might disable
client-side validation and use server-side validation.

If the problem is two buttons share UpDate_Command

event, you can change CommandName of button in footer, i.e. to
Add, then handle datagrid_ItemCo mmand Event:

If e.CommandName = "Add" Then
' process
End

Actually, ItemCommand Occurs when any button is clicked in the DataGrid control.

HTH,

Elton Wang
el********@hotm ail.com
>-----Original Message-----
>Based upon some prevoius postings on what to do for

adding a 'add' row to a
>datagrid I utilize the footer to create the 'add' row.

The only issue is that
>I have it sharing the 'UpDate_Command ' and I use an

argument to difference
>between an 'edit' vs. and 'add. But since I have field

validation on both
>'footer' and 'edit' columns I can't submit my edits
since the footer
>validation kicks in.If I take the validation off then
the both work fine (an
>insert or an update to record)
>
>Add link:
><FooterTemplat e>
><asp:LinkButto n id="btnAddRow" runat="server"

CssClass="gridq text"
>Text="<u>Add </u>" CommandName="Up date"

CommandArgument ="Insert">
></asp:LinkButton>
></FooterTemplate>
>
>edit links:
><asp:EditComma ndColumn ItemStyle-Width="75" ItemStyle-

CssClass="gridt ext"
>ButtonType="Li nkButton" UpdateText="Upd ate"

CancelText="Can cel"
>EditText="Edit ">
></asp:EditCommand Column>
>
>they are both sharing the:
> Private Sub gdconcerndetail _UpdateCommand( ByVal
source As System.Object,
>ByVal e As

System.Web.UI.W ebControls.Data GridCommandEven tArgs)
Handles
>gdconcerndetai l.UpdateCommand
>
>Ideas? Thanx.
>.
>

.

Nov 19 '05 #6

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

Similar topics

14
2101
by: Jack Kaufmann | last post by:
I am trying to verify a datagrid in which there must be an entry in both columns of any new row, and those values must be greater than the corresponding values in the previous row. It is pretty simple to verify the cell the user starts in by invoking a verifying event for the underlying textbox in that cell, but what I would like to do is to change the focus to the other column in the new row if it has not been filled in. If in handling...
1
2905
by: GregM | last post by:
I have a read only datagrid that is designed to coordinate itself with textboxes. When the user clicks on a row in the datagrid, detailed data for that row is displayed for editing in the textboxes. The datagrid and textboxes are populated from the same underlying SQL Server table but using different strongly typed data adapters and datasets for display and editing. So I coordinate syncronization of the two sets of data using code. I use...
2
4400
by: Matthias Marx | last post by:
Hello NG ASP:NET c# 1.1 I have to develop an existing c#, web application. There is a datagrid. With the Edit/Update function, where you could edit the value within the row. I need a validation for numeric datatyp.
6
1415
by: rodchar | last post by:
Hey all, I'm trying to implement validation in my asp.net datagrid. For example, if a user enters in a Customer ID I want it to check a different data table to see if the customer exists. I'm assuming I'll have to use template columns to add the custom validation control next to each textbox. Please correct me if I'm wrong because i'm having a challenging time with template columns.
4
2076
by: Luis Esteban Valencia | last post by:
I have a asp.net page (C#), with a datagrid. I use template for all columns, and have <asp:requiredfieldvalidator> in with one of the textboxes, to make sure it's filled in. However, this validation is not firing, even when I leave the field empty. Below please find the code: <%@ Page Language="C#" Debug="true" %> <%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.SqlClient" %>
4
3480
by: siaj | last post by:
Hello All, If some one has faced a similar issue.. My datagrid Update command is not getting fired in fact it seems that the no event fires on clicking the update link. Although the cancel and the Edit Commmand are getting fired properly. The One difference I have seen is that in the task bar ..on hovering on the link the javascript for the update link seems different. I dont know if it makes sense..
2
1585
by: Playmaker | last post by:
Hopefully someone else has come across this issue. What I have is a SQL Server 2000 back-end. I've created a simple webform which has both Gridview and DataList controls on it populated with a SqlDataSource. Okay, simple enough, that all works fine. I have also enabled inserting and editing on these controls. This is a very cool feature of 2.0 and it works quite well. Functionally I am able to do everything such as inserting and...
5
2056
by: Tina | last post by:
the Edit, Update, Cancel, and Delete buttons in my datagrid are causing validation elsewhere on the page. I want to specify that these buttons should not cause validation but they have no design time property of causevalidation. How can I keep them from causing validation? Thanks, T
3
6337
by: Bob Alston | last post by:
I have a routine to copy data to new versions of my app via insert into sql statements. Unfortunately, due to evolution of my app, sometimes the new version has more restrictive editing than an older version that I am updating. Thus I get this message. It tells me only how many records have errors, not which errors or which records. Anyone have a nice solution to identifying the specific records involved? Maybe even the specific...
0
8969
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8794
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9269
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8216
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6756
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6056
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4572
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2195
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.