ASP DataGrid with C# code-behind question

G

Guest

Whenever I put a DataGrid onto an ASP page that has C# code-behind, the
code-behind method for DataGrid_SelectionChanged() doesn't fire off unless
I've double clicked the DataGrid in design view and had Visual Studio send me
to the code. It's as if it doesn't realize that I've coded the method until
I double click on the DataGrid. In the current project I'm working on, this
poses a problem since I'm not able to see the DataGrid in design view (since
it's inside of an ASP Table that's inside of an ASP Panel...VS doesn't like
to display the Datagrid for some reason here). Any suggestions on what I can
do to get this to work? Thanks!
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

Double clicking o a control while in the designer create the handler for
the default event. if you do not do that it's not created,

If you need a handler for another event just select the control in the
designer, go to properties, change to events ( by default it's int eh
properties listing) and double click in the desired event.


if for some reason you cannot use de designer all you have to do is manually
create the handler method with the correct signature and assign it to the
event of the control, usually you do this either in the constructor or in
the InitializeComponent methods


cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top