2010-11-01 107 views

回答

0
void SetPrimaryContactID() 
{ 
    if (grvCustomerContact.Rows.Count > 0) 
    { 
     foreach (GridViewRow gr in grvCustomerContact.Rows) 
     { 
      Label l = (Label)gr.FindControl("lblContacts_ID"); 
      bool s = hd_PrimaryContact.Value.Equals(l.Text); 
      if (hd_PrimaryContact.Value.Equals(l.Text)) 
      { 
       Literal output = (Literal)gr.FindControl("RadioButtonMarkup"); 
       output.Text = string.Format(@"<input type='radio' name='PrimaryConactGroup'" + @"id='RowSelector{0}' value='{0}' checked='checked' />", gr.RowIndex); 
      } 
     } 

    } 
} 
+0

不要忘記接受你自己的答案是正確的(使用左側的綠色勾號) – abatishchev 2010-11-01 10:42:39