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.

How can I on server side clear all check boxes.

Thread ID:

Created:

Updated:

Platform:

Replies:

67292 Aug 13,2007 09:37 AM Aug 21,2007 07:04 AM ASP.NET Web Forms (Classic) 1
loading
Tags: GridGroupingControl
Vladymyr
Asked On August 13, 2007 09:37 AM

How can I on server side clear all check boxes.
In check box template column which was created with the help of .


Melba Winshia [Syncfusion]
Replied On August 21, 2007 07:04 AM

Hi,

I apologize for the delay in responding.

If your intention is to clear all check boxes in server side, it can be achieved by using the OnCheckedChanged event.

[C#]

protected void cbRowBtnTemplate_CheckedChanged(object sender, System.EventArgs e)
{
CheckBox checkbox = (CheckBox)sender;
GridRow gridrow = (GridRow)checkbox.Parent.Parent;
string identifyHeader = gridrow.DisplayElement.Info;
int indexOfHeader = identifyHeader.IndexOf(")") - identifyHeader.IndexOf("(") + 1;
string rowType = identifyHeader.Substring(identifyHeader.IndexOf("("), indexOfHeader);
if (rowType != "(GridColumnHeaderSection)")
{
string categoryName = gridrow.Record.GetValue("CategoryName").ToString();
if (checkbox != null)
{
if (checkbox.Checked == true)
{
lstSelectedProducts.Items.Add(categoryName);

}
else
{
lstSelectedProducts.Items.Remove(categoryName);
}
}
}
else
{
if (checkbox.Checked == false)
ClearListBox();
}

}


Please refer the sample in the below link which illustrates the above.

http://websamples.syncfusion.com/samples/Grouping.Web/5.1.1.0/66962_1/main.htm

In the above sample if you check the checkbox in header CategoryID all check boxes will be checked and if you clear the checkbox in the header, then all check boxes will be unchecked. If I have misunderstood your requirement, could you please explain me in detail, so that I can work in depth and try to send a better solution?

Thanks,
Melba

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.

;