473,788 Members | 2,692 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Data grid doesn't fire events

hey
I tried to make ASP.Net site with a datagrid. On the dg there is a button
columnt with command set to select. I put in the code some very simple
ItemCommandEven t. In the ... generated code there is this.dgMydata += ... so
it should be ok. But it's not. I tried to remove it and recreate everything
still nothing. In code there is of course the procedure that should be run.
What went wrong ?
Jarod
Nov 16 '05 #1
5 1419
Set the EnableViewState property of the DataGrid to "True" and the
AutoEventWireup property for the page to "false" . The DataGrid needs its
view state for firing events and the AutoEventWireup will make a second call
to all of your events is set to True. You don't need this because you are
already wiring them with the "this.dgMyd ata += ..." instruction.

S. L.

"Jarod" <Ja***@discussi ons.microsoft.c om> wrote in message
news:62******** *************** ***********@mic rosoft.com...
hey
I tried to make ASP.Net site with a datagrid. On the dg there is a button
columnt with command set to select. I put in the code some very simple
ItemCommandEven t. In the ... generated code there is this.dgMydata += ...
so
it should be ok. But it's not. I tried to remove it and recreate
everything
still nothing. In code there is of course the procedure that should be
run.
What went wrong ?
Jarod

Nov 16 '05 #2
> Set the EnableViewState property of the DataGrid to "True" and the
AutoEventWireup property for the page to "false" . The DataGrid needs its
view state for firing events and the AutoEventWireup will make a second call
to all of your events is set to True. You don't need this because you are
already wiring them with the "this.dgMyd ata += ..." instruction.

I already had the autoEventWireup set to false and EnableViewState to true,
but after your post I set Datagrid's enableViewState to false, and it works
now. When I set ViewState again to true it stops to work. Maybe you know why ?
Jarod
Nov 16 '05 #3
With the Datagrid's ViewState set to false, you should have problem with
things like automatic paging. Without the source code, I cannot tell you
anything more. It is possible, for example, that you are binding your
datagrid to many times or at the wrong place.

Maybe by taking a look at the trace.axd output, you will see what's the
problem.

S. L.

"Jarod" <Ja***@discussi ons.microsoft.c om> wrote in message
news:86******** *************** ***********@mic rosoft.com...
Set the EnableViewState property of the DataGrid to "True" and the
AutoEventWireup property for the page to "false" . The DataGrid needs
its
view state for firing events and the AutoEventWireup will make a second
call
to all of your events is set to True. You don't need this because you
are
already wiring them with the "this.dgMyd ata += ..." instruction.

I already had the autoEventWireup set to false and EnableViewState to
true,
but after your post I set Datagrid's enableViewState to false, and it
works
now. When I set ViewState again to true it stops to work. Maybe you know
why ?
Jarod

Nov 16 '05 #4
I am wondering if u can post up a few lines of code.

did you really managed to compile "this.dgMyd ata +=.."
statement?
usually it look something like "DataGrid1.Item Command
+=..."

Joey
-----Original Message-----
hey
I tried to make ASP.Net site with a datagrid. On the dg there is a buttoncolumnt with command set to select. I put in the code some very simpleItemCommandEve nt. In the ... generated code there is this.dgMydata += ... soit should be ok. But it's not. I tried to remove it and recreate everythingstill nothing. In code there is of course the procedure that should be run.What went wrong ?
Jarod
.

Nov 16 '05 #5
> With the Datagrid's ViewState set to false, you should have problem with
things like automatic paging. Without the source code, I cannot tell you
anything more. It is possible, for example, that you are binding your
datagrid to many times or at the wrong place.

Maybe by taking a look at the trace.axd output, you will see what's the
problem.

I bind datagrid only once at page load. There is no other databinding.
Jarod
Nov 16 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
2392
by: pmud | last post by:
Hi, I am using teh following code for sorting the data grid but it doesnt work. I have set the auto generate columns to false. & set the sort expression for each field as the anme of that field... This grid displayes results based on users search.. public static int numberDiv; private void Page_Load(object sender, System.EventArgs e) {
2
1538
by: Greg | last post by:
The issue: I have a grid which has a dataset as the datasource. If a user enters data in a textbox on the grid and then clicks on the close button of the form (the red X in the upper right corner), no events fire for the grid or the control that the user was typing in. The closing event of the form does fire, and I check there to see if any changes need to be saved. If the user changes rows in the form, the typed data is transmitted...
4
1521
by: Jim Heavey | last post by:
Hello, I am starting to learn how to use the Datagrid and I have a couple of questions. My datagrid as a checkbox in it. It looks like the following in the datagrid... <asp:TemplateColumn HeaderText="Check In"> <ItemStyle HorizontalAlign="Center" Width="30px"></ItemStyle> <ItemTemplate> <asp:CheckBox id="chkReturn" runat="server" OnCheckedChanged="CheckItIn"></asp:CheckBox>
0
280
by: Jim Heavey | last post by:
I am trying to understand the difference between specifying the "attribute" of "onEdit" when you are creating the HTML and going into VS in the Properties window and clicking on the events button and then double clicking that same event? If I do that in the IDE, it does not create an HTML attribute entry and likewist, if you key something over in the HTML side, it does not show up in the properies window for the specified event. If I...
4
2304
by: Woody Splawn | last post by:
I have a grid with, lets say, 3 fields in it, Debit, Credit and Comments, in that order. When the user moves to the debit field, if he enters data in it, I would like for the cursor to skip past the Credit field to the comments field. I have a ColumnChanging event where I trap to see what field the user is on. I trap for the user being on the Debit field. I have code that , in my mind should cause the cursor to move to the Comments...
0
1127
by: ariesc | last post by:
I upgraded from .NET 2002 to .NET 2003 and found one weird things on the LEAVE / ENTER events within a datagrid. I added handler to each textbox of a datagrid, then handle the ENTER/LEAVE events. The ENETER/LEAVE events used to work normally with all arrows keys in 2002 version. Just after upgraded to 2003: 1. up/down key on same column DON'T fire enter/leave! 2. READONLY on column fire events, but when editable, events not fire 3....
1
1289
by: Ashe Sjedic | last post by:
Hi, i'm stuck at the point where you click on the row (or button on the row, or better yet just a link on the row) and have it do something. Something like msgbox("you clicked on this") Am I supposed to use a datarepeater, a datadeleter, a gridrepeater a viewgiredeleterRepeater
2
2446
by: | last post by:
I want to know how to make a clickable button or Command field on a GridView, and have the user's action a) fire a function and b) pass a data value from one of the GridView's columns to that function. Long version: ASP.NET's usual paradigm with master-detail editing is to have you define a commandfield, and on your detail view to define a second datasource that uses the SelectedValue of the GridView to determine what the detail record...
0
981
by: Jaffar | last post by:
hai, I am developing a web application, in my application i am using a data grid, At first data grid having only headers, and have a button, When ever user clicks the button a new row will be adder accoring to the datagrid header, in the data grid i have to place two dropdown lists and 3 text boxes. when ever user selects one item from the first drop down list, second drop down will be filled .It means i need to fire events also.
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10173
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5399
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4070
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.