473,835 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to display error message inside webgrid control

49 New Member
Hi


I have used webgrid control using template columns to display data from the database.
When I click edit button and enter the data, I m validating the data using regular expression validator inside edit item template.



Now if I didn’t enter any data and tried to click “update” button ,it should show a error message. So how can I do this?

Can anyone help?
Dec 14 '07 #1
8 3472
baburk
111 New Member
Hi Durga

Use validation control in ultrawebgrid like this.
Expand|Select|Wrap|Line Numbers
  1. <igtbl:TemplatedColumn BaseColumnName = "Price" HeaderText="Price">
  2.  
  3.                         <Header Caption = "Price">
  4.  
  5.                         <Validators >
  6.  
  7.                             <igtbl:ValidatorItem Value = "NumericValue" />
  8.  
  9.                         </Validators>
  10.  
  11.                     </igtbl:TemplatedColumn>
  12.  
  13.                 </Columns>
  14.  
  15.                 <AddNewRow View="NotSet" Visible="NotSet">
  16.  
  17.                 </AddNewRow>
  18.  
  19.             </igtbl:UltraGridBand>
  20.  
  21.         </Bands>
  22.  
  23.     </igtbl:UltraWebGrid>
  24.  
  25. /div>
  26.  
  27. <asp:RegularExpressionValidator ID = "NumericValue" runat = "server" ControlToValidate = "uwgEditPrice" ValidationExpression = "[0-9]*" ErrorMessage = "Invalid" ValidationGroup = "btnSave"></asp:RegularExpressionValidator>
Dec 14 '07 #2
radcaesar
759 Recognized Expert Contributor
Is the control is gridview ?
Hi


I have used webgrid control using template columns to display data from the database.
When I click edit button and enter the data, I m validating the data using regular expression validator inside edit item template.



Now if I didn’t enter any data and tried to click “update” button ,it should show a error message. So how can I do this?

Can anyone help?
Dec 14 '07 #3
durga2005
49 New Member
Hi Durga

Use validation control in ultrawebgrid like this.

<igtbl:Template dColumn BaseColumnName = "Price" HeaderText="Pri ce">

<Header Caption = "Price">

<Validators >

<igtbl:Validato rItem Value = "NumericVal ue" />

</Validators>

</igtbl:Templated Column>

</Columns>

<AddNewRow View="NotSet" Visible="NotSet ">

</AddNewRow>

</igtbl:UltraGrid Band>

</Bands>

</igtbl:UltraWebG rid>

/div>

<asp:RegularExp ressionValidato r ID = "NumericVal ue" runat = "server" ControlToValida te = "uwgEditPri ce" ValidationExpre ssion = "[0-9]*" ErrorMessage = "Invalid" ValidationGroup = "btnSave"></asp:RegularExpr essionValidator >


hi


i cant understand your code

i have given my coding here.please see and guide me



<C1WebGrid:C1We bGrid ID="webgrid" runat="server" AutoGenerateCol umns="False" DataKeyField="I D" AllowPaging="tr ue" OnPageIndexChan ging="doPaging" >

<Columns>

<C1WebGrid:C1Te mplateColumn HeaderText="ID" SortExpression= "ID">
<ItemTemplate >
<asp:Label ID="Label1" runat="server"
Text='<%# Eval("ID") %>'></asp:Label>
</ItemTemplate>
</C1WebGrid:C1Tem plateColumn>

<C1WebGrid:C1Te mplateColumn HeaderText="Cod e" SortExpression= "Code">
<EditItemTempla te>
<asp:TextBox ID="TextBox3" runat="server"
Text='<%#Bind(" Code") %>'></asp:TextBox>
<asp:RegularExp ressionValidato r ID="RegularExpr essionValidator 3" runat="server" ControlToValida te="TextBox3" ErrorMessage="I nvalid Entry" ValidationExpre ssion="[A-Z][A-Z]"></asp:RegularExpr essionValidator >
</EditItemTemplat e>
<ItemTemplate >
<asp:Label ID="Label2" runat="server" Text='<%# Eval("Code") %>'></asp:Label>
</ItemTemplate>
</C1WebGrid:C1Tem plateColumn>


<C1WebGrid:C1Te mplateColumn HeaderText="Nam e" SortExpression= "Name">
<EditItemTempla te>
<asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("Name") %>'></asp:TextBox>
<asp:RegularExp ressionValidato r ID="RegularExpr essionValidator 4"
runat="server" ControlToValida te="TextBox4"
ErrorMessage="I nvalid Entry" ValidationExpre ssion="[A-Z][a-z]">
</asp:RegularExpr essionValidator >
</EditItemTemplat e>
<ItemTemplate >
<asp:Label ID="Label3" runat="server" Text='<%# Eval("Name") %>'></asp:Label>
</ItemTemplate>
</C1WebGrid:C1Tem plateColumn>


