M
martin
Hi,
I am iterating through the dataitems in a datagrid and producing and xml
document,
If a particular cell in the datagrid has a textbox control or a datagrid
control in it then I have no problem retrieveing it value by casting with
CTYPE
however when the datagrid cell contains no control, but does contain text,
then I am having great trouble accessing its value.
can anybody please help me out.
I have provided the code I am stuc on below.
cheers
martin.
Dim di As DataGridItem
For Each di In dgOtherMemberships.Items
counter = counter + 1
If di.ItemType = ListItemType.AlternatingItem Or di.ItemType =
ListItemType.Item Then
elem = doc.CreateElement("Item")
elem.SetAttribute("PKID", --WHAT GOES HERE TO RETRIEVE THE
TEXT OF A DATGRID CELL) <----------Having trouble with this cast...???
elem.SetAttribute("membership",
CType(di.FindControl("Member"), CheckBox).Checked)
elem.SetAttribute("Accredited",
CType(di.FindControl("Accredited"), CheckBox).Checked)
elem.SetAttribute("membershipCode",
CType(di.FindControl("MembershipCode"), TextBox).Text)
rootElem.AppendChild(elem)
End If
Next
I am iterating through the dataitems in a datagrid and producing and xml
document,
If a particular cell in the datagrid has a textbox control or a datagrid
control in it then I have no problem retrieveing it value by casting with
CTYPE
however when the datagrid cell contains no control, but does contain text,
then I am having great trouble accessing its value.
can anybody please help me out.
I have provided the code I am stuc on below.
cheers
martin.
Dim di As DataGridItem
For Each di In dgOtherMemberships.Items
counter = counter + 1
If di.ItemType = ListItemType.AlternatingItem Or di.ItemType =
ListItemType.Item Then
elem = doc.CreateElement("Item")
elem.SetAttribute("PKID", --WHAT GOES HERE TO RETRIEVE THE
TEXT OF A DATGRID CELL) <----------Having trouble with this cast...???
elem.SetAttribute("membership",
CType(di.FindControl("Member"), CheckBox).Checked)
elem.SetAttribute("Accredited",
CType(di.FindControl("Accredited"), CheckBox).Checked)
elem.SetAttribute("membershipCode",
CType(di.FindControl("MembershipCode"), TextBox).Text)
rootElem.AppendChild(elem)
End If
Next