473,602 Members | 2,846 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Extender Provider not saving value

Hi,

I have implemented the IExtenderProvid er interface (and inherited from
Component) in a class that I am using with ASP.NET controls. The field
shows up fine in the VS.NET properties grid, however the value are not
persisted anywhere (I would have expected it to show up in the VS.NET
designer portion of the code), and disapear from the properties page after
compiling. I can manually set it from the code using
provider.SetWha tever(control, object) so I don't think it is not a problem
with the component code.

Any ideas whould be appreciated.

Thanks,

Steven
Nov 15 '05 #1
5 1422
I'm assuming that you have not used a hashtable to associate the value with
the object that owns it.

The Setxxx and Getxxx methods will not store the information automatically.
The following snippet is from a custom tooltip control. Note how each
property is stored in a hashtable with the key being the reference to the
control that has had it's properties extended.

//A utility routing to extract tipData from the hash table using the

//Control reference as a key.

protected tipData GetItem(Control c)

{

if(this._items. Contains(c))

return (tipData)_items[c];

tipData td=new tipData();

_items[c]=td;

c.MouseHover+=n ew EventHandler(c_ MouseHover);

c.MouseLeave+=n ew EventHandler(c_ MouseLeave);

return td;

}

public void SetTipText(Cont rol c, string value)

{

tipData td=GetItem(c);

td.Text=value;

}

public string GetTipText(Cont rol c)

{

tipData td=GetItem(c);

return td.Text;

}
--
Bob Powell [MVP]
C#, System.Drawing

The November edition of Well Formed is now available.
Learn how to create Shell Extensions in managed code.
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

Read my Blog at http://bobpowelldotnet.blogspot.com

"Steven" <ms******@berko vitz.org> wrote in message
news:eO******** *******@TK2MSFT NGP11.phx.gbl.. .
Hi,

I have implemented the IExtenderProvid er interface (and inherited from
Component) in a class that I am using with ASP.NET controls. The field
shows up fine in the VS.NET properties grid, however the value are not
persisted anywhere (I would have expected it to show up in the VS.NET
designer portion of the code), and disapear from the properties page after
compiling. I can manually set it from the code using
provider.SetWha tever(control, object) so I don't think it is not a problem
with the component code.

Any ideas whould be appreciated.

Thanks,

Steven

Nov 15 '05 #2
I am using a hashtable to store each instance, however I do not have a
GetItem method - could this be the problem?

"Bob Powell [MVP]" <bob@_spamkille r_bobpowell.net > wrote in message
news:O3******** ******@TK2MSFTN GP11.phx.gbl...
I'm assuming that you have not used a hashtable to associate the value with the object that owns it.

The Setxxx and Getxxx methods will not store the information automatically. The following snippet is from a custom tooltip control. Note how each
property is stored in a hashtable with the key being the reference to the
control that has had it's properties extended.

//A utility routing to extract tipData from the hash table using the

//Control reference as a key.

protected tipData GetItem(Control c)

{

if(this._items. Contains(c))

return (tipData)_items[c];

tipData td=new tipData();

_items[c]=td;

c.MouseHover+=n ew EventHandler(c_ MouseHover);

c.MouseLeave+=n ew EventHandler(c_ MouseLeave);

return td;

}

public void SetTipText(Cont rol c, string value)

{

tipData td=GetItem(c);

td.Text=value;

}

public string GetTipText(Cont rol c)

{

tipData td=GetItem(c);

return td.Text;

}
--
Bob Powell [MVP]
C#, System.Drawing

The November edition of Well Formed is now available.
Learn how to create Shell Extensions in managed code.
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

Read my Blog at http://bobpowelldotnet.blogspot.com

"Steven" <ms******@berko vitz.org> wrote in message
news:eO******** *******@TK2MSFT NGP11.phx.gbl.. .
Hi,

I have implemented the IExtenderProvid er interface (and inherited from
Component) in a class that I am using with ASP.NET controls. The field
shows up fine in the VS.NET properties grid, however the value are not
persisted anywhere (I would have expected it to show up in the VS.NET
designer portion of the code), and disapear from the properties page after compiling. I can manually set it from the code using
provider.SetWha tever(control, object) so I don't think it is not a problem with the component code.

Any ideas whould be appreciated.

Thanks,

Steven


Nov 15 '05 #3
Oops.. I wasn't paying enough attention to realize that GetItem is just
being called from SetXX and GetXX.

"Bob Powell [MVP]" <bob@_spamkille r_bobpowell.net > wrote in message
news:O3******** ******@TK2MSFTN GP11.phx.gbl...
I'm assuming that you have not used a hashtable to associate the value with the object that owns it.

The Setxxx and Getxxx methods will not store the information automatically. The following snippet is from a custom tooltip control. Note how each
property is stored in a hashtable with the key being the reference to the
control that has had it's properties extended.

//A utility routing to extract tipData from the hash table using the