<C1WebGrid:C1Ed itCommandColumn >
</C1WebGrid:C1Edi tCommandColumn>

</Columns>

</C1WebGrid:C1Web Grid>
Dec 14 '07 #4
durga2005
49 New Member
Hi Durga

Use validation control in ultrawebgrid like this.

<igtbl:Template dColumn BaseColumnName = "Price" HeaderText="Pri ce">

<Header Caption = "Price">

<Validators >

<igtbl:Validato rItem Value = "NumericVal ue" />

</Validators>

</igtbl:Templated Column>

</Columns>

<AddNewRow View="NotSet" Visible="NotSet ">

</AddNewRow>

</igtbl:UltraGrid Band>

</Bands>

</igtbl:UltraWebG rid>

/div>

<asp:RegularExp ressionValidato r ID = "NumericVal ue" runat = "server" ControlToValida te = "uwgEditPri ce" ValidationExpre ssion = "[0-9]*" ErrorMessage = "Invalid" ValidationGroup = "btnSave"></asp:RegularExpr essionValidator >






hi

if i didnt enter any value and tried to click update button it should display error message inside the cell.
Dec 14 '07 #5
baburk
111 New Member
Hi

Are you using ultrawebgrid
Dec 14 '07 #6
durga2005
49 New Member
Hi

Are you using ultrawebgrid

hi

i m using "C1webgrid" control
Dec 14 '07 #7
baburk
111 New Member
hi

i m using "C1webgrid" control
Sorry for the disturbance.

I know only UltraWebGrid
Dec 14 '07 #8
radcaesar
759 Recognized Expert Contributor
Can't u have a label and bind the message in that label ?
Dec 14 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1371
by: Jason Ratke | last post by:
Hi, I apologize for asking this question here, but I didn't see a NG for third party controls... If anyone has experience working with Intersoft's WebGrid Professional datagrid control, please help! I'm having nothing but problems trying to get it to display a heirarchical dataset. Has anyone had any success binding it dynamically? I'm using C# in VS.NET 2003.
1
5296
by: Craig Banks | last post by:
If a row of data in a dataset has a lot of columns the row displaying the data in a datagrid will run way off the screen. What I'd like to do is display a row of data over several datagrid rows so the user doesn't have to scroll horizontally. Essentially, I want to wrap a datagrid row (not text in individual columns) with as much control as possible. Make sense? While this seems simple enough on the surface, I can't figure out how to do...
8
2120
by: Ravi Ambros Wallau | last post by:
Hey guys: What can I do when an "Error Creating Control" is displayed on the form (instead of the control), and a tooltip indicating the error never is displayed? Is there some log, some hidden message, some entry in registry where a log is created (or that enables a log, trace, dump or whatever)... I'm a little bit frustated with this error :-( Tks, Ravi.
0
901
by: Oliver Orsteck | last post by:
Hi! Inside a repeater i have a WebCombo. The value i would like to display is another i would like to store. I tried to solve my Problem during the Init-Time of the Repeater that way: myWebCombo.DataBind() Dim myValueListBool As Infragistics.WebUI.UltraWebGrid.ValueList
3
1653
by: durga2005 | last post by:
Hi I m displaying data from the database using C1WebGrid Control. When edit button is clicked two textboxes will be displayed in the corresponding row While editing the data through webgrid control ,the new data must be validated,and after validation the data must be changed in the database.
7
2578
by: avanthika | last post by:
hi, I am using dropdownlist in webgrid.for loading the combo i am using this source code. Dim vallist As New Infragistics.WebUI.UltraWebGrid.ValueList Dim ds As New DataSet ds = _Utility.runsql("select " + IDField + "," + TextField + " from " + TableName + " where Deleted=0") Dim dt As New DataTable dt.Columns.Add("unit_id") dt.Columns.Add("unit_name") If...
2
923
by: durga2005 | last post by:
Hi I m using webgrid control While editing data using editable textboxes, the data I entered should be formatted automatically. Like ,even if I enter all letters in small,it should change itself the first letter as capital and all others as small Is it possible?
0
991
by: durga2005 | last post by:
Hi I m using webgrid control I m trying to add a new record using the footer. I have three columns in webgrid control namely id, type and category. Id is automatically generated when using insert statement. How can I do this?
2
1288
by: durga2005 | last post by:
Hi I m using webgrid control I m trying to add a new record using its footer In the footer I placed a button,and one textboxe to insert the new record. when I click the add button,the data in textboxe should be inserted in the database. But I could not retrieve the value of the textbox in the footer. How can I retrieve the data entererd in the textbox inside the footer?
0
9803
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
10808
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10520
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10560
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
6963
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
5636
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...
0
5804
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4433
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
2
3993
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.