How to merge CheckBoxHeaderCell and CustomGroupHeaderCell together?

6 posts, 1 answers
  1. Stanley
    Stanley avatar
    32 posts
    Member since:
    Apr 2012

    Posted 28 May 2012 Link to this post

    The url below is my source code. The file name is 354709_CheckedGroupHeaderCellElement.zip
    https://skydrive.live.com/redir?resid=DBDF9B2C2251D8AA!109

    I created it base on 2 article below:
    1. http://www.telerik.com/support/kb/winforms/gridview/add-check-uncheck-all-check-box-in-the-header-cell.aspx 
    2. http://www.telerik.com/community/forums/winforms/gridview/adding-checkbox-to-the-group-header.aspx 

    The problem now is:
    1. After grouping, CheckBoxHeaderCell cannot work.
    2. If I add code below in ValueChanged, CheckBoxHeaderCell is working but CustomGroupHeaderCell cannot work


    Note: If you hide all the in ValueChanged, you can see customCell_MeCheckChanged is working perfectly on CustomGroupHeaderCell.


    Please refer the video below.
    http://www.youtube.com/watch?v=fqVY0bfEgJY

    Another question:
    How to get fast response? Because I have some topic does not get reply from telerik support.
    My Unique Customer ID is: SU878455


    How to control/manage in radGridView1_ValueChanged?


    private void radGridView1_ValueChanged(object sender, EventArgs e)
            {
                if (sender.GetType().ToString() == "Telerik.WinControls.UI.GridViewCellInfo")
                {
                    //MessageBox.Show(((GridViewCellInfo)sender).ColumnInfo.FieldName);
                    if (bool.Parse(((GridViewCellInfo)sender).Value.ToString()))
                    {
                        foreach (GridViewRowInfo dr in radGridView1.Rows)
                        {
                            dr.Cells[0].Value = true;
                        }
                    }
                    else if (!bool.Parse(((GridViewCellInfo)sender).Value.ToString()))
                    {
                        foreach (GridViewRowInfo dr in radGridView1.Rows)
                        {
                            dr.Cells[0].Value = false;
                        }
                    }
                }
            }

  2. Svett
    Admin
    Svett avatar
    728 posts

    Posted 31 May 2012 Link to this post

    Hi Stanley,

    Following your project, I created a modified version of it where I have addressed all issues that you reported. It seems that both approaches can work together. Nevertheless, I polished your code and now everything works fine. The support is delayed because you are using our forums where the usual response time is 72 hours. In case you need a quick reponse, please open a new support ticket. Support tickets are reviewed according to the license that you have and in your case this time frame is 24 hours.

    Kind regards,
    Svett
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
  3. Stanley
    Stanley avatar
    32 posts
    Member since:
    Apr 2012

    Posted 31 May 2012 Link to this post

    Hi Telerik Support,

    Thank you, could you help me make it perfect?
    Please refer the picture from attachment.
    Thanks a million.
  4. Svett
    Admin
    Svett avatar
    728 posts

    Posted 01 Jun 2012 Link to this post

    Hi Stanley,

    I did not manage to reproduce the issue. When the group header is unchecked, the header cell should be also unchecked. I am enclosing a sample video demonstrating my approach. What did I miss? What is the version that you are using?

    Notice that you need web browser and installed Flash plugin to watch the video.

    Kind regards,
    Svett
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
  5. Stanley
    Stanley avatar
    32 posts
    Member since:
    Apr 2012

    Posted 01 Jun 2012 Link to this post

    Hi Telerik Support,

    You are misunderstanding my issue.
    My version is 2012.1.321.40

    Please refer my video below from YouTube.
    http://www.youtube.com/watch?v=EFUxKIVk4g8 

  6. Answer
    Svett
    Admin
    Svett avatar
    728 posts

    Posted 05 Jun 2012 Link to this post

    Hello Stanley,

    You should improve this misbehavior by handling the ValuChanged event in the following manner:

    private void radGridView1_ValueChanged(object sender, EventArgs e)
    {
        if (this.radGridView1.CurrentColumn is GridViewCheckBoxColumn &&
            object.Equals(sender, this.radGridView1.ActiveEditor))
        {
            bool value = object.Equals(this.radGridView1.ActiveEditor.Value, ToggleState.On);
            GridViewRowInfo parent = this.radGridView1.CurrentRow.Parent as GridViewRowInfo;
            parent.Tag = value;
            parent.ViewInfo.TableHeaderRow.Tag = value;
            this.radGridView1.TableElement.Update(GridUINotifyAction.DataChanged);
        }
    }

    I hope this helps.

    Regards,
    Svett
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Back to Top