RadGrid.Rows.Clear() doesn't work

12 posts, 0 answers
  1. andi
    andi avatar
    34 posts
    Member since:
    Jan 2008

    Posted 28 Jan 2008 Link to this post

    RadGrid.Rows.Clear() doesn't work!? is there a bug?

    thanks, andreas
  2. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 29 Jan 2008 Link to this post

    Hi Andreas,

    Thank you for reporting this issue.

    We managed to reproduce this issue on our side and we will address it in our upcoming Q1 2008 release.

    Please, excuse us for the inconvenience. We have updated your Telerik points.

    Don't hesitate to contact us if you have other questions.

    Kind regards,
    Jack
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Mike
    Mike avatar
    76 posts
    Member since:
    Nov 2004

    Posted 05 Mar 2008 Link to this post

    Hi Telerik,

    Do you guys have a work around for this issue?

    When I try to use the following code the column widths get all messed up.

     private void BuildGridColumns()  
            {  
                grdrResults.MasterGridViewTemplate.AutoGenerateColumns = false;  
                grdrResults.MasterGridViewTemplate.AllowAutoSizeColumns = true;  
                grdrResults.MasterGridViewTemplate.Columns.Add(new GridViewTextBoxColumn("DocID"));  
                grdrResults.MasterGridViewTemplate.Columns.Add(new GridViewTextBoxColumn("DocName"));  
                grdrResults.MasterGridViewTemplate.Columns.Add(new GridViewTextBoxColumn("DocTypeName"));  
                grdrResults.MasterGridViewTemplate.Columns.Add(new GridViewTextBoxColumn("DocCatName"));  
                grdrResults.MasterGridViewTemplate.Columns.Add(new GridViewTextBoxColumn("DocStatusName"));  
            }  
     
            private void BindData(string strCatName, int intStateID)  
            {  
                grdrResults.MasterGridViewTemplate.Columns.Clear();  
                BuildGridColumns();  
                grdrResults.DataSource = AppDocument.SearchDocuments("ReturnAll", 0, 0, "", 0, strCatName, 0, "Released", "", 0, intStateID, 0, false);  
            } 

    Regards,
    Mike
  5. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 06 Mar 2008 Link to this post

    Hello mike,

    Thank you for reporting this issue.

    We managed to reproduce it. It will be addressed in our upcoming release Q1 2008. To work around this issue, place a call to the BeginUpdate method before clearing the columns and a call to the EndUpdate method after binding the grid. Refer to the code snippet below:

    private void BindData(string strCatName, int intStateID) 
        grdrResults.GridElement.BeginUpdate(); 
        grdrResults.MasterGridViewTemplate.Columns.Clear(); 
        BuildGridColumns(); 
        grdrResults.DataSource = AppDocument.SearchDocuments("ReturnAll", 0, 0, "", 0, strCatName, 0, "Released""", 0, intStateID, 0, false); 
        grdrResults.GridElement.EndUpdate(); 
    }  
     

    I hope this helps. Let me know, if you need further assistance.

    Sincerely yours,
    Jack
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. Jose Maria Andrew Sison
    Jose Maria Andrew Sison avatar
    2 posts
    Member since:
    Jan 2010

    Posted 29 Oct 2010 Link to this post

    :: workaround ^_^

    set your radgridview datasource = nothing.

    RadGridView.DataSource = Nothing

    hope this helps!


  7. Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 29 Oct 2010 Link to this post

    Hello,

    To clear selection in the current version you can use:
    VB:
    Me.RadGridView1.ClearSelection()
    Me.RadGridView1.CurrentRow = Nothing
    'usually this is enough but if you still have something selected you should uncomment the following line
    'Me.RadGridView1.CurrentCell.IsSelected = False

    C#:
    this.radGridView1.ClearSelection();
    this.radGridView1.CurrentRow = null;
    //usually this is enough but if you still have something selected you should uncomment the following line
    this.radGridView1.CurrentCell.IsSelected = false;

    Hope this helps, if you have any other questions or comments, please let me know,

    Best Regards,
    Emanuel Varga
  8. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 02 Nov 2010 Link to this post

    Hi Jose,

    Regarding the Rows.Clear method, it works only when using a data source that supports it or when RadGridView is used in unbound mode.

    Regarding the layout issue, I tested the case using our latest release and it works well. Please contact us if you experience issues. We will be glad to help.

    Should you have any other questions, do not hesitate to write us.

    Greetings, Jack
    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. Jorge
    Jorge avatar
    4 posts
    Member since:
    Feb 2011

    Posted 14 Mar 2011 Link to this post

    Good morning!

    My version of the telerik is RadControls for ASP.NET Ajax 2010 Q3.

    I'm trying to remove columns that are inserted with the command gridProntuarios.MasterTableView.Columns.Add() of grid through the command "gridProntuarios.MasterTableView.Columns.Clear();" and
    "gridProntuarios.Columns.Clear();" but don't work.

    What would the solution for this trouble?

    Thanks!
  10. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 14 Mar 2011 Link to this post

    Hello,

    You have posted your question in the WinForms forums. To gain a quicker, more accurate response, please re-direct your question to the asp.net ajax forums where I'm sure you will find the help that you need. May I also request that you only post your questions once as posting multiple questions that are the same may further slow down response times.

    Regards,
    Richard
  11. Sivaprakas Subramanian
    Sivaprakas Subramanian avatar
    15 posts
    Member since:
    Nov 2009

    Posted 09 Apr 2011 Link to this post

    hi andi try this

    RadGrid1.GroupDescriptors.Clear()

    RadGrid1.Rows.Clear()

    Its work for me

  12. kia
    kia avatar
    17 posts
    Member since:
    Oct 2010

    Posted 16 May 2011 Link to this post

    Hi
    Your soluion have 2 step:
    1: set EnableViewState="false" in your aspx file.
    2: gridView.DataSource = null;
        gridView.DataBind();


    Hope this help
  13. Abdulrahman Khalil
    Abdulrahman Khalil avatar
    1 posts
    Member since:
    Apr 2010

    Posted 24 May 2011 Link to this post

    Hi Sivaprakas Subramanian,

    Thanks for your help,
    its also working with me,

    Great job Sivaprakas Subramanian.


    Abdulrahman
Back to Top
UI for WinForms is Visual Studio 2017 Ready