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

How to merge CheckBoxHeaderCell and CustomGroupHeaderCell together?

5 Answers 168 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Stanley
Top achievements
Rank 1
Stanley asked on 28 May 2012, 11:28 AM
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;
                    }
                }
            }
        }

5 Answers, 1 is accepted

Sort by
0
Svett
Telerik team
answered on 31 May 2012, 01:18 PM
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 >>
0
Stanley
Top achievements
Rank 1
answered on 31 May 2012, 02:15 PM
Hi Telerik Support,

Thank you, could you help me make it perfect?
Please refer the picture from attachment.
Thanks a million.
0
Svett
Telerik team
answered on 01 Jun 2012, 03:58 PM
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 >>
0
Stanley
Top achievements
Rank 1
answered on 02 Jun 2012, 04:10 AM
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 

0
Accepted
Svett
Telerik team
answered on 05 Jun 2012, 10:06 AM
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 >>
Tags
GridView
Asked by
Stanley
Top achievements
Rank 1
Answers by
Svett
Telerik team
Stanley
Top achievements
Rank 1
Share this question
or