Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Class design
Message
 
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Environment versions
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01401807
Message ID:
01402325
Views:
51
>>>I'm not really clear on what you're asking - but see inline:
>>>
>>>>I want to subclass a DataGrid control (in .NET CE) environment. In particular, I want to have a common property _rowNumber and a common MouseUp event updating this number.
>>>>
>>>>This part I was able to figure out myself.
>>>>
>>>>Now, in addition I also want to have TableStyle as a property (can I use SET/GET the same way as with a regular property?)
>>>Yes
>>>>and a new signature for a method FormatGrid. The actual implementation of this method I'd like to have coded in the form.
>>>>So, can you please just tell me what would be the syntax here to declare this method in C#?
>>>
>>>When you say you want to implement the method in the form I assume you mean in the DataGrid subclass that will be used on the form? If so just add the method to the base class and mark it as either abstract or virtual depending on your needs. Flesh it out in the sub-classes. Hope I understood what you want ?
>>
>>Viv,
>>
>>What is the exact syntax here? That's what I need to know.
>
>How can I give exact syntax for the method when I don't know the parameters and return type? Something like:
    public partial class Junk
>    {
>          public virtual void FormatGrid(string s, int i) {}
>    }
>
>    public class Junk2 : Junk
>    {
>        public override void FormatGrid(string s, int i)
>        {
>            //Implement here
>        }
>    }
>    public class Junk3 : Junk
>    {
>        public override void FormatGrid(string s, int i)
>        {
>            //Implement here
>        }
>    }
>
Actually, now I see that this is not what I wanted and it is not working for me.

I wanted to add a new method to my DataGrid class called FormatGrid. I added it using the syntax you showed -

{
public virtual void FormatGrid(string s, int i) {}
}

in my DataGrid class. But now, how can I implement the actual logic for the instances of this class in my form?
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform