473,480 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

DataGrid questions (urgent)

1. In the edit mode of the datagrid, can I restrict the
max. length of data entry the editing textbox ?
eg in my database table, the length of the field is 10, I
want to make sure that user will not enter data with
length more than 10

2. I have made a template column of checkbox in
datagrid, how can I add a check all function for them ?

Thx
Nov 17 '05 #1
3 2490
Here is the answers for your question,

1 . In editmode, set the Maxlength for the Textbox in ItemDataBound event
handler.
2. Have a button in your form. when you press that button loop throught
datagrid items and check all your check box.

--
Saravana
Microsoft India Community Star,
MCAD,SE,SD,DBA.
"Vincent" <kc****@csis.hku.hk> wrote in message
news:06****************************@phx.gbl...
1. In the edit mode of the datagrid, can I restrict the
max. length of data entry the editing textbox ?
eg in my database table, the length of the field is 10, I
want to make sure that user will not enter data with
length more than 10

2. I have made a template column of checkbox in
datagrid, how can I add a check all function for them ?

Thx

Nov 17 '05 #2
I know how to loop through the dataGrid items, however,
how can I check the check box ?

-----Original Message-----
Here is the answers for your question,

1 . In editmode, set the Maxlength for the Textbox in ItemDataBound eventhandler.
2. Have a button in your form. when you press that button loop throughtdatagrid items and check all your check box.

--
Saravana
Microsoft India Community Star,
MCAD,SE,SD,DBA.
"Vincent" <kc****@csis.hku.hk> wrote in message
news:06****************************@phx.gbl...
1. In the edit mode of the datagrid, can I restrict the
max. length of data entry the editing textbox ?
eg in my database table, the length of the field is 10, I want to make sure that user will not enter data with
length more than 10

2. I have made a template column of checkbox in
datagrid, how can I add a check all function for them ?

Thx

.

Nov 17 '05 #3
check out this code snippet,

For Each di In DataGrid1.Items

' Make sure this is an item and not the header or footer.

If di.ItemType = ListItemType.Item OrElse di.ItemType =
ListItemType.AlternatingItem Then

CType(di.FindControl("chkbox1"), RadioButton).Checked = True

End If

Next
--
Saravana
Microsoft India Community Star,
MCAD,SE,SD,DBA.
"Vincent" <kc****@csis.hku.hk> wrote in message
news:08****************************@phx.gbl...
I know how to loop through the dataGrid items, however,
how can I check the check box ?

-----Original Message-----
Here is the answers for your question,

1 . In editmode, set the Maxlength for the Textbox in

ItemDataBound event
handler.
2. Have a button in your form. when you press that

button loop throught
datagrid items and check all your check box.

--
Saravana
Microsoft India Community Star,
MCAD,SE,SD,DBA.
"Vincent" <kc****@csis.hku.hk> wrote in message
news:06****************************@phx.gbl...
1. In the edit mode of the datagrid, can I restrict the
max. length of data entry the editing textbox ?
eg in my database table, the length of the field is 10, I want to make sure that user will not enter data with
length more than 10

2. I have made a template column of checkbox in
datagrid, how can I add a check all function for them ?

Thx

.

Nov 17 '05 #4

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

Similar topics

8
5202
by: Mike | last post by:
Hello, I have a few rather urgent questions that I hope someone can help with (I need to figure this out prior to a meeting tomorrow.) First, a bit of background: The company I work for is...
4
1693
by: sumit | last post by:
Hi, I want to make a datagrid to be scrollable instead of paging in it. So i have put that datagrid html tags inside <div></div> tags and made that div scrollable. Due to this if i scroll down...
1
2897
by: sneha123 | last post by:
There will be some 20 questions and for each question there will be 4 choices.what i want to do is to select multiple answers by clicking the checkbox. i m using asp.net,vb.net pls help me we...
20
1159
by: Peter | last post by:
I have the following Class, but I would like to make one of the columns in my DataGrid editable, how would I do that? When I use this class none of the columns are editable even when I set the...
7
2010
by: GaryDean | last post by:
(one of our developers posted this and it got no answer so I'm giving it another try) I'm converting a DataGrid utility component that previously used the columns array to function as it has in...
2
1759
by: cj | last post by:
I was looking over some of my 2003 code today (see below) that loads a foxpro table via oledb connection. I used a sub "autosizecolumns" I found on the web but I never quite understood why they...
2
992
by: Mark B | last post by:
I have a Datagrid working fine, outputting: Group Most Popular Product Code -------- ------------------------------- Earth.New Zealand 32 Earth.New Zealand
7
3011
by: Mark B | last post by:
Can someone write some VB.Net example code for me that does this: 1) Creates a gridview control with the results of a SQL stored procedure that has 1 parameter (text) 2) Adds an extra column...
3
1816
by: frostbb | last post by:
Greetings, We're starting to transition our legacy C# apps from earlier versions to VS2008 versions. Many of our apps allow the user to select a row from a DataGrid into a 'Data Edit' area...
0
7039
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,...
0
6904
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7080
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...
1
6735
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...
0
5326
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4770
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4476
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...
1
558
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
176
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.