info

Discussion in 'ASP .Net Web Controls' started by Victor Rodriguez, Aug 13, 2007.

  1. How can I create a control that renders a <div></div> but contains for
    example a gridview that I can edit its properties on design mode?

    Thanks,

    Victor
     
    Victor Rodriguez, Aug 13, 2007
    #1
    1. Advertising

  2. Hi Victor,

    Glad to see you again, how are you doing?

    Regarding on the creating a custom control contains GridView(with
    design-time support) question, based on my experience, it would be
    difficult to do through defining a new custom web server control and make
    GridView as a nested child control. This is because in such case, we'll
    need to do the design-time work ourself for the custom control.

    So far what I can get is define a custom web control which inherit the
    built-in GridView control and override the "RenderControl" method to add
    some customized wrapper html elements. e.g.


    >>>>>>>>>>>>>>>>>>>>>>>>>

    [ToolboxData("<{0}:DivGridView runat=server></{0}:DivGridView>")]
    public class DivGridView : GridView
    {
    public override void RenderControl(HtmlTextWriter writer)
    {

    writer.RenderBeginTag("div");
    writer.AddAttribute(HtmlTextWriterAttribute.Id, "divGrid");
    writer.AddStyleAttribute(HtmlTextWriterStyle.BackgroundColor,
    "yellow");


    base.RenderControl(writer);
    writer.RenderEndTag();
    }
    }
    <<<<<<<<<<<<<<<<<<<<<<<<<

    Does this help for your scenario?

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead



    ==================================================

    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    ications.



    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    http://msdn.microsoft.com/subscriptions/support/default.aspx.

    ==================================================


    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Steven Cheng[MSFT], Aug 14, 2007
    #2
    1. Advertising

  3. I'm doing very good, thanks for asking, how are you?

    I'll try that but I think I'll have to do some designers or something to
    support what I'm envisioning.

    Thanks,

    Victor


    "Steven Cheng[MSFT]" <> wrote in message
    news:...
    > Hi Victor,
    >
    > Glad to see you again, how are you doing?
    >
    > Regarding on the creating a custom control contains GridView(with
    > design-time support) question, based on my experience, it would be
    > difficult to do through defining a new custom web server control and make
    > GridView as a nested child control. This is because in such case, we'll
    > need to do the design-time work ourself for the custom control.
    >
    > So far what I can get is define a custom web control which inherit the
    > built-in GridView control and override the "RenderControl" method to add
    > some customized wrapper html elements. e.g.
    >
    >
    >>>>>>>>>>>>>>>>>>>>>>>>>>

    > [ToolboxData("<{0}:DivGridView runat=server></{0}:DivGridView>")]
    > public class DivGridView : GridView
    > {
    > public override void RenderControl(HtmlTextWriter writer)
    > {
    >
    > writer.RenderBeginTag("div");
    > writer.AddAttribute(HtmlTextWriterAttribute.Id, "divGrid");
    > writer.AddStyleAttribute(HtmlTextWriterStyle.BackgroundColor,
    > "yellow");
    >
    >
    > base.RenderControl(writer);
    > writer.RenderEndTag();
    > }
    > }
    > <<<<<<<<<<<<<<<<<<<<<<<<<
    >
    > Does this help for your scenario?
    >
    > Sincerely,
    >
    > Steven Cheng
    >
    > Microsoft MSDN Online Support Lead
    >
    >
    >
    > ==================================================
    >
    > Get notification to my posts through email? Please refer to
    > http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    > ications.
    >
    >
    >
    > Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    > where an initial response from the community or a Microsoft Support
    > Engineer within 1 business day is acceptable. Please note that each follow
    > up response may take approximately 2 business days as the support
    > professional working with you may need further investigation to reach the
    > most efficient resolution. The offering is not appropriate for situations
    > that require urgent, real-time or phone-based interactions or complex
    > project analysis and dump analysis issues. Issues of this nature are best
    > handled working with a dedicated Microsoft Support Engineer by contacting
    > Microsoft Customer Support Services (CSS) at
    > http://msdn.microsoft.com/subscriptions/support/default.aspx.
    >
    > ==================================================
    >
    >
    > This posting is provided "AS IS" with no warranties, and confers no
    > rights.
    >
     
    Victor Rodriguez, Aug 15, 2007
    #3
  4. Thanks for your reply Victor.

    I'm doing well. No problem, please feel free to discuss here if you meet
    any further problem on this.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Steven Cheng[MSFT], Aug 16, 2007
    #4
  5. I figured it out in a different way, simpler, I'm using a datarepeater with
    a gridview inside and I created a class that inherits the gridview so that I
    can capture the parent current key and pass it on to the gridview and filter
    the gridview based on that. This way I can use the existing designers and
    everything to customize my components in design mode.

    Thanks,

    Victor


    "Steven Cheng[MSFT]" <> wrote in message
    news:...
    > Thanks for your reply Victor.
    >
    > I'm doing well. No problem, please feel free to discuss here if you meet
    > any further problem on this.
    >
    > Sincerely,
    >
    > Steven Cheng
    >
    > Microsoft MSDN Online Support Lead
    >
    >
    > This posting is provided "AS IS" with no warranties, and confers no
    > rights.
    >
     
    Victor Rodriguez, Aug 18, 2007
    #5
  6. Thanks for your followup Victor,

    Glad that you've found a solution. If possible, also welcome to share some
    of your implementation here so that some other community members can also
    benifit from it.

    Thanks again for your posting!

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Steven Cheng[MSFT], Aug 20, 2007
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vasanth
    Replies:
    0
    Views:
    599
    Vasanth
    Jun 28, 2004
  2. Andrea Williams

    Clear the Render info & change to different info

    Andrea Williams, Oct 27, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    1,458
    Ken Dopierala Jr.
    Oct 27, 2004
  3. Kiran
    Replies:
    0
    Views:
    1,257
    Kiran
    Feb 6, 2005
  4. ilya

    get CPU info, RAM info

    ilya, Apr 8, 2010, in forum: Java
    Replies:
    43
    Views:
    6,265
    Mike Schilling
    Apr 19, 2010
  5. Kenshin
    Replies:
    1
    Views:
    244
    Jeff Cochran
    Jun 25, 2004
Loading...

Share This Page