Treeview click events - whole row instead of just the caption?
It seems that treeviews require the user to click on a node's caption (or
icon) in order to generate a postback. I'd like to be able to click
anywhere on the row (eg, hook up the event to the encapsulating <tr> tag).
How would I go about that--since the treeview doesn't give you access to its
HTML elements directly?
Date:Tue, 14 Aug 2007 18:46:37 -0400
Author:
|
RE: Treeview click events - whole row instead of just the caption?
Hi,
I think the only way how to achieve this is to write custom adapter for
TreeView. If you want to do this way you can start from CssFriendlyAdapters
and modify only part of TreeView affecting your functionality.
I konw this task is possible only for GridView where you can handle
RowDataBound event and add onclick attribute to row. But this is possible
only because row has attributes (HTML attributes) collection. TreeNode does
not offer this collection so thats the reason why I think you will not
achieve this task without rewriting tree view rendering.
Regards,
Ladislav
"Homer J. Simpson" wrote:
> It seems that treeviews require the user to click on a node's caption (or
> icon) in order to generate a postback. I'd like to be able to click
> anywhere on the row (eg, hook up the event to the encapsulating <tr> tag).
> How would I go about that--since the treeview doesn't give you access to its
> HTML elements directly?
>
>
>
Date:Wed, 15 Aug 2007 00:18:02 -0700
Author:
|