473,320 Members | 2,080 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to display error message inside webgrid control

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 3448
baburk
111 100+
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 Expert 512MB
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
Hi Durga

Use validation control in ultrawebgrid like this.

<igtbl:TemplatedColumn BaseColumnName = "Price" HeaderText="Price">

<Header Caption = "Price">

<Validators >

<igtbl:ValidatorItem Value = "NumericValue" />

</Validators>

</igtbl:TemplatedColumn>

</Columns>

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

</AddNewRow>

</igtbl:UltraGridBand>

</Bands>

</igtbl:UltraWebGrid>

/div>

<asp:RegularExpressionValidator ID = "NumericValue" runat = "server" ControlToValidate = "uwgEditPrice" ValidationExpression = "[0-9]*" ErrorMessage = "Invalid" ValidationGroup = "btnSave"></asp:RegularExpressionValidator>


hi


i cant understand your code

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



<C1WebGrid:C1WebGrid ID="webgrid" runat="server" AutoGenerateColumns="False" DataKeyField="ID" AllowPaging="true" OnPageIndexChanging="doPaging">

<Columns>

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

<C1WebGrid:C1TemplateColumn HeaderText="Code" SortExpression="Code">
<EditItemTemplate>
<asp:TextBox ID="TextBox3" runat="server"
Text='<%#Bind("Code") %>'></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ControlToValidate="TextBox3" ErrorMessage="Invalid Entry" ValidationExpression="[A-Z][A-Z]"></asp:RegularExpressionValidator>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Eval("Code") %>'></asp:Label>
</ItemTemplate>
</C1WebGrid:C1TemplateColumn>


<C1WebGrid:C1TemplateColumn HeaderText="Name" SortExpression="Name">
<EditItemTemplate>
<asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("Name") %>'></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator4"
runat="server" ControlToValidate="TextBox4"
ErrorMessage="Invalid Entry" ValidationExpression="[A-Z][a-z]">
</asp:RegularExpressionValidator>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Eval("Name") %>'></asp:Label>
</ItemTemplate>
</C1WebGrid:C1TemplateColumn>


<C1WebGrid:C1EditCommandColumn>
</C1WebGrid:C1EditCommandColumn>

</Columns>

</C1WebGrid:C1WebGrid>
Dec 14 '07 #4
Hi Durga

Use validation control in ultrawebgrid like this.

<igtbl:TemplatedColumn BaseColumnName = "Price" HeaderText="Price">

<Header Caption = "Price">

<Validators >

<igtbl:ValidatorItem Value = "NumericValue" />

</Validators>

</igtbl:TemplatedColumn>

</Columns>

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

</AddNewRow>

</igtbl:UltraGridBand>

</Bands>

</igtbl:UltraWebGrid>

/div>

<asp:RegularExpressionValidator ID = "NumericValue" runat = "server" ControlToValidate = "uwgEditPrice" ValidationExpression = "[0-9]*" ErrorMessage = "Invalid" ValidationGroup = "btnSave"></asp:RegularExpressionValidator>






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 100+
Hi

Are you using ultrawebgrid
Dec 14 '07 #6
Hi

Are you using ultrawebgrid

hi

i m using "C1webgrid" control
Dec 14 '07 #7
baburk
111 100+
hi

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

I know only UltraWebGrid
Dec 14 '07 #8
radcaesar
759 Expert 512MB
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
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,...
1
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...
8
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...
0
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: ...
3
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...
7
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 ...
2
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...
0
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...
2
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.