can't Add property to Custom Grid view

 I Create A custom Gridview.

I need to add som custom properties to this control, but when I add the property I get error in design view  (it works fine in website):

'ds' could not be set on property 'CssClass_Main'

 this is my code: 

1    namespace Onev_Controls
2    {
3        public partial class DataView : GridView
4        {
5    
6            private string _CssClass_Main = "DataView_Main";
7            public string CssClass_Main
8            {
9                get
10               {
11                   if (ViewState["DataView_CssClass_Main"] == null)
12                   {
13                       ViewState["DataView_CssClass_Main"] = _CssClass_Main;
14                       return ViewState["DataView_CssClass_Main"].ToString();
15                   }
16                   return ViewState["DataView_CssClass_Main"].ToString();
17               }
18               set { ViewState["DataView_CssClass_Main"] = value; }
19           }
20        }
21   }
         <Onev:DataView ID="DataViewID" runat="server"  CssClass_Main="ds">
</Onev:DataView>
 

 

0
arnolds
4/25/2009 5:11:18 PM
asp.net.custom-server-controls 3498 articles. 0 followers. Follow

2 Replies
679 Views

Similar Articles

[PageSpeed] 40

Hi,

It works fine on my side. What's your Visual Studio edition?


Sincerely,
Allen Chen
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
0
Allen
4/27/2009 7:58:48 AM

 I am using vs2008.

It's working now, I needed to shutdown the program and open it again.... strange stuff

0
arnolds
4/27/2009 9:47:12 PM
Reply:

Similar Artilces:

Why can't I add controls dynamically to my customer server control?
This is a simple example of a custom control where I dynamically add a new control to the hierarchy. The problem is when I click the 'C' button, it adds the B button and then the next click of the 'C' button will hit the B_Click event handler. My only theory is that since it was added to the middle of the control heirarchy, then event handling got confused. Has anyone seen this problem or am I doing something wrong? using System; using System.Configuration; using System.Collections; using System.Text.RegularExpressions; using System.Xml; using System.Data; using S...

Web custom control
I’m extending the link button control.  I wish to add a custom design time property.  The property is a custom class (Person) with several properties (FirstName, LastName, ect..) I want to be able to fill out.  You can think of it like the “Font” --> "Bold" property. I’m using [TypeConverter(typeof(Person))] with a converter class to get the plus sign to let me access the Person’s properties.  In design time I put some value in the Person --> FirstName property and click play.  When I get back to the overridden OnClick event my Person -->...

Can't add server to tree/can't remove server.
I don't know where to start in this saga. I was merrily installing SP5 to my treee with 4 OES netware servers(all with SP4) when the second one hung because it couldn't expand a zip file. Maybe I could have recovered at that point but there was no indication that it was bacause of low disk space or anything like that. I decided to down the server (only used for NDPS printing, about 15 printers, Not that much to rebuild) Cleaned up the tree, rebuilt the server, did my DS maintenance, Could not install new server into tree. Several attempts, lots of maintenance, no success...

Can't add custom controls
Every time I click install to add a custom control, the prompt box disapears and I get squat. Happend to anyone else?...

