datagrid with checkboxes
-
i have a datagrid ..in that two columns are there ....seats.and checkboxes i am getting the seats value from the database... my problem is if the seats value is more tha 0 ..then only the checkbox should be visible... if the value is lessthan or equal to 0 ..then the checkbox should be invisible how can i do this in asp.net
-
i have a datagrid ..in that two columns are there ....seats.and checkboxes i am getting the seats value from the database... my problem is if the seats value is more tha 0 ..then only the checkbox should be visible... if the value is lessthan or equal to 0 ..then the checkbox should be invisible how can i do this in asp.net
By setting the visible property on both controls, and putting them in one column, which is also dynamically named.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
i have a datagrid ..in that two columns are there ....seats.and checkboxes i am getting the seats value from the database... my problem is if the seats value is more tha 0 ..then only the checkbox should be visible... if the value is lessthan or equal to 0 ..then the checkbox should be invisible how can i do this in asp.net
Use the GridView.RowDataBound Event and for each new generated row check the seats value (e.Rows.Cells[0].Text) and change the checkbox visibility accordingly. e.Rows.Cells[1].FindControl(checkbox)....