mudzakkir

How To Bind Combo Box

Mar 24th, 2015
355
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.90 KB | None | 0 0
  1. private void BindMainAgentInput()
  2.         {
  3.             ddlMainAgentInput.Items.Clear();
  4.  
  5.             m_oMainAgentCollectionInput.Clear();
  6.  
  7.             m_oMainAgentCollectionInput.ListMainAgent();
  8.             m_oMainAgentCollectionInput.Sort(SellingAgentCollection.SellingAgentFields.AgentName, true);
  9.  
  10.             SellingAgent oSellingAgentDefault = new SellingAgent(-1);
  11.             oSellingAgentDefault.AgentCode2AndNameForDDL = RCMS.BusinessLogicLayer.Constanta.Common.const_sSelectOne;
  12.             m_oMainAgentCollectionInput.Insert(0, oSellingAgentDefault);
  13.  
  14.             ddlMainAgentInput.DisplayMember = "AgentCode2AndNameForDDL";
  15.             ddlMainAgentInput.ValueMember = "SellingAgentId";
  16.             ddlMainAgentInput.DataSource = m_oMainAgentCollectionInput;
  17.             ddlMainAgentInput.Rebind();
  18.             ddlMainAgentInput.SelectedValue = oSellingAgentDefault.SellingAgentId;
  19.         }
Advertisement
Add Comment
Please, Sign In to add comment