DataGrid Editing!

G

Guest

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?
 
R

Riki

Raed said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top