The text of this article is not in this database — only its details are. Read it on the old site: CheckBox in Gridview
6 Comments
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.
The text of this article is not in this database — only its details are. Read it on the old site: CheckBox in Gridview
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.
Bhabani prasad DashPosted Jun 22, 2013, 7:29 AM
my problem in chk box is i have four column like mornig shoe,even show,night show,if i chk mornig show then only morning show is save in database like night,noon plz help me
sara yeditedPosted Apr 27, 2013, 11:14 AMEdited Apr 27, 2013, 11:59 AM
hi again Syed Shakeer, I just wanted to add this here cause it solved my problem and it may help someone else too in page load: if(!Page.IsPostBack) { //gridview bind information }
sara yPosted Apr 27, 2013, 11:14 AM
hi Syed Shakeer, could you advice me with the problem I face with my code?... I tried the same method to have the same checkbox in my gridview but I can't get where I go wrong cause it seems my checkbox.checked is always false! I change my own code to this code you suggested but still I get the same result
Channa EdirisinghePosted Aug 23, 2010, 6:25 AM
Dear Hussain, Can you advise me how to add check box column using Code. I have existing code as per below which I create temparary table and then add to grid each item by codeing. Can you give any help? private void CreateGrid(){ GridHandle objTmpTab = new GridHandle(); grvItem.Columns.Clear(); grvItem.Columns.Add(objTmpTab.GridViewBoundField("SEQNO", DbType.String, "SeqNo", "Tahoma", FontSize.Small, HorizontalAlign.Left, 45));......} Relvent settings Code to add: public BoundField GridViewBoundField(string pFieldName, DbType pFieldType,string pHeaderText,string pFontName, FontSize pFontSize,HorizontalAlign pAllingment,int pWidth) {BoundField objBondField = new BoundField(); objBondField.DataField = pFieldName; //"DATAFIELDNAME" objBondField.HeaderText = pHeaderText;//HEADER NAME .....}
Syed ShakeerPosted Jul 3, 2010, 7:11 AM
Hi Chuck.snder, First Thank you. for your problem check the following link. http://forums.asp.net/p/1133301/1802924.aspx you will get your soluiton.. Thank you
chuck.snyderPosted Jul 2, 2010, 12:28 PM
Great example, now could you extend the example a little. There are many cases where the check box needs to be edited, and the data is taken from sql which only has a "Bit" value which is 0/1 for true and false. For the data to be Read/Write "Bind" must be used instead of Eval. do you have an example of using the Bind with the checkbox???