Last post Aug 02, 2010 04:53 AM by bharat_h03
Aug 02, 2010 02:58 AM|nakshatra_!3|LINK
I want to create custom control which is having div and grid together by extending serevr side control properties ,is this possible.Please guide on this
Aug 02, 2010 03:25 AM|sansan|LINK
I want to create custom control which is having div and grid together by extending serevr side control properties ,is this possible
I don't think you can extend them and use it in the page containing the control.
what you can do is create a public property for the control and you can access its properties
private GridView m_GridView =new GridView();
private string m_GridViewProperty = "";
public GridView RecordsGridView
m_GridView = value;
public string GridViewProperty
m_GridViewProperty = value;
// set your gridview property here
you can set the gridview property or access the gridview and set the property from your page
hope this helps
Aug 02, 2010 04:37 AM|nakshatra_!3|LINK
Aug 02, 2010 04:44 AM|sansan|LINK
I don't think there is a way to do that.
You have to create your custom properties and set the property of the Gridview based on the value.
pick the properties that you want to use and set them to the gridview in the user control
you can inherit a custom user control class from gridview or try using two or three classes to inherit GridView class and get the properties.
You can access them, where is the setter for that property to actually reflect your gridview in the user control
There has to be some means to set the property correct?
you can also use FindControl to find the gridview and set the property value directly, That's another option
Does that make sense??
Aug 02, 2010 04:53 AM|bharat_h03|LINK
I think that you are referring the custom control's render tag to be "DIV". Refer the below code to achieve this.
protected override HtmlTextWriterTag TagKey
Hope this will help you.
custom control server tag
Custom control attributes