How do I databind a TextBox in EditItemTemplate?

Ask a Question related to ASP.NET Data Grid Control, Design and Development.

  1. #1

    Default How do I databind a TextBox in EditItemTemplate?

    Simply put - I want the data in my rows to appear in various controls when I
    click Edit.

    My datagrid contains several template columns and I'm using
    DataBinder.Eval(Container.DataItem, fieldname) to bind data in my
    ItemTemplates.

    However, I can't seem to use it for the TextBoxes in my EditItemTemplates.
    All the examples I can find say to set the Text property - but that does not
    seem to exist anymore and generates a schema error if I manually enter it.

    How do I do this? Thanks!
    morrisb Guest

  2. Similar Questions and Discussions

    1. EditItemTemplate FindControls
      Hi, What I am trying to do is save the values from the ItemTemplate textboxs, which I already do and when I go into Edit mode insert values into...
    2. how do i access a dropdownlists selected value in a datagrid edititemtemplate column from the selectedindexchanged event of another dropdownlist in a datagrid edititemtemplate column
      i am trying to trap the value of one dropdownlist (in a datagrid edititemtemplate column) at the time its selectedindexchanged event fires and use...
    3. Problem with textbox in template column and databind
      I am having a problem with the datagrid and a template column that is giving me fits. In the HTML, I have the grid defined at design time as just...
    4. BUG in DataBind? After .DataBind there are more DataGrid Items than DataSet Rows!
      Consider: Private Sub BindData(ByRef objDataSet As DataSet) Dim x% = DataGrid_Report.Items.Count() Dim y% = objDataSet.Tables(0).Rows.Count() '...
    5. EditItemTemplate
      I have a managed to get the OnEditCommand to run on my datagrid but ALL the columns become editable. I dont want this. Is it possible for only one...
  3. #2

    Default Re: How do I databind a TextBox in EditItemTemplate?

    Try posting some snippet code!
    You can just bind it to the text property and you will get
    what you want
    Patrick

    "morrisb" <morrisb@discussions.microsoft.com> wrote in message
    news:8AD0AAF6-675E-4DAD-9ABF-7616372D91CD@microsoft.com...
    > Simply put - I want the data in my rows to appear in various controls when
    I
    > click Edit.
    >
    > My datagrid contains several template columns and I'm using
    > DataBinder.Eval(Container.DataItem, fieldname) to bind data in my
    > ItemTemplates.
    >
    > However, I can't seem to use it for the TextBoxes in my EditItemTemplates.
    > All the examples I can find say to set the Text property - but that does
    not
    > seem to exist anymore and generates a schema error if I manually enter it.
    >
    > How do I do this? Thanks!

    Patrick.O.Ige Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139