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 to get Treeview checkboxes postback values ?

Thread ID:

Created:

Updated:

Platform:

Replies:

69573 Nov 2,2007 05:14 AM Nov 6,2007 08:39 AM ASP.NET Web Forms (Classic) 3
loading
Tags: Tools
dymezac
Asked On November 2, 2007 05:14 AM

Hello,


I am currently trying to get the POST values of my checkboxes treeview.

I have set the enableviewstate to false for the treview and i would like to get the checkboxes values by Request.Form.Get.

I obtain something like that :
ctl08_I3_B = on
ctl08_I2_B = on
ctl09_I3_B = on
etc..

I success with setting an ID to the treeview (for example tv) by myTreeview.ID = "tv"

and then have tv_I3_B but how can I set an ID to each checkbox of the treeview.

I would like to define myself (and programmaticely) the ID of each checkboxes.
This would let me get the posted values with Request.Form.Get

Also, if I could set the "name" attribute of all chckboxes, I could get the checkboxes post values with the coma separation, all in the same posted value instead of many ctlXX_I0_B with on values..
It seems that the Treeview tool is not able to do so is it ?

Thank you very much

dymezac
Replied On November 2, 2007 05:15 AM

>Hello,


I am currently trying to get the POST values of my checkboxes treeview.

I have set the enableviewstate to false for the treview and i would like to get the checkboxes values by Request.Form.Get.

I obtain something like that :
ctl08_I3_B = on
ctl08_I2_B = on
ctl09_I3_B = on
etc..

I success with setting an ID to the treeview (for example tv) by myTreeview.ID = "tv"

and then have tv_I3_B but how can I set an ID to each checkbox of the treeview.

I would like to define myself (and programmaticely) the ID of each checkboxes.
This would let me get the posted values with Request.Form.Get

Also, if I could set the "name" attribute of all chckboxes, I could get the checkboxes post values with the coma separation, all in the same posted value instead of many ctlXX_I0_B with on values..
It seems that the Treeview tool is not able to do so is it ?

Thank you very much


dymezac
Replied On November 2, 2007 05:16 AM


>Hello,


I am currently trying to get the POST values of my checkboxes treeview.

I have set the enableviewstate to false for the treview and i would like to get the checkboxes values by Request.Form.Get.

I obtain something like that :
ctl08_I3_B = on
ctl08_I2_B = on
ctl09_I3_B = on
etc..

I success with setting an ID to the treeview (for example tv) by myTreeview.ID = "tv"

and then have tv_I3_B but how can I set an ID to each checkbox of the treeview.

I would like to define myself (and programmaticely) the ID of each checkboxes.
This would let me get the posted values with Request.Form.Get

Also, if I could set the "name" attribute of all chckboxes, I could get the checkboxes post values with the coma separation, all in the same posted value instead of many ctlXX_I0_B with on values..
It seems that the Treeview tool is not able to do so is it ?

Thank you very much


Melba Winshia [Syncfusion]
Replied On November 6, 2007 08:39 AM

Hi,

We regret for the delayed response.

1) To get the POST values of my checkboxes treeview.

If your intention is to get Treeview checkboxes postback values, it can be achieved by using the below code snippet both on client side and server side.

Client side:
-----------

function ClientSideCheckChanged(node)
{
var status = "Unchecked";

if (node.Checked)
{
status = "Checked";

}
document.getElementById("feedbackClientSideCheck").innerHTML = status + ": '" + node.Text + "'";


}

Server Side:
-----------


protected void TreeView1_NodeCheckChanged(object sender, Syncfusion.Web.UI.WebControls.Tools.TreeViewNodeEventArgs e)
{
if (e.Node.Checked == true)
feedbacklabelServerSideCheck.Text = "Checked: '" + e.Node.Text + "'";
else
feedbacklabelServerSideCheck.Text = "UnChecked: '" + e.Node.Text + "'";
}

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

http://websamples.syncfusion.com/samples/Tools.Web/5.2.0.25/69573/main.htm


2) would like to define myself (and programmaticely) the ID of each checkboxes.

It is not possible set ID for each checkboxes. Sorry for the inconvenience caused.

Please let me know if you have any other questions.

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.

;