info

V

Victor Rodriguez

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
 
S

Steven Cheng[MSFT]

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.
 
V

Victor Rodriguez

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 said:
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.
 
S

Steven Cheng[MSFT]

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.
 
V

Victor Rodriguez

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
 
S

Steven Cheng[MSFT]

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top