开发者

how to enable the RadioButtonList while retriving from database

开发者 https://www.devze.com 2023-03-03 23:00 出处:网络
I am using a RadioButtonList,Active and InActive are list items. I didt specify any values to the list items and i am using this code for inserting the value to the database, every time its taking the

I am using a RadioButtonList,Active and InActive are list items. I didt specify any values to the list items and i am using this code for inserting the value to the database, every time its taking the true value only..

staffMaster.IsActive = ui_rblIsActive.Enabled == true ? true : false;

staffMaster is a VO object which i created in the WCF layer..

while retriving from database i ve tried this code specified below, for enabling radio button, but its not showing as enabled.. table has only true values..

ui_rblIsActive.Enabled =Convert.ToBoolean(ui_gridView.Selected开发者_Python百科Row.Cells[13].Text);

What mistake i have done here???? what i ve to do, to insert & retrive data properly..?


ui_rblIsActive.Enabled is just telling you whether the control is enabled, not what if anything is selected. You want to use ui_rblIsActive.SelectedValue instead. If you did not privde any value you will get the text of the radio button label.


Can you give more information, with the info you provided, I guess you should use rbl's SelectedItem.(Text|Value) property

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.radiobuttonlist.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消