reinoutkool
asked on
multiple images in treeview
is it possible to add multiple images in a treeview-row with different actions?
as far as I know it is only possible to add only one custom image and even that image.
the idea would be
+ [image] [image] [image] itemname
+ [image] [image] [image] itemname
etc
hope someone can help!
or is there an other tool for the job
as far as I know it is only possible to add only one custom image and even that image.
the idea would be
+ [image] [image] [image] itemname
+ [image] [image] [image] itemname
etc
hope someone can help!
or is there an other tool for the job
ASP.NET or WinForms TreeView?
ASKER
vb.net treeview
the only way I can think of is:
node.txt = "text of node here"
node.txt = node.txt + "<a href='#'><img scr='path-to-img'></a>"
node.txt = node.txt + "<a href='#'><img scr='path-to-img'></a>"
node.txt = node.txt + "<a href='#'><img scr='path-to-img'></a>"
the only way I can think of is:
node.txt = "text of node here"
node.txt = node.txt + "<a href='#'><img scr='path-to-img'></a>"
node.txt = node.txt + "<a href='#'><img scr='path-to-img'></a>"
node.txt = node.txt + "<a href='#'><img scr='path-to-img'></a>"
OK, that looks like ASP.NET TreeView. Did that way work for you?
ASKER
yes it works. but now the links are normal html links, not postback. isn't there a way to add multiple link buttons to the treeview?
When you create a LinkButton, it renders as a special anchor element, with a call to __doPostBack.
<a id="LinkButton1" href="javascript:__doPostB ack('LinkB utton1','' )">LinkBut ton</a>&nb sp;</div>
<a id="LinkButton1" href="javascript:__doPostB
<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
//]]>
</script>
<div>
<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWAgLGrYuuCwLM9PumD+FE4KFENnlaEGuQ4O6N7u//H6Ff" />
</div>
<div>
<a id="LinkButton1" href="javascript:__doPostBack('LinkButton1','')">LinkButton</a> </div>
</form>
</body>
</html>
ASKER
yes, but is it possible to mix strings with an imagebutton?
Dim lnk As New ImageButton()
lnk.ImageUrl = "path here"
lnk.PostBackUrl = "url here"
node.txt = "some string"
node.txt = node.txt + lnk
Dim lnk As New ImageButton()
lnk.ImageUrl = "path here"
lnk.PostBackUrl = "url here"
node.txt = "some string"
node.txt = node.txt + lnk
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
yes I'm aware of make a test page, and that's what I do often. the questions was if treeeview was the right tool foor the job and if so, is the solution I suggested the right thing to do. or if there is another, better, solution.
I tried to mix html and hard coded postback links as you suggested and that works fine.
problem solved!
I tried to mix html and hard coded postback links as you suggested and that works fine.
problem solved!