DataGrid Editing!

Discussion in 'ASP .Net' started by =?Utf-8?B?UmFlZCBTYXdhbGhh?=, Feb 6, 2005.

  1. Dear :

    I have datagrid with 5 databound columns I need when user click edit link to
    just edit the first cell for each row in column (1). and other 4 columns
    keeps its previous form as non editable cell.

    how can I achieve this?
    =?Utf-8?B?UmFlZCBTYXdhbGhh?=, Feb 6, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?UmFlZCBTYXdhbGhh?=

    Riki Guest

    Raed Sawalha wrote:
    > Dear :
    >
    > I have datagrid with 5 databound columns I need when user click edit
    > link to just edit the first cell for each row in column (1). and
    > other 4 columns keeps its previous form as non editable cell.
    >
    > how can I achieve this?


    Set AutoGenerateColumns=False, and then add each column as a BoundColumn.
    For the non-editable columns, set ReadOnly=True:

    <asp:DataGrid ....>
    <Columns>
    <BoundColumn DataTextField="myField1" />
    <BoundColumn DataTextField="myField2" ReadOnly="True" />
    <BoundColumn DataTextField="myField3" ReadOnly="True" />
    <BoundColumn DataTextField="myField4" ReadOnly="True" />
    <BoundColumn DataTextField="myField5" ReadOnly="True" />
    </Columns>
    </asp:DataGrid>

    Use the datagrid's Property Builder to set other properties.

    --

    Riki
    Riki, Feb 6, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QmFza2FyYW4uSy5S?=

    Disable editing a particaular column in a datagrid

    =?Utf-8?B?QmFza2FyYW4uSy5S?=, Sep 18, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    5,197
    Jonathan Allen
    Sep 25, 2004
  2. Joseph Yang
    Replies:
    1
    Views:
    522
    S. Justin Gengo
    Aug 9, 2003
  3. Mark Perona
    Replies:
    2
    Views:
    387
    Duray AKAR
    Aug 12, 2003
  4. Replies:
    0
    Views:
    586
  5. uk00121

    Editing a datagrid nested within another datagrid

    uk00121, Apr 14, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    147
    uk00121
    Apr 19, 2004
Loading...

Share This Page