Can't skin custom control properties
I made a trivial control as a sample and I can't seem to set its properties in my skin.  If I descend from a Label, I can set the Text property in a skin.  But I can't seem to have any of my custom properties skinnable.  What am I doing wrong?namespace MyName {    [DefaultProperty("Title")]    public class DefaultTest : WebControl    {        public DefaultTest()        {            Ti...

OLE Custom Control
I have an OLE Custom control obect inside a user object. When I open the painter, sometimes I see the control, and could open the "OLE Control Properties" screen. Sometimes, however, when I open the painter, the control is blank, and when I select the "OLE Contrl Properties" option, nothing happens. It comes back and goes away and I can't figure out what I am doing to make either behavior occur. Does anyone how to avoid this? ...

custom web control and collection: can't edit properties
Hello, I'm trying to create a custom web control to send javascript code to clients. One of the control's property is a collection of items. These items belong to a class i have created. The control work fine, but when I import it in a new WebApplication, close this application and open it again, there is an error at the initialisation and properties can't be edited. But the control still work ... Anyone could help me ? Environment : VS .NET, Windows 2000 Here some code : public class PageMenuItem { public string pmi_libelle; public string pmi_adresse; ...

Can't get this custom web server control to persist properly
I have been trying to get this working for a couple of days and can't get it right. I have read countless samples and documentation on microsoft's site and on the web to no avail. There is always some crucial piece of information missing and when it is simplified here or there it misses exactly the part I need to get right. In order to reduce overhead I have super simplified the situation but I believe it demonstrates what I want to do and what is wrong. I hope somebody can shed some light into the subject. The simplified control with design-time support is shown in the code section...

How can a custom control view another control property ?
Hello, I have a custom control on a page. However, its value is dependant upon another control's value. Is there a way for the custom control to 'see' other controls on the same page ? I guess the only way I could do this is through a global variable ? Hello my friend, Both of these controls would be on the same page.  The Page_PreRender method of the page executes after controls within it have been loaded.  Therefore, within the Page_PreRender event of the asp page you would have the following: - MyUserControl1.lblMessage.Text = TextBox1.Text This assumes lblMessage is a lab...

Can't add IE Web Control dll to my custom toolbox..help!!
Hi, I tried to add the dll to my VS.Net 2002, Framework v1.1 but it generates an error. Error is as in bold below. There are no components in 'c:\Program Files\IE Web Controls\build\Microsoft.Web.UI.WebControls.dll' that can be placed on the toolbox. But the dll does exists in the folder...please advise. lee, VS.Net 2002 is hardwired to Framework 1.0DNN skins ForumTressleworks modulesDNN & webhostingIEWCtrls Reinstall 1.0 Alter your batch file to run <Framework 1.0>csc.exe to recompile the dll Try to add the new components again.DNN skins ForumTressleworks mo...

Web custom Control - can't acces image url in Resources folder
 I'm working on a custom web server control that is suppose to give information on a doctor.  The final goal is to place the control in a hover extender panel, so when you hover over the doctor picture, this control pops up, and play a recording of there voice introducing themself. I'll get to the sound part this weekend.So far, it seems that all of the references I search are examples for aspx pages. The line in bold are confusing me.This is a class dll project named teamRoster Right now, I'm trying to access a image in the resource folder called BalloonPointer1.g...

ERROR [HY000] [MySQL][ODBC 3.51 Driver]Can't connect to MySQL server on 'IP Address of the server'(10048) ERROR [HY000] [MySQL][ODBC 3.51 Driver]Can't connect to MySQL server on 'IP of the server' (10
Hi, I am randomly getting the following error message in my application. ERROR [HY000] [MySQL][ODBC 3.51 Driver]Can't connect to MySQL server on 'IP Address of the server'(10048) ERROR [HY000] [MySQL][ODBC 3.51 Driver]Can't connect to MySQL server on 'IP of the server' (10048) I am using .Net 2.0 with VS2005 having ODBC 3.51.14 Driver.  Can any body point out the core reasons of the above error message? Thanks. Nouman Khawaja. I do have the same problem, help me out. Thanks  If the going seems easy, You are going DownHill... When I was writing ...

adding custom properties to a custom server control
1.  I want to add a public property to a custom server control.  the property is called Search Type and the possible choices that will appear in the properties window from the asp.net page would be client, provider, vendor and service.  I want this property to function much like the border style property works for an asp.net button. 2.  My second question would be how do I add a section to the properties window?  What i mean is for this custom server control, i want to add a section called Search Features much like the appearance or behavior sections for an asp.net ...

custom property style for a custom server control
Can I add a proerty for style on my asp .net custom server control, seems to be one for everything else. Or do you have to go do one style at a time: backgroundColor, Font, etc....

Web resources about - can't Add property to Custom Grid view - asp.net.custom-server-controls

Resources last updated: 12/10/2015 7:09:04 AM