473,385 Members | 1,642 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,385 software developers and data experts.

datagrid errors

Hey all,

I was wondering if there was a different way of coding the following snippet.
I have a bound datagrid and I'm using the ErrorProvider to catch errors.
So if I have many fields to validate I just pack them in that procedure? One
if on top of another? Is there something cleaner?

Private Sub m_dt_ColumnChanging(ByVal sender As Object, ByVal e As
System.Data.DataColumnChangeEventArgs) Handles m_dt.ColumnChanging
If e.Column.ColumnName = "LNRSTN" Then
If e.ProposedValue = String.Empty Then
e.Row.SetColumnError(e.Column.ColumnName, "You can't do that")
Else
'e.Row.SetColumnError("LNRSTN", "")
e.Row.ClearErrors()
End If
End If
End Sub
Nov 22 '05 #1
1 1037
Rodchar,

When you have questions about the language VBNet, as this is, than I advice
you the newsgroup for that. However mostly there are in VBNet a lot of
methods and mostly it is a matter of taste. By instance you can make your
own textboxcolumn for this by inheriting the master. As well you can do a
lot with the datasource. As I see it now right, you try to prevent users to
make a column spaces. When it is about DBNull values there is by instance
this.

http://msdn.microsoft.com/library/de...bnulltopic.asp

The VBlanguage newsgroup is.

Microsoft.public.dotnet.languages.vb

I hope this helps?

Cor
I was wondering if there was a different way of coding the following snippet. I have a bound datagrid and I'm using the ErrorProvider to catch errors.
So if I have many fields to validate I just pack them in that procedure? One if on top of another? Is there something cleaner?

Private Sub m_dt_ColumnChanging(ByVal sender As Object, ByVal e As
System.Data.DataColumnChangeEventArgs) Handles m_dt.ColumnChanging
If e.Column.ColumnName = "LNRSTN" Then
If e.ProposedValue = String.Empty Then
e.Row.SetColumnError(e.Column.ColumnName, "You can't do that") Else
'e.Row.SetColumnError("LNRSTN", "")
e.Row.ClearErrors()
End If
End If
End Sub

Nov 22 '05 #2

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

Similar topics

0
by: Frosty | last post by:
Hi I am using the VS xsd designer to create a strongly typed dataset. The dataset is apparently successfully created, with no warnings or errors given. Is it not then to be expected that this...
5
by: sdbranum | last post by:
I have been using Visual C#.NET to code a large project having many data adapters, data sets, datagrids, multiple forms with tab pages, each containing various controls (mostly label, text boxes,...
3
by: Kumar | last post by:
Hi Folks, I have a question regarding conditional hyperlink in datagrid. I want to display Hyperlink if my QID values in (1,4,5,6) other wise i want to display just Qdescription with out...
1
by: Adam Knight | last post by:
Hi all, I have a asp:required field validator in a datagrid footer containing a textbox control. (To add new row) I have an issue in that while the footer is hidden and not required it is cause...
3
by: simchajoy2000 | last post by:
Hi, I have been working with datagrids a lot in the past two weeks and I am running across a lot of problems. Maybe there is no way around these problems but I hope there are and someone out...
4
by: jaYPee | last post by:
I have 1 dataset called "dataset1" that contains 2 tables called "course" and "courseload". in my form i have a datagrid. the datasource of this datagrid is "dataset1" and the datamember is...
2
by: CharlesA | last post by:
Hi folks, first off, I'm using Framework vs 1.1 with ASP.net and C# I'm trying to extend the System.Web.UI.Webcontrols.DataGrid, and the only thing I want to extend is the Render method (in...
3
by: Horselover Fat | last post by:
Hi, I have a column in a database that holds elapsed time in milliseconds and I want to display that column in a DataGrid in a specific format (d.hh:mm:ss.fff). However, the closest I can get...
0
by: bnlockwood | last post by:
G'day all, Thank you in advance for anyone that can help. I have a shopping cart datagrid on my c# asp.net page. This is the code: ------------------------------------- <asp:datagrid...
2
by: steven | last post by:
i've got a dropDownList that I'm trying to populate from my code behind as follows: uxVehicleColourEdit.DataSource = oDsLookups.Tables; if the dropDown is placed inside a datagrid, i get...
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.