473,387 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,387 software developers and data experts.

Datagrids and controls in cells

try this

Dim mycheck As CheckBox = CType(dgWelcomePacks.Items
(i).Cells(7).Controls(1), CheckBox)

regards,
Kumar.

-----Original Message-----
Hi,

I'm doing a web application and I have a datagrid that's
linked to a dataset. For one of the columns in the
datagrid I create and add a checkbox control so that userscan easily modify the value in the dataset. I do that in
the following way:

Dim mycheck As New CheckBox()
dgWelcomePacks.Items(i).Cells(7).Controls.Add(myc heck)

I then mark the checkbox as ticked or unticked, depending
on the dataset value in the cell.
That all works fine.
Now when a user has finished with all the data in the
datagrid (ie ticking\unticking the checkboxes on differentrows) I want to be able to update the dataset with the newcheck values. I tried by running through all the rows in
the datagrid and piking up the checkbox control value:

Dim mycheck As CheckBox = CType(dgWelcomePacks.Items
(i).Cells(7).Controls(0), CheckBox)

But that gives me an error saying that there is no controlin that cell (index out of range). How can that be when I
see the checkbox in the cell on the screen? Is there
something that I'm not doing when I'm initially creating
the checkbox and adding it as a control to the cell?

Any help would be greately appreciated.

Thanks in advance,

Jo

.

Jul 19 '05 #1
0 1218

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

Similar topics

1
by: Jo | last post by:
Hi, I've tried the suggested solution but I'm still getting the same error. It seems that once the page postback is envoked the checkbox control is removed from the datagrid so all my changes...
0
by: Kumar | last post by:
try this Dim mycheck As CheckBox = CType(dgWelcomePacks.Items (i).Cells(7).Controls(1), CheckBox) regards, Kumar. >-----Original Message-----
13
by: moondaddy | last post by:
Happy Holidays All! I want to load a datagrid with images and text (Image, text, image, text, etc...). The data for this datagrid will be coming from sql server and the images are stored as files...
9
by: | last post by:
I have a web page written in asp.net that has multiple datagrids on it that would need to be exported to Excel. Each of the datagrids would be a subset of what the datagrid above it was. Thus...
4
by: Hitesh | last post by:
Hi, I have three datagrid control on my aspx page and one export to excel button, i want to export all the 3 datagrids contents in one excel file. how can i achive that? -- Thanks Hitesh
1
by: mursyidatun ismail | last post by:
Dear all, database use: Ms Access. platform: .Net i'm trying to update a record/records in a table called t_doctors by clicking da edit link provided in the database. when i ran through da...
15
by: Arpan | last post by:
Consider the following code which retrieves data from a SQL Server 2005 DB table & displays it in a DataGrid: <script runat="server"> Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs)...
6
by: Steve Hershoff | last post by:
Hi everyone, I've got a strange one here. There are two datagrids on my page, one nested within the other. I'll refer to them as the topmost and secondary datagrids. In the topmost...
1
by: MaryamSh | last post by:
Hi, I am creating a Dynamic Search in my application. I create a user control and in Page_load event I create a dynamic dropdownlist and 2 dynamic button (Add,Remove) By pressing Add button...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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
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
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
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...

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.