Webpage app I'm trying to develop

P

Paul

Hi, I'm pretty new to ASP.NET so not even sure how to do this correctly.

On a webpage I want to display a table with rows of data from a database
table (that bit I can do using datagrids etc).

However against each row of data I want a column with a checkbox. The user
can check off each data row they want, and when they click aSUBMIT button at
the bottom of the screen it will read the contents of the checkbox and write
back to the databas table.

Is there a way to add a checkbox to each row of the datagrid?

I'm thinking alternitivitly I can programmatically build the HTML table and
then I can do pretty much what I want, but I would prefer to use the
datagrid if I can.

Any hints would be appreciated
Paul
 
G

Guest

Paul

Check the sample below
http://samples.gotdotnet.com/quicks...ms/ctrlref/webctrl/datagrid/VB/datagrid13.asp

Check the code in the following link
http://samples.gotdotnet.com/quicks...bforms/ctrlref/webctrl/datagrid/datagrid13.sr

Suresh


----- Paul wrote: ----

Hi, I'm pretty new to ASP.NET so not even sure how to do this correctly

On a webpage I want to display a table with rows of data from a databas
table (that bit I can do using datagrids etc)

However against each row of data I want a column with a checkbox. The use
can check off each data row they want, and when they click aSUBMIT button a
the bottom of the screen it will read the contents of the checkbox and writ
back to the databas table

Is there a way to add a checkbox to each row of the datagrid

I'm thinking alternitivitly I can programmatically build the HTML table an
then I can do pretty much what I want, but I would prefer to use th
datagrid if I can

Any hints would be appreciate
Pau
 
S

Scott Mitchell [MVP]

Paul said:
On a webpage I want to display a table with rows of data from a database
table (that bit I can do using datagrids etc).
However against each row of data I want a column with a checkbox.

Paul, look into using Andy Smith's free BoundBooleanColumn DataGrid
column class.
http://metabuilders.com/Tools/BoundBooleanColumn.aspx

Happy Programming!

--

Scott Mitchell
(e-mail address removed)
http://www.4GuysFromRolla.com
http://www.ASPFAQs.com
http://www.ASPMessageboard.com

* When you think ASP, think 4GuysFromRolla.com!
 
Joined
Sep 28, 2006
Messages
1
Reaction score
0
How do I retrieve the value from the MetaBuilder BoundBooleanColumn

I love the stuff from Metabuilder, and I am trying to use the BoundBooleanColumn, but I have run into an odd problem. I can't retrieve information from the column.

When I try to do something like the following:

html...
<mbbbc:BoundBooleanColumn SelectionMode="CheckBox" DataField="BooleanValue" HeaderText="Tax" AllowNull="false" NullDefault="false" DataNullString="" />

CodeBehind...
dim mBool as boolean
mBool = CType(e.Item.Cells(3).Controls(0), CheckBox).Checked

I get an error that says the there is an invalid cast exception.

How do I retrieve the value of the checkbox?

Thanks,

Ken


Scott Mitchell [MVP] said:
Paul wrote:
> On a webpage I want to display a table with rows of data from a database
> table (that bit I can do using datagrids etc).
> However against each row of data I want a column with a checkbox.


Paul, look into using Andy Smith's free BoundBooleanColumn DataGrid
column class.
http://metabuilders.com/Tools/BoundBooleanColumn.aspx

Happy Programming!

--

Scott Mitchell
(e-mail address removed)
http://www.4GuysFromRolla.com
http://www.ASPFAQs.com
http://www.ASPMessageboard.com

* When you think ASP, think 4GuysFromRolla.com!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top