Home All Groups Group Topic Archive Search About

How can I use my Own control in DataGrid?

Author
20 May 2005 9:34 AM
Information
Hi,
I am trying to use my own calender control into datagrid but on clicking on
it, i can not open that control. I am having date by choosing it from that
control into input textbox.

Author
21 May 2005 5:06 AM
Steve Goodyear
You can add your control inside a TemplateColumn:
<Columns>
<asp:TemplateColumn>
  <ItemTemplate>

   <uc1:MyControl ...

  </ItemTemplate>
  <EditItemTemplate></EditItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>

Cheers,
Steve Goodyear
Author
23 May 2005 6:15 AM
Information
Thanx Steve :)
I've tried to use my calendar control by putting it in User Control and use
it as u've told me but still it doesn't open on clicking on icon.

<asp:TemplateColumn HeaderText="Date">
                                    <ItemTemplate>
                                        <asp:Label id=lbldate runat="server" Text='<%#
DataBinder.Eval(Container.DataItem,"Date") %>'>
                                        </asp:Label>
                                    </ItemTemplate>
                                    <FooterTemplate>
                                        <uc1:Calendar id="Calendar1" runat="server"></uc1:Calendar>
                                    </FooterTemplate>
                                    <EditItemTemplate>
                                        <INPUT id="txtDate" Runat="server">
                                    </EditItemTemplate>
                                </asp:TemplateColumn>
i want it in footer
thanx for ur cooperation

Show quoteHide quote
"Steve Goodyear" wrote:

> You can add your control inside a TemplateColumn:
> <Columns>
> <asp:TemplateColumn>
>   <ItemTemplate>
>
>    <uc1:MyControl ...
>
>   </ItemTemplate>
>   <EditItemTemplate></EditItemTemplate>
> </asp:TemplateColumn>
> </Columns>
> </asp:DataGrid>
>
> Cheers,
> Steve Goodyear