How to show particular row in edit mode

9 posts, 0 answers
  1. varsha Motwani
    varsha Motwani avatar
    23 posts
    Member since:
    Apr 2010

    Posted 07 Jun 2010 Link to this post

    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.
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 07 Jun 2010 Link to this post

    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.
  3. DevCraft banner
  4. varsha Motwani
    varsha Motwani avatar
    23 posts
    Member since:
    Apr 2010

    Posted 07 Jun 2010 Link to this post

    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
  5. varsha Motwani
    varsha Motwani avatar
    23 posts
    Member since:
    Apr 2010

    Posted 08 Jun 2010 Link to this post

    Hi,
    Can you please update on the above ASAP
  6. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 08 Jun 2010 Link to this post

    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.
  7. varsha Motwani
    varsha Motwani avatar
    23 posts
    Member since:
    Apr 2010

    Posted 10 Jun 2010 Link to this post

    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.
  8. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 10 Jun 2010 Link to this post

    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.
  9. v-govinr@microsoft.com
    v-govinr@microsoft.com avatar
    18 posts
    Member since:
    Jun 2010

    Posted 14 Jun 2010 Link to this post

    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

  10. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 15 Jun 2010 Link to this post

    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.
Back to Top
DevCraft banner