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

How to set datagrid' textbox columns' max length ?

I need to limit the number of characters in the Textbox column in the
datagrid.
How can I do that ?
Thanks
Jul 21 '05 #1
1 4030
Agnes,

Did you see my sample of the column in the language.vb group.

This is almost the same sample however in another way, there is also the
limitation of the textboxcolumn in.

I hope this helps?

Cor

\\\
Private Sub Form7_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Dim dt As New DataTable("Agnes")
dt.Columns.Add("Cor")
For i As Integer = 0 To 4
Dim dr As DataRow = dt.NewRow
dr(0) = (i + 1).ToString
dt.Rows.Add(dr)
Next
Dim dv As New DataView(dt)
Me.DataGrid1.DataSource = dv
Dim ts As New DataGridTableStyle
ts.MappingName = "Agnes"
Dim column As New DataGridTextBoxColumn
column.TextBox.MaxLength = 4
column.MappingName = "Cor"
column.HeaderText = "Ident"
column.NullText = String.Empty
ts.GridColumnStyles.Add(column)
DataGrid1.TableStyles.Add(ts)
End Sub
///

Jul 21 '05 #2

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

Similar topics

12
by: James Norton-Jones | last post by:
Hi, Am I trying to hold the data of a DataGrid in a label so that when the form is reposted the DataGrid can be repopulated. The problem I am having is that I don't understand how to get the...
1
by: Gunjan Garg | last post by:
Hello All, I am working to create a generic datagrid which accepts a datasource(ListData - This is our own datatype) and depending on the calling program customizes itself for sorting,...
1
by: jimb | last post by:
I can get the dropdownlist into the datagrid, and I can populate it, but I can't read it. Anybody have a working example of a dropdownlist in an editable grid? Thanks. -- .....
4
by: tshad | last post by:
I have a dataGrid that I filled with files from my directory. I am using VS 2003 and Windows Forms. ************************************************************ Dim dirInfo As DirectoryInfo =...
0
by: JamesOo | last post by:
I have the code below, but I need to make it searchable in query table, below code only allowed seach the table which in show mdb only. (i.e. have 3 table, but only can search either one only,...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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
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?
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.