This is a migrated thread and some comments may be shown as answers.

WPF GridView Editing template

0 Answers 133 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Saranya
Top achievements
Rank 1
Saranya asked on 06 Jan 2011, 12:31 PM
Hi,

       i want to include an editing template in my gridview as per the attachment. Users will be able to add new row only through the editing template (last row) . Also in the template, all the fields by default should be in edit (not in display mode). Is there any way to achieve this? Currently the gridview is allowing only one cell as editable mode by default. Its not allowing the whole row to be in editable mode. The code snippet below is allowing a single cell to be in editable mode.

var rowToEdit = this.grdReferrals.ItemContainerGenerator.ContainerFromItem(this.grdReferrals.SelectedItem) as GridViewRow;
           if (rowToEdit != null)
           {
               GridViewCell currentCell = (GridViewCell)rowToEdit.Cells[0];
               if (null != currentCell)
                   currentCell.IsCurrent = true;
               rowToEdit.BeginEdit();
           }

Expecting a quick reply from you,

Regards,
Saranya.

No answers yet. Maybe you can help?

Tags
GridView
Asked by
Saranya
Top achievements
Rank 1
Share this question
or