Friday, September 10, 2010
Google Custom Search

Go to...

Recent Forum Posts

Our Community

Membership Membership:
Latest New User Latest: bunk_C1
New Today New Today: 16
New Yesterday New Yesterday: 20
User Count Overall: 10768

People Online People Online:
Visitors Visitors: 1
Members Members: 0
Total Total: 1

Online Now Online Now:

ClearCanvas Community Forums

Adding CheckBoxes into Study Explorer
Last Post 2009-04-16 10:32 PM by resnickj. 2 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
ljovner
New Member
New Member
Posts:6

--
2009-04-16 02:48 PM  

Hey All,

I have been playing around with this for a few hours and cant seem to find an easy  way to add a checkbox to every line in the Study Explorer.

I would like the user to be able to check/uncheck the checkbox at will...

Can someone please give me some insight?

dreich
Basic Member
Basic Member
Posts:13

--
2009-04-16 05:14 PM  

I'm new too, but I'll take a crack at this.  I've been creating a new Study Browser plugin that goes to our own database, so I've been in the StudyBrowserComponent code a lot. 

Here's how you could do it:

In StudyBrowserComponent.AddColumns() put this near the top:

studyList.Columns.Add(new TableColumn<VIMSStudyItem, bool>(<br />
"Checked",<br />
delegate(VIMSStudyItem item) <br />
{<br />
return item.Checked;<br />
},<br />
delegate(VIMSStudyItem item, bool isChecked)<br />
{<br />
item.Checked = isChecked;<br />
},<br />
0.5f<br />
)); 

 You also need to change the StudyItem class to have a public bool property called Checked.

To use the Checked flag you would also need to change the SelectedStudies property to search the list and return the Checked StudyItems ig that's what you want to Open.  But now this is starting to muddle the ViewModel concepts of Selection and Checked.

So, that's how you could add a check box, but being new here, I don't know if that's the right way to do it.

TTFN

Dave

resnickj
Senior Member
Senior Member
Posts:891

--
2009-04-16 10:32 PM  

That is exactly how we have been doing check-boxes.  Note that there is class in Desktop called Checkable which you can use to wrap your object and then base your Table on that.

j

You are not authorized to post a reply.

Active Forums 4.1
Copyright 2010 ClearCanvas Inc.