or

<telerik:RadButton ID="myRadButton" runat="server" Text="" CssClass="RadBtn" onclick="some_function"> <Icon SecondaryIconCssClass="rbAdd" SecondaryIconRight="4" SecondaryIconTop="4"/> </telerik:RadButton>when I click on my radbutton "some_function" is fire, but when I click on the icon which is on this button my function doesn't work.
public partial class AssignInvoices : Microsoft.Practices.CompositeWeb.Web.UI.Page, IAssignInvoicesView { private AssignInvoicesPresenter _presenter; //implemantaçao da propriedade public System.Collections.Generic.IList<Data.Users> Users { get; set; } public System.Collections.Generic.IList<Data.Priorities> Priorities { get; set; } public System.Collections.Generic.IList<Data.Staging> Staging { get; set; } protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { this._presenter.OnViewInitialized(); } this._presenter.OnViewLoaded(); Info x = new Info("xx", "xx", "xx,DC=xx,DC=xx"); Dictionary<string, string> networkUser = new Dictionary<string, string>(); networkUser = x.GetHierarchyTree("xx"); Dictionary<string, string> aux = new Dictionary<string, string>(); foreach (KeyValuePair<string, string> kvp in networkUser) { //kvp.Key = user de rede string userCompName = x.GetUserInfo("cn", kvp.Key); aux.Add(kvp.Key, userCompName);//Dictionary com key = user de rede e Value = nomeCompleto Utilizador } RadListBox1.DataTextField = "Key"; RadListBox1.DataValueField = "Value"; RadListBox1.DataSource = aux; RadListBox1.DataBind(); //Page.User.Identity.Name para ir buscar o login user //Popular dados na listbox users //RadListBox1.DataSource = this.Users; //RadListBox1.DataTextField = "UserName"; //RadListBox1.DataValueField = "UserSap"; //RadListBox1.DataBind(); //Popular dados na listbox grupos RadListBox2.DataSource = this.Priorities; RadListBox2.DataTextField = "Priority"; RadListBox2.DataValueField = "Priority"; RadListBox2.DataBind(); //Popular dados na listbox stagins RadListBox3.DataSource = this.Staging; RadListBox3.DataTextField = "Process"; RadListBox3.DataValueField = "Process"; RadListBox3.DataBind(); } [CreateNew] public AssignInvoicesPresenter Presenter { get { return this._presenter; } set { if (value == null) throw new ArgumentNullException("value"); this._presenter = value; this._presenter.View = this; } } // TODO: Forward events to the presenter and show state to the user. // For examples of this, see the View-Presenter (with Application Controller) QuickStart: // protected void RadButton1_Click(object sender, EventArgs e) { string _UserValue = RadListBox1.SelectedItem.Value; //Gets the value of item in Users. //string _text = RadListBox1.SelectedItem.Text; //Gets the Text of items in the list. List<string> _groups = new List<string>(); //create a list to store selected groups string _stg = RadListBox3.SelectedItem.Value; // create a list to store selected stagings if (RadListBox1.SelectedIndex > -1 && RadListBox2.SelectedIndex > -1 && RadListBox3.SelectedIndex > -1) { iConnect.InvoicesScaling.Data.UsersAssignDAO usrAssgnDAO = new iConnect.InvoicesScaling.Data.UsersAssignDAO(new EscalonamentoFacturasEntities()); UsersAssign user = new UsersAssign(); foreach (var grp in RadListBox2.SelectedItems) { _groups.Add(grp.Value); //store the selectItems on RadListBox2 to list groups //efectuar aqui o insert user.InserDate = DateTime.Now; int j; Int32.TryParse(grp.Value, out j); user.UserName = _UserValue; user.Priority = j; user.Staging = _stg; //passar o objecto a inserir na tabela da bd usrAssgnDAO.Add(user); usrAssgnDAO.SaveChanges(); } } //else if(RadListBox2.SelectedIndex < -1 ) //reportar erro } } }RadGrid1.DataSource = this.SapDocuments; RadGrid1. RadGrid1.UniqueID.Equals("Process") = public List<SapDocuments> GetSapDocumentsByUser(string userName) { var documentsQuery = from sd in spDocs.SapDocuments join ua in spDocs.UsersAssign on new { sd.Staging.Process, sd.Priorities.Priority } equals new { ua.Process, ua.Priority } where ua.UserName == userName //ALterar User select sd; return documentsQuery.ToList(); } } }<MasterTableView GridLines="None" Width="100%" ViewStateMode="Disabled" CommandItemSettings-ShowExportToCsvButton="True" CommandItemSettings-ShowAddNewRecordButton="false" CommandItemDisplay="Top"> <Columns> <telerik:GridBoundColumn DataField="SequencialNumber" HeaderText="SequencialNumber" UniqueName="SequencialNumber" SortExpression="SequencialNumber"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Priority" HeaderText="Priority" UniqueName="Priority" FilterControlAltText="Filter Priority column" SortExpression="Priority" DataType="System.Int32"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Process" HeaderText="Staging" UniqueName="Process" SortExpression="Process" FilterControlAltText="Filter Process column"> </telerik:GridBoundColumn>SapDocuments.Staging.Process;
SapDocuments.Priorities.Priority;
I needed to change my datamodel and know i have the exception for Priority and Process :
{"The ObjectContext instance has been disposed and can no longer be used for operations that require a connection."}
I have already set LazyLoad enabled...
style="background-image: none; background-position: 100% 50%; "