Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 12th, 2012  |  syntax: None  |  size: 0.70 KB  |  hits: 6  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Passing vs returning a (web)control?
  2. <asp:TableCell>
  3. <telerik:RadComboBox runat="server" ID="rcbName"></telerik:RadComboBox>
  4. </asp:TableCell>
  5.        
  6. private RadComboBox rcb CreateRcbSearchResults(DataSet ds)
  7. {
  8.     RadComboBox rcb = new RadComboBox();
  9.  
  10.     foreach (DataRow row in ds.Tables[0].Rows)
  11.         rcb.Items.Add(new RadComboBoxItem(row["description"].ToString(), row["id"].ToString()));
  12.  
  13.     return rcb;
  14. }
  15.        
  16. rcbName = CreateRcbSearchResults(ds);
  17.        
  18. private void CreateRcbSearchResults(RadComboBox rcb, DataSet ds)
  19. {
  20.     foreach (DataRow row in ds.Tables[0].Rows)
  21.         rcb.Items.Add(new RadComboBoxItem(row["description"].ToString(), row["id"].ToString()));
  22. }
  23.        
  24. CreateRcbSearchResults(rcbName, ds);