Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
|
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 26th, 2010, 07:39 PM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 101
Thanks: 0
Thanked 1 Time in 1 Post
Default In C# (or in C# with WPF), how would I build a checkbox at run time?

In C# (or in C# with WPF), how would I build a checkbox at run time? I would I be able to query the check box to see if the user clicked on it?

In other words, suppose I have a "grid" on which I want to have displayed some checkboxes. But I do not know how many checkboxes to display. I suppose I could (in WPF) fill the grid with checkboxes at design time and mark them as hidden (or visibly == false) and then show them at run time. But I was hoping there was a more elegant way to do this.
 
Old June 29th, 2010, 10:22 PM
Authorized User
 
Join Date: Jul 2007
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here is the pseudo code

GridViewCell myCheckboxCell = new GridViewCell();
myCheckboxCell .cellStyle = checkbox;

//Add new row
myGridView.Rows.Add(1);
myGridView.Rows[ ].Cell[ ] = myCheckBoxCell

I believe there are other ways to do it.
Refer
http://msdn.microsoft.com/en-us/libr...boboxcell.aspx

With regards,





Similar Threads
Thread Thread Starter Forum Replies Last Post
Access: Checkbox input to build query soglejr Access 4 January 28th, 2008 09:49 AM
BUILD FAILED during run ANT Nimeshkd EJB 0 October 19th, 2007 12:04 AM
Design-Time or Run-Time now ? ALGNET .NET Framework 2.0 1 July 31st, 2006 04:43 AM
Run time Help Dazzer96 Access VBA 2 May 3rd, 2006 07:03 AM
Any run time version? jeffcflam Crystal Reports 0 March 8th, 2004 04:43 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.