Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

GridView Update command and checking values

Posted on 2006-11-02
2
Medium Priority
?
263 Views
Last Modified: 2008-01-09
How do I make sure the right values are entered when updating from the GridView? Is there a way to error check?
0
Comment
Question by:HangTenDesign
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
hfpon earned 750 total points
ID: 17864577
Convert your boundfields into templatefields;
then put validation control to the textboxes and set those validation control display as dynamic.
For example;

            <asp:TemplateField HeaderText="Effect" SortExpression="sEffect" >
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox2" runat="server" Height="50px" Text='<%# Bind("sEffect") %>'
                        TextMode="MultiLine" Width="150px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox2"
                        Display="Dynamic" ErrorMessage="RequiredFieldValidator"></asp:RequiredFieldValidator>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("sEffect") %>' Width="150px"></asp:Label>
                </ItemTemplate>
0
 

Author Comment

by:HangTenDesign
ID: 17867881
Hi, this is very good but not giving me the desired result. Is there any way to wire a client side javascript function. I manager to put a OnClientClick on the EditTemplate UpdateCommand button but I don't know how to predict the DOM reference of the renderend text box inside the GridView.

Maybe there is another way to do Client side error check and alert box.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question