|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Problem editing checkbox template columnHi all, i am having a problem with re-assigning the original value in the
checkbox when the datagrid is in edit mode. I have tried finding the control using findcontrol method in the edit event but can't. I try to find the control in the update event and i can do it. But, i need to set the original value in the check box as soon as the user clicks on the edit button. Thanks Hi Houston,
I think you don't have to do this in edit event. You can do it either in HTML code or in ItemDataBound event. In HTML code: <asp:CheckBox ID="ckID" Runat=server Checked='<%# convert.tostring(DataBinder.eval (Container.DataItem,"FieldName"))=="True" ? true : false) % >'></asp:CheckBox> Or in ItemDataBound eventListItemType itemType = e.Item.ItemType; if (itemType != ListItemType.Header && itemType != ListItemType.Pager && itemType != ListItemType.Footer && itemType != ListItemType.Seperator){ DataRowView drv = (DataRowView)e.Item.DataItem; bool bData = (bool)drv[colIndex]; CheckBox ckBox = (CheckBox)e.Item.FindControl("ckID"); ckBox.Checked = bData; } HTH Elton Wang elton_w***@hotmail.com >-----Original Message----- original value in the >Hi all, i am having a problem with re-assigning the >checkbox when the datagrid is in edit mode. I have tried finding the control >using findcontrol method in the edit event but can't. I try to find the >control in the update event and i can do it. But, i need to set the original Show quoteHide quote >value in the check box as soon as the user clicks on the edit button. > >Thanks >. >
Default Paging
Dynamically created control in Datagrid problem Background of datagrid Inserting Text before the Numberic Page numbers in paging Changing paging look TemplateColumn with CheckBox DataBind in C# recursive relation in datagrid Paging Problem GUI of Datagrid To stop text wraping in an datagrid asp.net 2003 |
|||||||||||||||||||||||