473,574 Members | 8,370 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 3232
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
2058
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...
1
2895
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...
2
4392
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
1407
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...
4
2068
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...
4
3473
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...
2
1578
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...
5
2038
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
6323
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. ...
0
8083
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8258
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8121
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6487
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...
0
3761
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...
0
3777
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2255
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1360
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1087
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...

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.