fully datagrid edit

A

arnold

Hi

I have a datagrid and I want to click on a button to edit all the row of the
datagrid.
How can I edit all the datagrid jus t with a button click?

Thanks
 
J

Joel

There is two ways
1. Right Button in Datagrid, Property Builder, Colummns, Button Column and
select the Edit, Update, Button Column

2. The other way is to create a template column, and in the template put a
button and in its property commandName write Edit

Both, fire the EditCommand Event in DataGrid

write this code

Datagrid1.EditItemIndex = e.Item.ItemIndex
Datagrid1.DataSource = ds
Datagrid1.DataBind


Joel
 
A

arnold

Thanks for the answer but my problem is that I want to edit all the row at
the same time by clicking on a button.

Thanks

Arnaud
 
A

arnold

Thank you jos

But my problem is to edit all the row just by the click of one button.
I want to use a normal datagrid and click on a button in order for the
datagrid to become editable. Like that I can change the info for all the
row in one time.
And then I click another button to save everything.

Thanks a lot

Arnold
 
J

Jos

arnold said:
Thank you jos

But my problem is to edit all the row just by the click of one button.
I want to use a normal datagrid and click on a button in order for
the datagrid to become editable. Like that I can change the info for
all the row in one time.
And then I click another button to save everything.

Then just add these lines to your DataGrid:
<Columns>
<asp:EditCommandColumn ButtonType="LinkButton" UpdateText="Update"
CancelText="Cancel" EditText="Edit">
</asp:EditCommandColumn>
</Columns>

Also handle the appropriate events. This is the EditCommand event:

Sub DataGrid1_OnEditCommand(Sender As Object, e As DataGridCommandEventArgs)
DataGrid1.EditItemIndex = e.Item.ItemIndex
BindGrid()
End Sub
 

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,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top