Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Actually i want to bind the data to check box but i want to hide the data of the checkbox. i want to display only checkbox not the label of the checkbox is it possible...
Posted
Comments
I have already answered you and have given you one demo how to do it in your previous question.
You just need to implement it at correct place and inside correct event.

Is there any problem ?
ntitish 4-Jun-13 5:53am    
yes sir...it is not working
can i ask u one thing..
i am binding data to checkbox now i dont want to display the text of the checkbox...then for that we can write one javascript function na sir not to display the text of the checkbox and we can call that function in checkbox na sir...instead of finding the id of the checbox and hiding the text...bec u give me the code for hiding the checkbox by finding the id but again i have to write the javascript for finding the control in radcombobox....so can u do code for hiding the text of checkbox by calling the javascript function
Yes, while binding, you can make the DataTextField to blank ("").
ntitish 4-Jun-13 6:37am    
sir i am binding the data to checkbox like below

<asp:CheckBox ID="chk" runat="server" style="font-size:1px" ForeColor="Transparent" Text='<%# Eval("FullName") %>'/>
ntitish 4-Jun-13 6:43am    
sir other wise can u write java script for this condition below

i am having itemtemplate in radcombobox. in that item template i am taking three controls checkbox and image and linkbutton. now what i want is if i check the checkbox i want to get the name of the linkbutton and should show in radcombobox.

1 solution

You can use a hidden field to bind..

write it below ur checkbox code.. this way..

C#
<asp:checkbox id="chkbox1" runat="server" xmlns:asp="#unknown" />
<asp:hiddenfield id="HiddenB1" runat="server" xmlns:asp="#unknown" />



Write this in RowDataBound .cs

C#
SAMPLEClass entity = (SAMPLEClass)e.Row.DataItem;
HiddenField Hidden1 = (HiddenField)e.Row.FindControl("Hidden1");
Hidden1.Value = entity.somecolumnvaluetobind.ToString();
 
Share this answer
 
v2
Comments
ntitish 4-Jun-13 7:33am    
Sir i am binding the data to checkbox like below

<asp:CheckBox ID="chk" runat="server" style="font-size:1px" ForeColor="Transparent" Text='<%# Eval("FullName") %>'/>
ntitish 4-Jun-13 7:40am    
what is this SAMPLEClass
ntitish 4-Jun-13 7:43am    
Sir i am not getting clearly can u explain clearly....
Sanman Marathe 4-Jun-13 9:01am    
hey...
use this simple code..

<asp:HiddenField ID="hdn" runat="server" Value='<%# Eval("FullName")%>' /> <asp:CheckBox ID="chk" runat="server"/>

And in ur code behind use hdn.value wherever u need to use the checkbox value...
ntitish 4-Jun-13 9:40am    
but sir i am using the checkbox text value in javascript to show in radcombobox after checking the checkbox in itemtemplate which is in radcombobox

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900