This is a migrated thread and some comments may be shown as answers.

Resource Header Click Event

3 Answers 81 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
ChrisC.
Top achievements
Rank 2
ChrisC. asked on 28 Oct 2010, 08:20 PM
Hi, 
I am trying to use the ResourceHeaderTemplate to add additional functionality to my RadScheduler, but am faced with an issue.  I can't find a "ResourceHeaderClick" event.  Is there such a thing?  If not, is there an alternative way to accomplish what I'm trying to do? 

If you take a look at the attached image you'll see that I have placed two CheckBoxes and a TextBox in the ResourceHeaders.  What I would like to do is detect CheckChanged and TextChanged events of said controls, with access to the accompanying appointment to which they are resources.

Thanks,
-ChrisC.

3 Answers, 1 is accepted

Sort by
0
ChrisC.
Top achievements
Rank 2
answered on 28 Oct 2010, 11:52 PM
Also, if it is possible to handle a click even on the ResourceHeaders, I was wondering if it's possible to set the width/height of the ResourceHeader.

See the attached image for an example of what I'm running into.
0
T. Tsonev
Telerik team
answered on 03 Nov 2010, 05:07 PM
Hello Chris,

There is no dedicated event for resource header click, but you can handle the events of the controls in the template. For example:

<ResourceHeaderTemplate>
    <asp:CheckBox runat="server" ID="ResourceCheckBox" Text='<%# Eval("Text") %>' OnCheckedChanged="ResourceCheckBox_CheckChanged"
        AutoPostBack="true" />
</ResourceHeaderTemplate>

protected void ResourceCheckBox_CheckChanged(object sender, EventArgs e)
{
    Control bindingContainer = ((Control) sender).BindingContainer;
    IDataItemContainer dataItemContainer = (IDataItemContainer) bindingContainer;
    Resource resource = dataItemContainer.DataItem as Resource;
     
    // ...
}

You have access to the resource that raised the specific event through the BindingContainer.

The header width can be controlled with the RowHeaderWidth="152px" property. The height is dynamically calculated and depends on the number of appointments and on the RowHeight property.

I hope this helps.

Kind regards,
Tsvetomir Tsonev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
ChrisC.
Top achievements
Rank 2
answered on 03 Nov 2010, 06:58 PM
That was exactly it!!  Thanks a lot, you've saved my life!!
Tags
Scheduler
Asked by
ChrisC.
Top achievements
Rank 2
Answers by
ChrisC.
Top achievements
Rank 2
T. Tsonev
Telerik team
Share this question
or