Re: edititemtemplate datagrid problem

Tech-Archive recommends: Fix windows errors by optimizing your registry



marty.overdear@xxxxxxxxxxxxxx wrote:
I have a datagrid being populated by a datasource.  I decided to change
one of the of the display fields in the datagrid to a dropdownlist.  I
am trying to do it using edititemtemplate.  The data for this row no
longer gets populated like it did for the regular datagrid.
   What do I have to do extra to get it to populate??

You have to write code to populate the DDL with the list of applicable choices AND to assign the DDL's SelectedIndex to the correct value for the record being edited. It's not a trivial task, unfortunately. However, this article may help:
http://aspnet.4guysfromrolla.com/articles/080702-1.aspx


Another, easier, option is to use MetaBuilder.com's *free* BoundLookupColumn control:
http://metabuilders.com/Tools/BoundLookupColumn.aspx


hth

--

    Scott Mitchell [ASP.NET MVP]
    mitchell@xxxxxxxxxxxxxxxxxx
    http://www.4GuysFromRolla.com/ScottMitchell
.



Relevant Pages

  • dropdownlist in datagrid
    ... I have a datagrid which I populate with data from XML file. ... EditItemTemplate I have a dropdownlist. ...
    (microsoft.public.dotnet.framework.aspnet)
  • edititemtemplate datagrid problem
    ... I have a datagrid being populated by a datasource. ... one of the of the display fields in the datagrid to a dropdownlist. ... What do I have to do extra to get it to populate?? ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: Newbie object design questions
    ... Chip - you can use a Reader to populate your business objects, ... If you use a DataTable/DataSet you can also bind your grid to this and with ... > objects in some form of collection that could be placed into a DataGrid. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Object does not match target type.
    ... residing in the directory named "Folder1". ... In order to populate the DataGrid ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Data Access in web forms
    ... >> want to populate those from the database. ... >> but nothing gets populated in the text boxes. ... >> Is there any sample where it shows/teaches data access without a datagrid ...
    (microsoft.public.dotnet.framework.aspnet)