Skip to content

Need help to built XML

Sharul Nizam Ab Rahim

Asked Jun 13, 2010, 3:56 AM EDT1 answer
Share
LinkedInX
So far i've as follow in my GridView
Java
 string currentidx = null;            
            //Enumerate the GridViewRows
            for (int index = 0; index <= gv.Rows.Count - 1; index++)
            {
                //Programmatically access the CheckBox from the TemplateField
                CheckBox cb = (CheckBox)gv.Rows[index].FindControl("RowLevelCheckBox");
Code
                //If it's checked, read it...
                if (cb.Checked)
                {
                    currentidx = gv.DataKeys[index].Value.ToString();
                    lblMsg.Text += string.Concat("<li>", currentidx, "</li>");
                }
            }
Code
            lblMsg.Text += "</ul>";

So my result shown
  • 1
  • 2

how to adjust my code above, the my output will get it as follow
HTML / XML
 

<data>
<ud><idx>1</idx></ud>
<ud><idx>2</idx></ud>
</data>

 
Really need help

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.