Here's a link to part of an exhaustive examination of the DataGrid. It discusses adding a button to the grid (ie, each row).
http://aspnet.4guysfromrolla.com/articles/042402-1.aspx Lots of other goodies in the other 16 parts of the article. On Apr 5, 2005 4:35 PM, indyjish <[EMAIL PROTECTED]> wrote: > > > OK, if I put the buttons OUTSIDE of the DataGrid, then everything is > fine. So now all I have to do is figure out how to put buttons inside > of the datagrid, one for each record... > > --- In [email protected], "indyjish" <[EMAIL PROTECTED]> > wrote: > > > > > > Hello all, > > > > I'm brand new to asp.NET and C#, taking over a small project from a > > developer who left. > > > > I have been asked to add some functionality to a form. To do so, I > > want to add some buttons. Since I can't drag-n-drop buttons into a > > data grid (VS .NET 1.0), I figured I'd edit the HTML to copy a button > > that's already on that page, edit its properties sufficiently, and put > > it where I want it. I also modified the C# code to declare my button, > > and I have added callbacks. The code is shown below: > > > > private void InitializeComponent() > > { > > this.txtSearchCity.TextChanged += new > > System.EventHandler(this.txtSearchCity_TextChanged); > > this.btnSubmit.Click += new > System.EventHandler(this.btnSubmit_Click); > > this.DataList.ItemCommand += new > > > System.Web.UI.WebControls.RepeaterCommandEventHandler(this.DataList_ItemCommand); > > this.Load += new System.EventHandler(this.Page_Load); > > // These two lines below are where the error occurs > > this.btnVehDelete.Click += new > > System.EventHandler(this.btnVehDelete_Click); > > this.btnVehEdit.Click += new > > System.EventHandler(this.btnVehEdit_Click); > > } > > > > Then, I have created a callback such as this: > > > > private void btnVehDelete_Click(object sender, System.EventArgs e) > > { > > ExecuteDeleteSearchQuery(); > > } > > > > It would seem that the compiler can't find the btnVehDelete_Click > > callback and that's what it's complaining about. Do I need to provide > > a declaration or prototype anywhere else? Or is there something else > > I'm missing? > > > > Thanks, > > -IJ > > Yahoo! Groups Links > > > > > -- Dean Fiala Very Practical Software, Inc http://www.vpsw.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
