Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_professional thread: DataGrid, EditItemTemplates


Message #1 by "Andrew Bradnan" <andrew@w...> on Fri, 13 Sep 2002 18:51:06 -0700
I am trying to Edit an item in a DataGrid.  Almost all of the code was
moved from a DataList class.  It appears to work completely differently.

 

Normally I try and set my DataSource, for my derived controls, in the
OnItemCreated event for the DataGrid/List.  Strangely these are all
TableCell's, none of my UserControls are there.

 

I've even stepped through the OnItemDataBound for that control, and sure
enough it has none of it's properties filled in.

 

Anybody know why these work completely differently?

 

 

<whirly:DataGrid

            DataTable="StaffList"

            DataKeyField="StaffID"

            AutoGenerateColumns=False

            runat=server>

            

            <columns>

 

            <asp:TemplateColumn

                        HeaderText="Group"

                        runat=server>

                        <ItemTemplate><%#
DataBinder.Eval(Container.DataItem, "SecurityGroup") %></ItemTemplate>

                        <EditItemTemplate>

                                    <whirly:DropDownList

 
DataTable="SecurityGroup"

 
DataKeyField="SecurityGroupID"

                                                DataTextField="Name"

                                                Foo=<%#
AutoBindDataSource(sender) %>

                                                runat=server/>

                        </EditItemTemplate>

            </asp:TemplateColumn>

 

Thanks,

Andrew



  Return to Index