2010-11-01 73 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