or
private void uiTSSearchTitleScan_Click(object sender, EventArgs e){ DAOLoginService.DAOLoginService LoginServices = new DAOLoginService.DAOLoginService(); DAODataService.DAODataService DataServices = new DAODataService.DAODataService(); try { // create the objects needed for the process XmlDocument Document = new XmlDocument(); XmlNode Result = null; XmlDocument doc = new XmlDocument(); XslCompiledTransform xslt = new XslCompiledTransform(); DataSet xmlDataSet = new DataSet(); //Set Variable Values string UserCompany = "xxxx"; string UserName = "xxxxx"; string UserPassword = "xxxx"; string sLotBlkUnit = "xxx"; Result = Document.DocumentElement; Token = LoginServices.Login(UserCompany, UserName, UserPassword); Result = DataServices.GetSubdivisionList(Token, this.uiCboCounty.SelectedValue.ToString(), this.uiTxtSearchFor.Text, "P", sLotBlkUnit, "", "", "", "", "", ""); XmlNode ResultNodes = Document.ImportNode(Result, true); Document.AppendChild(ResultNodes); //============================================= // save the original data response from titlescan to xml //============================================= Document.Save("_GetSubdivisionList.xml"); //============================================= // need to reformat the xml file to friendly tags so // we do it here //============================================= doc.Load(@"_GetSubdivisionList.xml"); xslt.Load("GetSubdivisionLotList.xsl"); xslt.Transform("_GetSubdivisionList.xml", "GetSubdivisionList.xml"); xmlDataSet.ReadXml("GetSubdivisionList.xml"); //============================================= //clear grid from last lookup if applicable //============================================= this.uiGrdSearchResults.MasterTemplate.Templates.Clear(); this.uiGrdSearchResults.Relations.Clear(); //============================================= // setup the grid and load using the xml data provided //============================================= GridViewTemplate LotTemplate1 = new GridViewTemplate(); this.uiGrdSearchResults.MasterTemplate.Templates.Add(LotTemplate1); GridViewRelation relation = new GridViewRelation(this.uiGrdSearchResults.MasterTemplate); relation.ChildTemplate = LotTemplate1; relation.RelationName = "Subdivisions_LotBlockUnits"; relation.ParentColumnNames.Add("Subdivision_Id"); relation.ChildColumnNames.Add("LotBlockUnits_Id"); uiGrdSearchResults.Relations.Add(relation); if (xmlDataSet.Tables.Count == 0) { MessageBox.Show("No records found that match the criteria entered.","No Records!",MessageBoxButtons.OK,MessageBoxIcon.Exclamation); } else { this.uiGrdSearchResults.DataSource = xmlDataSet.Tables[0]; LotTemplate1.DataSource = xmlDataSet.Tables[2]; this.uiGrdSearchResults.MasterTemplate.BestFitColumns(); this.uiGrdSearchResults.MasterTemplate.Templates[0].BestFitColumns(); } } catch (Exception ex) { if (Convert.ToString(Token) == "00000000-0000-0000-0000-000000000000") { MessageBox.Show("Login Failed. Token returned was \n" + Token); } else { MessageBox.Show(ex.Message); } } finally { if (Convert.ToString(Token) != "00000000-0000-0000-0000-000000000000") { LoginServices.Logout(Token); } }} <?xml version="1.0" encoding="utf-8" ?> - <Subdivisions>- <Subdivision> <CountyCode>M</CountyCode> <Name>CHERRYWOOD VILLAGE CONDO 89-203 POST W/BLKS</Name> <Number>CHERRY100</Number> <DefinitionFlag>Y</DefinitionFlag> <UnitFlag>N</UnitFlag> <Comments>UNIT IS LT, BLDG IS BLK EXAMPLE:UNIT 101 BLDG 9500 IS LT 101 BLK 9500 UNIT 9502 BLDG 100 IS LT 950+++</Comments> - <LotBlockUnits>- <LotBlockUnit> <SubdivisionNumber>CHERRY100</SubdivisionNumber> <OpenFlag>Y</OpenFlag> <Block>100</Block> <StartLot>9502</StartLot> <EndLot /> <StartUnit /> <EndUnit /> <StartDate /> <EndDate /> <UnitComments /> </LotBlockUnit>- <LotBlockUnit> <SubdivisionNumber>CHERRY100</SubdivisionNumber> <OpenFlag>Y</OpenFlag> <Block>100</Block> <StartLot>9504</StartLot> <EndLot /> <StartUnit /> <EndUnit /> <StartDate /> <EndDate /> <UnitComments /> </LotBlockUnit>- <LotBlockUnit> <SubdivisionNumber>CHERRY100</SubdivisionNumber> <OpenFlag>Y</OpenFlag> <Block>100</Block> <StartLot>9506</StartLot> <EndLot /> <StartUnit /> <EndUnit /> <StartDate /> <EndDate /> <UnitComments /> </LotBlockUnit>- <LotBlockUnit> <SubdivisionNumber>CHERRY100</SubdivisionNumber> <OpenFlag>Y</OpenFlag> <Block>100</Block> <StartLot>9508</StartLot> <EndLot /> <StartUnit /> <EndUnit /> <StartDate /> <EndDate /> <UnitComments /> </LotBlockUnit>- <LotBlockUnit> <SubdivisionNumber>CHERRY100</SubdivisionNumber> <OpenFlag>Y</OpenFlag> <Block>100</Block> <StartLot>9510</StartLot> <EndLot /> <StartUnit /> <EndUnit /> <StartDate /> <EndDate /> <UnitComments /> </LotBlockUnit>- <LotBlockUnit> <SubdivisionNumber>CHERRY100</SubdivisionNumber> <OpenFlag>Y</OpenFlag> <Block>100</Block> <StartLot>9512</StartLot> <EndLot /> <StartUnit /> <EndUnit /> <StartDate /> <EndDate /> <UnitComments /> </LotBlockUnit>-</LotBlockUnits> </Subdivision> </Subdivisions>RadButtonElement radB = new RadButtonElement();radB.MaxSize = new Size(15, 15);radB.Click += new EventHandler(control.CloseTabButtonClicked);radB.Font = new System.Drawing.Font("Verdana", 7, FontStyle.Regular, GraphicsUnit.Point, ((Byte)0));radB.Text = "X";radB.TextElement.Location = new Point(1, 0);radB.Margin = new Padding(0);radB.TextAlignment = ContentAlignment.TopLeft;radB.Alignment = ContentAlignment.MiddleRight;tabItem.Children[2].Margin = new Padding(0, 0, 20, 0);tabItem.Children.Add(radB));