CodeVerge.Net Beta


   Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > Asp.Net Forum > general_asp.net.web_parts_and_personalization Tags:
Item Type: Date Entered: 10/19/2005 8:35:45 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 3 Views: 43 Favorited: 0 Favorite
4 Items, 1 Pages 1 |< << Go >> >|
"SribKushal" <>
NewsGroup User
Personalize the treeview control...10/19/2005 8:35:45 PM

0

Hi,

I have a treeview control in a webpartzone. How can i personalize the treeview for each user.

thanks

"helenyan" <>
NewsGroup User
Re: Personalize the treeview control...10/25/2005 12:29:51 AM

0

One way you can personalize a treeview control is by overriding the treeview control, expose the properties that you want to be personalizable by users and put that control in the webpartzone.

An example is a simple custom treeview which allows users to personalize the foreground color:

public class PersonalizableTreeView : TreeView {
   [Personalizable]   <-- override this property and mark it personalizable
   
public override System.Drawing.Color ForeColor {
      
get {
         
return base.ForeColor;
      }
      
set {
         
base.ForeColor = value;
      }
   }
}

Hope this answers your question.
Helen


This posting is provided "AS IS" with no warranties, and confers no rights.
"SribKushal" <>
NewsGroup User
Re: Personalize the treeview control...10/26/2005 12:47:36 PM

0

Hi Helen,

Thanks for the reply.
Actually i want to save the nodes that have been checked or the nodes that have been collapsed or expanded in a tree.
So that when logged in again we have the same view of the tree. Can that be done?



"Luis Abreu" <>
NewsGroup User
Re: Personalize the treeview control...11/1/2005 7:42:32 PM

0

hello.

well, put your treeview inside a webpart control and implement the IPersonalizable interface (hope the name hasn't changed since beta2). the easiest way to do this is to put the tree view inside a user control. here's a quick example that uses a suer control to maintain the value of a radio button:

<%@ Control Language="C#" ClassName="RadioButtonWebPart" %>

<%@ Import Namespace="System.Web.UI.WebControls.WebParts" %>

<%@ Implements

 Interface="System.Web.UI.WebControls.WebParts.IPersonalizable" %>

<script runat="server">

 private bool _isDirty = false;

 public void Load( PersonalizationDictionary dic ) {

   PersonalizationEntry entry = dic["Sex"];

   if( entry != null ) {

    sex.SelectedValue = (string)entry.Value;

   }

 }

 public void Save( PersonalizationDictionary dic ) {

  dic ["Sex"] = new PersonalizationEntry( sex.SelectedValue,

      PersonalizationScope.User );

    }

 public bool IsDirty {

  get{ return _isDirty; }

 }

 void ProcessChanged( object sender, EventArgs args ) {

   _isDirty = true;

 }

</script>

Sexo:

<asp:RadioButtonList runat="server" ID="sex"

   OnSelectedIndexChanged="ProcessChanged">

 <asp:ListItem Text="Masc" Value="M"  />

 <asp:ListItem Text="Fem" Value="F"  />

</asp:RadioButtonList>






--
Regards,
Luis Abreu
email: labreu_at_gmail.com
PT blog: http://weblogs.pontonetpt.com/luisabreu
EN blog:http://msmvps.com/blogs/luisabreu
http://www.pontonetpt.com
http://weblogs.pontonetpt.com/
4 Items, 1 Pages 1 |< << Go >> >|


Free Download:













web parts

generated webpartzones don't work (a.k.a. "never ending web part problems")

definition of getpropertyvalue method in profile class

custom profile

weird things with minimize and close

private messeges: how to?

editing labels within a web part

bug in webparts - drop cue too small in standards mode

assigning edit & view roles to webparts

how to create editor part as usercontrol ? (webparts)

webpart manager is undefined

usercontrols as templates for my webparts

gridview.rowdeleted event not firing in a webpart

webpart catalogue

webparts disapear

webpart issue: urgent

webpart postback crashes ie 7

activating the "remember me next time" in the login control in a custom membership

web content in content place holder

minimizing webpartzone crashes

access profile provider

asp.net 2.0 profile

custom webpart catalog implemented in a web custom control

different ui/theme/class/color for different webparts in a single webpartzone

webpartchrome and verb

vs 2008 web application project and custom profile

how to set the height of a webpartzone

enums

profile objects - 2 demensional array

layouttemplate for webpartzone

please send me simple web part projects.

how do you pass data from one web part to another?

<allow users="*" verbs="entersharedscope"/> in web.config file

webparts and toolspart

webpart properties' title?

get custom webpartzone from webpartmanager?

editorpart and personalization data

add control to webpart

swapping of two webpartzones

tabbed web part of different user controls?

anonymous profile vs. cookies

remove header text from webpartzone..pls reply

web parts dinamicle into page

<zonetemplate><% ... %></zonetemplate>

how do i implement iwebparts for a system

reset webparts personalization

webparts on many places

how to store a value in a hidden field with a return value from a javascript function

profiles - system.nullreferenceexception ??

errors in sharepoint

   
  Privacy | Contact Us
All Times Are GMT