473,382 Members | 1,583 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.

Datagrid Question

Hi Guys,

I am programming in VB .net. I have a datagrid with template column. Each
row as Checkbox and a Linkbutton in it. I have defined onCommand for
Linkbutton. I am having trouble figuring out how to find if the checkbox is
selected or not and retrieve value set for check box.

Please assist me on this.

Thanks

Manny
Nov 19 '05 #1
3 2032
Hi Manny,

You can use linkButton object's NamingContainer property
to find out clicked DataGridItem. Then use the
DataGridItem's FindControl method to get CheckBox object.
HTH

Elton Wang
el********@hotmail.com

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

I am programming in VB .net. I have a datagrid with template column. Eachrow as Checkbox and a Linkbutton in it. I have defined onCommand forLinkbutton. I am having trouble figuring out how to find if the checkbox isselected or not and retrieve value set for check box.

Please assist me on this.

Thanks

Manny
.

Nov 19 '05 #2
Hi Manny,

You can use linkButton object's NamingContainer property
to find out clicked DataGridItem. Then use the
DataGridItem's FindControl method to get CheckBox object.
HTH

Elton Wang
el********@hotmail.com

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

I am programming in VB .net. I have a datagrid with template column. Eachrow as Checkbox and a Linkbutton in it. I have defined onCommand forLinkbutton. I am having trouble figuring out how to find if the checkbox isselected or not and retrieve value set for check box.

Please assist me on this.

Thanks

Manny
.

Nov 19 '05 #3
In the Grid's ItemCommand event find the Checkbox via the ItemCommandEventArgs.Item.FindControl()
method.

CheckBox cb = e.Item.FindControl("CheckBoxID") as CheckBox;
// now get cb.Checked

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi Guys,

I am programming in VB .net. I have a datagrid with template column.
Each row as Checkbox and a Linkbutton in it. I have defined onCommand
for Linkbutton. I am having trouble figuring out how to find if the
checkbox is selected or not and retrieve value set for check box.

Please assist me on this.

Thanks

Manny


Nov 19 '05 #4

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

Similar topics

2
by: magister | last post by:
Hello, I have xml like this.... <test> <question>sdfsa</question> <section><question>43ga</question> <question>asdf</question> </test>
2
by: pei_world | last post by:
I want to implement a key hit with enter to dropdown a combobox that is in the datagrid. in this case I need to override its original behaviours. I found some codes from the web. Does anyone know...
2
by: Dominic | last post by:
Hi guys, I'm not sure if this question belongs to FAQ, but I couldn't find a concrete answer. I created a Datagrid control using ItemTemplate, but it's NOT a in-place editing datagrid. One of...
4
by: Jan Nielsen | last post by:
Hi all I'm a former Access developer who would like to implement a many-to-many relation in about the same way you do in Access: With a subform and a combo box. Is it possible to use a...
13
by: pmcguire | last post by:
I have a DataGrid control for which I have also created several new extended DataGridColumnStyles. They behave pretty nicely, but I can't figure out how to implement Selected Item formatting for...
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
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: 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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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...

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.