help with silverlight c#, getting combobox value

need help getting value from combobox and comparing value to stackpane

Page 1 of 1

0 Replies - 3416 Views - Last Post: 21 May 2009 - 03:48 AM Rate Topic: -----

#1 DrakenKorin   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 7
  • Joined: 19-February 08

help with silverlight c#, getting combobox value

Post icon  Posted 21 May 2009 - 03:48 AM

Hi,

I'm going to try my best to explain my issue here:

I have a business object called "Task" that consists of TaskName, TaskStart and TaskEnd.

In my UI I have a form that allows a user to enter the above values and a "NewTaskBtn" button to create the Task obj.

Tasks are created at runtime, so each time the "NewTaskBtn" is clicked a couple of things happen

1. a Task Obj is created in the "NewTaskBtn" event handler, using the info supplied above.

2. the Task Obj is also added to a List<Task>

3. At the same time an Expander item is created, with a header consisting of a concatenated string of TaskName + TaskStart + TaskEnd, and a combobox displaying the names of all the tasks in the List<Task>

4. the Expander item is then added to a StackPanel called "TaskSP"



So, at this stage I can create tasks, and have the tasks display in my stackpanel as expanders, containing task info and combobox in the header. right?

Now here is where I hit a brick wall. What I would like to achieve next is,

1. a user should be able to create a couple of tasks, and have the stackpanel fill with epanders containing the task info and comboboxes in the expander headers(this works OK)

2. then the user should be able to select a task in the stackpanel, and using the combobox in the expander header, select another task to add this task to (as a dependancy task, if you catch my drift. in other words adding task a to task b imply's that task a has to be completed before task b can be started)

I would like to use the combobox (in the header of my expander items) selection changed event to do the following:

get the name of the selected task from the combobox, and compare it with the header of the expander items in the stackpanel, and find the matching expander item in the TaskSP. So some sort of linq query that would include a where clause??? this is where I'm completely lost. If I can just get help achieving this, I will be most happy :D

Is This A Good Question/Topic? 0
  • +

Page 1 of 1