473,395 Members | 1,756 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,395 software developers and data experts.

Add events to html table

JJ
Hi,

I was wondering is it possible to create my own html table that has two
features.
1. it is databound and 2. create my own events for it?

The datagrid is nice and I do use it but I need to be able to customize it
for other events to occur with it.

Thanks,

JJ
Nov 19 '05 #1
4 1314
"JJ" <JJ@discussions.microsoft.com> wrote in message news:AB**********************************@microsof t.com...
The datagrid is nice and I do use it but I need to be able to customize it
for other events to occur with it.
Sure, have you tried subclassing the DataGrid?
1. it is databound and 2. create my own events for it?


DataGrid comes databound already, which saves you a hairy furball of
coding. :-)

Adding events is as simple as adding new fields typed as the Event-
Handler, declaring the event publicly (or internally), and writing a
method to invoke the event if it has any EventHandlers attached to
it. See this MSDN Library article for more information on adding
events,

http://msdn.microsoft.com/library/li...mcomponent.asp

Override the DataGrid's virtual (overridable) methods to fire your
additional events at the right times during the control's lifecycle. If
you override these methods then just remember to always call the
base class' implementation of that method (before or after your
override does it's stuff, depending on the timing that you're going
for.)
Derek Harmon
Nov 19 '05 #2
Probably "subclassing" DataGrid is what you are looking for.

Creating your own events -- you can do it. Note that client-side events
already have default handlers. You just need to override the methods.

btw, what exactly is that you are looking for / lacking. As far as I
know, DataGrid is very extensive and exhaustive.

--
Cheers,
Gaurav Vaish
http://www.mastergaurav.org
http://mastergaurav.blogspot.com
--------------------------------

Nov 19 '05 #3
JJ
Hi Gaurav,

Sorry for the delay in replying, past couple of days everytime I tired to
access the newsgroups I would get a service unavailable error which I think
had to do with passport.

Ok here's the issue I need to use the datagrid for reporting purposes. I
need to be able to put in a blank line and check records for certain
conditions. I can check records on certain conditions using OnItemdatabound
event but then need to add a blank row. Also I need a subtotal line and I
thought an custom generated event would work here. What do you think?

Thanks,
JJ

"MasterGaurav" wrote:
Probably "subclassing" DataGrid is what you are looking for.

Creating your own events -- you can do it. Note that client-side events
already have default handlers. You just need to override the methods.

btw, what exactly is that you are looking for / lacking. As far as I
know, DataGrid is very extensive and exhaustive.

--
Cheers,
Gaurav Vaish
http://www.mastergaurav.org
http://mastergaurav.blogspot.com
--------------------------------

Nov 19 '05 #4
Adding something at the end or at the start is simple.

Override the PrepareControlHierarchy method.

Whatever you wish to add in the start, add before calling
base.PrepareControlHierarchy. All that you plan to add later, add it
later.

I would suggest reading the actual implementation, for example, in Mono
(incidently, by myself ;-) ) at:

DataGrid:
http://cvs.hispalinux.es/cgi-bin/cvs...p&cvsroot=mono
Method: PrepareControlHierarchy

BaseDataList:
http://cvs.hispalinux.es/cgi-bin/cvs...p&cvsroot=mono
Method: Render

Hope that gives a detailed insight.
--
Cheers,
Gaurav Vaish
http://www.mastergaurav.org
http://mastergaurav.blogspot.com
--------------------------------

Nov 19 '05 #5

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

Similar topics

2
by: DS | last post by:
Hi, I can trigger these events successfully if table only has one row: Sub InputField_OnChange() ...... End Sub But, these events cannot be fired if table has more than one row, why? Pls...
3
by: Praveen | last post by:
In IE a table element will receive focus when you either tab into it or when you click anywhere within the table. Mainly it fires the onfocus event. This doesn't happen in Mozilla (Firefox and...
4
by: blue | last post by:
I have a drop-down list, a radio button list and a submit button. I'm adding these controls to a table and I'm adding the table to a Placeholder. I'm adding it to the Placeholder because I don't...
5
by: Patrick | last post by:
Hello I have the following problem. I have an aspx Page. This page contains an ASP-Table Object. So in that table, I have a linkbutton. So, I can't edit the event of that button trough the...
3
by: michael_vanommeren | last post by:
I have two web applications that I am working with and I am trying to do a Response.Redirect from one to the other. They are setup as separate web applications on the same IIS server. If I go...
1
by: Tebogo Tefo via .NET 247 | last post by:
Hi I have a user control that contains three dropdownlists that I populate according to what was selected in the other dropdownlist (i.e. populate dropdownlist2 after selecting a value in...
12
by: scsharma | last post by:
Hi, I am working on creating a webapplication and my design calls for creating main webform which will have menu bar on left hand side and a IFrame which will contain all the forms that are shown...
5
by: Ben Dewey | last post by:
This is a repost, But I have some new information. I have a server that is configured for .NET 1.1 and 2.0. For some reason all my postback events for aren't firing when using .NET 1.1. Under...
1
by: swethak | last post by:
Hi, I am desiging the calendar application for that purpose i used the below code. But it is for only displys calendar. And also i want to add the events to calendar. In that code displys the...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.