//Control reference as a key.

protected tipData GetItem(Control c)

{

if(this._items. Contains(c))

return (tipData)_items[c];

tipData td=new tipData();

_items[c]=td;

c.MouseHover+=n ew EventHandler(c_ MouseHover);

c.MouseLeave+=n ew EventHandler(c_ MouseLeave);

return td;

}

public void SetTipText(Cont rol c, string value)

{

tipData td=GetItem(c);

td.Text=value;

}

public string GetTipText(Cont rol c)

{

tipData td=GetItem(c);

return td.Text;

}
--
Bob Powell [MVP]
C#, System.Drawing

The November edition of Well Formed is now available.
Learn how to create Shell Extensions in managed code.
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

Read my Blog at http://bobpowelldotnet.blogspot.com

"Steven" <ms******@berko vitz.org> wrote in message
news:eO******** *******@TK2MSFT NGP11.phx.gbl.. .
Hi,

I have implemented the IExtenderProvid er interface (and inherited from
Component) in a class that I am using with ASP.NET controls. The field
shows up fine in the VS.NET properties grid, however the value are not
persisted anywhere (I would have expected it to show up in the VS.NET
designer portion of the code), and disapear from the properties page after compiling. I can manually set it from the code using
provider.SetWha tever(control, object) so I don't think it is not a problem with the component code.

Any ideas whould be appreciated.

Thanks,

Steven


Nov 15 '05 #4
Yeah, it was just a little optimization I threw in.

Is your extender-povider working now??

--
Bob Powell [MVP]
C#, System.Drawing

The November edition of Well Formed is now available.
Learn how to create Shell Extensions in managed code.
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

Read my Blog at http://bobpowelldotnet.blogspot.com

"Steven" <ms******@berko vitz.org> wrote in message
news:OS******** ********@TK2MSF TNGP12.phx.gbl. ..
Oops.. I wasn't paying enough attention to realize that GetItem is just
being called from SetXX and GetXX.

"Bob Powell [MVP]" <bob@_spamkille r_bobpowell.net > wrote in message
news:O3******** ******@TK2MSFTN GP11.phx.gbl...
I'm assuming that you have not used a hashtable to associate the value

with
the object that owns it.

The Setxxx and Getxxx methods will not store the information

automatically.
The following snippet is from a custom tooltip control. Note how each
property is stored in a hashtable with the key being the reference to the
control that has had it's properties extended.

//A utility routing to extract tipData from the hash table using the

//Control reference as a key.

protected tipData GetItem(Control c)

{

if(this._items. Contains(c))

return (tipData)_items[c];

tipData td=new tipData();

_items[c]=td;

c.MouseHover+=n ew EventHandler(c_ MouseHover);

c.MouseLeave+=n ew EventHandler(c_ MouseLeave);

return td;

}

public void SetTipText(Cont rol c, string value)

{

tipData td=GetItem(c);

td.Text=value;

}

public string GetTipText(Cont rol c)

{

tipData td=GetItem(c);

return td.Text;

}
--
Bob Powell [MVP]
C#, System.Drawing

The November edition of Well Formed is now available.
Learn how to create Shell Extensions in managed code.
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

Read my Blog at http://bobpowelldotnet.blogspot.com

"Steven" <ms******@berko vitz.org> wrote in message
news:eO******** *******@TK2MSFT NGP11.phx.gbl.. .
Hi,

I have implemented the IExtenderProvid er interface (and inherited from
Component) in a class that I am using with ASP.NET controls. The field shows up fine in the VS.NET properties grid, however the value are not
persisted anywhere (I would have expected it to show up in the VS.NET
designer portion of the code), and disapear from the properties page

after compiling. I can manually set it from the code using
provider.SetWha tever(control, object) so I don't think it is not a problem with the component code.

Any ideas whould be appreciated.

Thanks,

Steven



Nov 15 '05 #5
No it still wont save the state.. There are similar posts around with no
answers either. Funny, when I use almost the identical code with a windows
form it works fine.
"Bob Powell [MVP]" <bob@_spamkille r_bobpowell.net > wrote in message
news:eU******** ******@TK2MSFTN GP10.phx.gbl...
Yeah, it was just a little optimization I threw in.

Is your extender-povider working now??

--
Bob Powell [MVP]
C#, System.Drawing

The November edition of Well Formed is now available.
Learn how to create Shell Extensions in managed code.
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

Read my Blog at http://bobpowelldotnet.blogspot.com

"Steven" <ms******@berko vitz.org> wrote in message
news:OS******** ********@TK2MSF TNGP12.phx.gbl. ..
Oops.. I wasn't paying enough attention to realize that GetItem is just
being called from SetXX and GetXX.

"Bob Powell [MVP]" <bob@_spamkille r_bobpowell.net > wrote in message
news:O3******** ******@TK2MSFTN GP11.phx.gbl...
I'm assuming that you have not used a hashtable to associate the value

