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

How to show particular row in edit mode

8 Answers 224 Views
GridView
This is a migrated thread and some comments may be shown as answers.
varsha Motwani
Top achievements
Rank 1
varsha Motwani asked on 07 Jun 2010, 10:39 AM
Hi,
Can you please let me know how to show particular row inside grid in edit mode Dynamically from code.
If I do radgridview.BeginEdit(),it is not specific to any row.

8 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 07 Jun 2010, 01:06 PM
Hello varsha Motwani,

Please give us more specifics about your scenario and mainly the purpose of setting a whole row in edit-mode as for the time being only one cell can be in this mode. 
You can find detailed information about editing in RadGridView in our online documentation.
 

Best wishes,
Maya
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
varsha Motwani
Top achievements
Rank 1
answered on 07 Jun 2010, 02:30 PM
Hi,
Thanks for you reply.
I would like to know how can I set specific cell of specific row in edit mode.
I have grid which contains 10 rows.
I wish to set 5th row 1st column in eidt mode .
Something like answered in earlier post
http://www.telerik.com/community/forums/silverlight/gridview/putting-a-cell-into-edit-mode-in-code-behind.aspx
But i think now that solution does not work
0
varsha Motwani
Top achievements
Rank 1
answered on 08 Jun 2010, 08:51 AM
Hi,
Can you please update on the above ASAP
0
Maya
Telerik team
answered on 08 Jun 2010, 02:03 PM
Hello varsha Motwani,

Please use as a reference this forum thread where you can download a sample project. However, instead of setting the selected cell to current, you can set it in edit-mode (in the method SetCurrentCell(GridViewCell cell):

cell.IsInEditMode = true;
 

All the best,
Maya
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
varsha Motwani
Top achievements
Rank 1
answered on 10 Jun 2010, 05:20 AM
Hi,
Thanks for reply.
I again hav confusion as I wish to set some cell in edit mode but here we searching that cell by text value.
Same value can exits in other cells too.
0
Maya
Telerik team
answered on 10 Jun 2010, 11:59 AM
Hello varsha Motwani,

Please take another look at the same forum thread and you will find examples for both setting focus on cell by its value as well by its indices. The second one that uses indices of the columns and rows is the project you may use as a reference.
I hope that helps.

Kind regards,
Maya
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
v-govinr@microsoft.com
Top achievements
Rank 1
answered on 14 Jun 2010, 08:22 AM
Hi,
I Checked that thread,but my scenario is different.
1.)I m using dynamic datable to populate the data in grid
2.)I m adding the row on click of button as shown below

 

 

 

private void btnAdd_Click(object sender, RoutedEventArgs e)

 

{

 

 

 

 

#region

 

 

declaration

 

 

 

DataRow newItem;

 

 

 

 

 

#endregion

 

 

 

 

 

 

 

if (cmbnoOfrows.SelectedIndex != 0 && cmbnoOfrows.Text.ToString() != string.Empty)

 

{

 

 

for (int count = 0; count < int.Parse(cmbnoOfrows.Text.ToString()); count++)

 

{

newItem = engs.NewRow();

newItem[

 

"A"] = row;

 

newItem[

 

"B"] = cmbBusinessOrganization.SelectedValue.ToString();

 

newItem[

 

"C"] = cmbMGOOrganization.SelectedValue.ToString();

 

newItem[

 

"D"] = cmbBusinessSegment.SelectedValue.ToString();

 

newItem[

 

"E"] = cmbFiscalYr.SelectedValue.ToString();

 

 

row = row - 1;

engs.Rows.Add(newItem);

 

}

}

 

 

else

 

 

 

 

 

 

{

newItem = engs.NewRow();

;

newItem[

 

"A"] = row;

 

newItem[

 

"B"] = cmbBusinessOrganization.SelectedValue.ToString();

 

newItem[

 

"C"] = cmbMGOOrganization.SelectedValue.ToString();

 

newItem[

 

"D"] = cmbBusinessSegment.SelectedValue.ToString();

 

newItem[

 

"E"] = cmbFiscalYr.SelectedValue.ToString();

 

row = row - 1;

engs.Rows.Add(newItem);

 

}

 

 

if (engs.Rows.Count < 25)

 

{

radDataPager.Visibility =

 

Visibility.Collapsed;

 

}

 

 

else

 

 

 

 

 

 

{

radDataPager.Visibility =

 

Visibility.Visible;

 

}

dgEng.Rebind();

}

 

 

Now I wish to show the newly created rows selected.
I tried adding grid Layout updated event when i am writing above code, but that dint work out.

Please advice

0
Maya
Telerik team
answered on 15 Jun 2010, 08:44 AM
Hello,

 
What you can do in this case is to use the event of the grid Items_CollectionChanged and to define it in the following way:

void Items_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
        {
            if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add)
            {
                this.RadGridView1.SelectedItems.Add(e.NewItems[0]);
            }
        }

I am sending you a sample project with the proposed solution. Furthermore, you may find additional information in this blog post.


Regards,
Maya
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
varsha Motwani
Top achievements
Rank 1
Answers by
Maya
Telerik team
varsha Motwani
Top achievements
Rank 1
v-govinr@microsoft.com
Top achievements
Rank 1
Share this question
or