We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Grouping & CheckBox Control

Thread ID:

Created:

Updated:

Platform:

Replies:

101841 Nov 25,2011 04:23 AM Dec 5,2011 02:42 AM ASP.NET Web Forms (Classic) 1
loading
Tags: Grouping
Dadasaheb Chobhe
Asked On November 25, 2011 04:23 AM

I am add checkbox to the GrdiGroup Control. I want to change the state of checkbox in grouping. If Group contains 4 record, if i checked 4 records then it should be check group header checkbox and vice versa.

Thank you
Dadasaheb Chobhe


Ragamathulla B [Syncfusion]
Replied On December 5, 2011 02:42 AM

Hi Dadasaheb,

Thank you for your interest in Syncfusio products.

You can change the checkbox status based on the parent table selection by using ‘TableControlCurrentCellChanging’ event. The following code explains the same.

void gridGroupingControl1_TableControlCurrentCellChanging(object sender, GridTableControlCancelEventArgs e)
{
GridCurrentCell cc = this.gridGroupingControl1.TableControl.CurrentCell;
GridStyleInfo style = cc.Renderer.CurrentStyle;

if (cc.Renderer is GridCheckBoxCellRenderer)
{
CultureInfo culture = style.GetCulture(true);
// Load representations for True / False.
string strTrue = "", strFalse = "";
GridCheckBoxCellInfo ua = style.ReadOnlyCheckBoxOptions;
if (ua != null && ua.CheckedValue != null)
strTrue = ua.CheckedValue;
if (GridUtil.IsEmpty(strTrue))
strTrue = "1";
if (ua != null && ua.UncheckedValue != null)
strFalse = ua.UncheckedValue;
if (GridUtil.IsEmpty(strFalse))
strFalse = "0";
// Switch to next value
string strVal = style.Text;
// Checked to unchecked.
if (strVal.ToLower(culture) == strTrue.ToLower(culture))
strVal = strFalse;
// Unchecked to checked.
else
strVal = strTrue;
// Store value.
this.gridGroupingControl1.TableModel[cc.RowIndex, cc.ColIndex].Text = strVal;
this.gridGroupingControl1.Table.Records[0].NestedTables[0].Records[0].SetValue("Status", strVal);
}
}

Please refer to the following sample which illustrates the same.

http://www.syncfusion.com/downloads/Support/DirectTrac/85957/GGCCheckbox-421602947.zip

Please let me know if you have any further concerns.

Regards,
Ragamathullah B.



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;