with
the object that owns it.

The Setxxx and Getxxx methods will not store the information

automatically.
The following snippet is from a custom tooltip control. Note how each
property is stored in a hashtable with the key being the reference to the control that has had it's properties extended.

//A utility routing to extract tipData from the hash table using the

//Control reference as a key.

protected tipData GetItem(Control c)

{

if(this._items. Contains(c))

return (tipData)_items[c];

tipData td=new tipData();

_items[c]=td;

c.MouseHover+=n ew EventHandler(c_ MouseHover);

c.MouseLeave+=n ew EventHandler(c_ MouseLeave);

return td;

}

public void SetTipText(Cont rol c, string value)

{

tipData td=GetItem(c);

td.Text=value;

}

public string GetTipText(Cont rol c)

{

tipData td=GetItem(c);

return td.Text;

}
--
Bob Powell [MVP]
C#, System.Drawing

The November edition of Well Formed is now available.
Learn how to create Shell Extensions in managed code.
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

Read my Blog at http://bobpowelldotnet.blogspot.com

"Steven" <ms******@berko vitz.org> wrote in message
news:eO******** *******@TK2MSFT NGP11.phx.gbl.. .
> Hi,
>
> I have implemented the IExtenderProvid er interface (and inherited from > Component) in a class that I am using with ASP.NET controls. The field > shows up fine in the VS.NET properties grid, however the value are not > persisted anywhere (I would have expected it to show up in the VS.NET > designer portion of the code), and disapear from the properties page

after
> compiling. I can manually set it from the code using
> provider.SetWha tever(control, object) so I don't think it is not a

problem
> with the component code.
>
> Any ideas whould be appreciated.
>
> Thanks,
>
> Steven
>
>



Nov 15 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3131
by: Belinda | last post by:
Hi. I am just getting started with DB2's spatial extender and could really use some help. Pointers to good docs or examples are welcome. I am using DB2 version 8 on Sun. I have a database of genomic data and believe the spatial extender will help in querying. I have to do intersections, subtractions, proximity, etc of ranges in the chromosomes. The database and even some tables include data on all chromosomes of several species. I am...
0
923
by: Steven | last post by:
Hi, I have implemented the IExtenderProvider interface (and inherited from Component) in a class that I am using with ASP.NET controls. The field shows up fine in the VS.NET properties grid, however the value are not persisted anywhere, and disapear after compile. I can manually set it from the ASP.NET page using provider.SetWhatever(control, object) so I know it is not a problem with the component. Any ideas whould be appreciated.
0
1205
by: JezB | last post by:
Could anyone tell me how to implement an extender provider for ASP.NET ? I have done this successfully for windows forms but all the online documentation tells us is : The implementation of an extender provider for Windows Forms controls is different from that for ASP.NET server controls.
2
1384
by: JezB | last post by:
Could anyone tell me how to implement an extender provider for ASP.NET ? I have done this successfully for windows forms but all the online documentation tells us is : The implementation of an extender provider for Windows Forms controls is different from that for ASP.NET server controls.
0
956
by: JezB | last post by:
Is it possible to create an extender provider in ASP.NET such that I can drag it onto a page to extend all controls implicitly with some custom properties ? I have done this for rich client but can't find out if it's possible in ASP.NET.
1
1085
by: JezB | last post by:
I've written an extender provider for ASP.NET windows forms controls and web controls. My windows forms solution works fine, but my ASP.NET solution does not persist any property values I enter via the visual studio property grid. Upon examination of the code within InitializeComponent I can see why : no code is automatically embedded to call the Set method of my property. Anyone have any ideas why ? Is there any solution ?
0
956
by: cleo | last post by:
I've been exploring the implementation of the Extender Provider but I'm not having much luck with the documentation on the ProviderProperty Statement and the Object Types support by the Get/Set Statements. I have written a Test Class that implements IExtenderProvider to extend a Text Box with Regex String Property. The property is correctly exposed in the form designer and the Get/Set statements are working fine. But I would like to...
1
1765
by: Chris Dunaway | last post by:
I have created a simple Extender Provider and when I drop it onto a form, it appears in the component tray, but none of the controls it is supposed to provide a property for show the property in the PropertyGrid! Here is the class. The GlassButton is a custom button control that derives from button and I just do some custom painting. I am sure I have just omitted something simple, but I cannot see it. I am using VS 2005.
2
10286
by: William Youngman | last post by:
We are developing an application that presents data to the user in a gridview and we are using the dropdown extender to give the user a SharePoint 2007 type dropdown menu attached to the cells of a given column. We are also using another dropdown menu that the user can use to select data using another quesry using the SelectedIndex change method. Upon initial page load everything works fine and the user is presented with a SharePoint type menu....
0
8401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8404
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8054
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6730
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5867
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5440
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3900
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1510
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1254
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.