473,385 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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
ItemCommandEvent. 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 1402
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.dgMydata += ..." instruction.

S. L.

"Jarod" <Ja***@discussions.microsoft.com> wrote in message
news:62**********************************@microsof t.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
ItemCommandEvent. 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.dgMydata += ..." 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***@discussions.microsoft.com> wrote in message
news:86**********************************@microsof t.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.dgMydata += ..." 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.dgMydata +=.."
statement?
usually it look something like "DataGrid1.ItemCommand
+=..."

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 simpleItemCommandEvent. 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
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...
2
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...
4
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...
0
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...
4
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...
0
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....
1
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...
2
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...
0
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...

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.