Hello,
I create a custom control which inherits CompositeControl and put it in template column. Controls contains textbox and button. Here is how I render it:
And it looks like this: http://ybex.com/d/hftqcnpzn4hf6rel5tzore55a8gw6tulq10aeh67.html
And this also happens when I put your control, i.e. DateTimePicker in template column. When I create column, I set its width manually, so I suppose controls in template should "know" its parent width and fit accordingly.
How can I fit controls into cell? Also I would like to stretch column when filter control doesn't fit its width.
I'm not sure those 2 questions are not mutually exclusive but they're both issues I want to solve.
Thank you.
I create a custom control which inherits CompositeControl and put it in template column. Controls contains textbox and button. Here is how I render it:
writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID); writer.AddAttribute(HtmlTextWriterAttribute.Style, "width:100%", false); writer.RenderBeginTag(HtmlTextWriterTag.Table); writer.RenderBeginTag(HtmlTextWriterTag.Tr); writer.AddAttribute(HtmlTextWriterAttribute.Style, "padding: 0;margin: 0;width:95%", false); writer.RenderBeginTag(HtmlTextWriterTag.Td); _textbox.RenderControl(writer); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Style, "padding: 0;margin: 0;width: 24px", false); writer.RenderBeginTag(HtmlTextWriterTag.Td); _clearButton.RenderControl(writer); writer.RenderEndTag(); writer.RenderEndTag(); writer.RenderEndTag();
And it looks like this: http://ybex.com/d/hftqcnpzn4hf6rel5tzore55a8gw6tulq10aeh67.html
And this also happens when I put your control, i.e. DateTimePicker in template column. When I create column, I set its width manually, so I suppose controls in template should "know" its parent width and fit accordingly.
How can I fit controls into cell? Also I would like to stretch column when filter control doesn't fit its width.
I'm not sure those 2 questions are not mutually exclusive but they're both issues I want to solve.
Thank you.