473,937 Members | 27,718 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to determing Grid object

I have multiple Grid objects that are editable on my page. The following is
an example of the onEditCommand method. In this case D1 (the Grid object)
is known.

*************** *************** *************** *******
sub DataEdit(S as Object, E as DataGridCommand EventArgs)
trace.warn("in DataEdit")
D1.EditItemInde x=Cint(E.Item.I temIndex)
FillUpGrid()
end sub
*************** *************** *************** ********

In my case, I have a Datalist that has multiple DataGrids in them, something
like:

*************** *************** *************** ***************
<asp:datalist id="DataList1"
runat="server"
Width="100%"
BorderWidth="0p x"
OnItemCommand=" OnSelectIndexCh anged"
footerstyle-horizontalalign ="center"
CellPadding="0"
CellSpacing="0"
style="margin:0 ">
<AlternatingIte mStyle cssClass=altern ateRow
</AlternatingItem Style>

<asp:DataGrid visible="False"
id="DataGrid1"
runat="server"
Width="400px"
Height="79px"
AutoGenerateCol umns="False"
GridLines="None "
onEditCommand=" DataEdit"
onCancelCommand ="DataCancel "
onUpdateCommand ="DataUpdate ">
</asp:datalist>
*************** *************** *************** *************** *************** ***************

Here there are multiple datagrids (one for each listitem). When I run my
onEditCommand routine, it needs to know the DataGrid to bind the data to.

It can't be DataGrid1.

How do I determine the Grid object from:

sub DataEdit(S as Object, E as DataGridCommand EventArgs)

Thanks,

Tom.
Nov 18 '05 #1
2 1075
Tom, typically you'd have a separate event handler for each of the
DataGrids' OnEditCommand events. However, you have some (or all) of the
DataGrid's trigger the same event handler. The first input parameter of
the event handler contains the control that raised the event.

sub DataEdit(S as Object, E as DataGridCommand EventArgs)
trace.warn("in DataEdit")

Dim dg as DataGrid = CType(S, DataGrid)
trace.warn("The DataGrid is " & dg.ID)

D1.EditItemInde x=Cint(E.Item.I temIndex)
FillUpGrid()
end sub

hth
tshad wrote:
I have multiple Grid objects that are editable on my page. The following is
an example of the onEditCommand method. In this case D1 (the Grid object)
is known.

*************** *************** *************** *******
sub DataEdit(S as Object, E as DataGridCommand EventArgs)
trace.warn("in DataEdit")
D1.EditItemInde x=Cint(E.Item.I temIndex)
FillUpGrid()
end sub
*************** *************** *************** ********

In my case, I have a Datalist that has multiple DataGrids in them, something
like:

*************** *************** *************** ***************
<asp:datalist id="DataList1"
runat="server"
Width="100%"
BorderWidth="0p x"
OnItemCommand=" OnSelectIndexCh anged"
footerstyle-horizontalalign ="center"
CellPadding="0"
CellSpacing="0"
style="margin:0 ">
<AlternatingIte mStyle cssClass=altern ateRow
></AlternatingItem Style>

<asp:DataGrid visible="False"
id="DataGrid1"
runat="server"
Width="400px"
Height="79px"
AutoGenerateCol umns="False"
GridLines="None "
onEditCommand=" DataEdit"
onCancelCommand ="DataCancel "
onUpdateCommand ="DataUpdate ">
</asp:datalist>
*************** *************** *************** *************** *************** ***************

Here there are multiple datagrids (one for each listitem). When I run my
onEditCommand routine, it needs to know the DataGrid to bind the data to.

It can't be DataGrid1.

How do I determine the Grid object from:

sub DataEdit(S as Object, E as DataGridCommand EventArgs)

Thanks,

Tom.

--

Scott Mitchell
mi******@4guysf romrolla.com
http://www.4GuysFromRolla.com

* When you think ASP.NET, think 4GuysFromRolla. com!
Nov 18 '05 #2
Scott,

That was what I was looking for.

I assume that I would then do something like:

Dim dg as DataGrid = CType(S, DataGrid)

dg.bind()

I really appreciate the help,

Thanks,

Tom.

"Scott Mitchell [MVP]" <mi******@4guys fromrolla.com> wrote in message
news:41******** ******@4guysfro mrolla.com...
Tom, typically you'd have a separate event handler for each of the
DataGrids' OnEditCommand events. However, you have some (or all) of the
DataGrid's trigger the same event handler. The first input parameter of
the event handler contains the control that raised the event.

sub DataEdit(S as Object, E as DataGridCommand EventArgs)
trace.warn("in DataEdit")

Dim dg as DataGrid = CType(S, DataGrid)
trace.warn("The DataGrid is " & dg.ID)

D1.EditItemInde x=Cint(E.Item.I temIndex)
FillUpGrid()
end sub

hth
tshad wrote:
I have multiple Grid objects that are editable on my page. The following
is an example of the onEditCommand method. In this case D1 (the Grid
object) is known.

*************** *************** *************** *******
sub DataEdit(S as Object, E as DataGridCommand EventArgs)
trace.warn("in DataEdit")
D1.EditItemInde x=Cint(E.Item.I temIndex)
FillUpGrid()
end sub
*************** *************** *************** ********

In my case, I have a Datalist that has multiple DataGrids in them,
something like:

*************** *************** *************** ***************
<asp:datalist id="DataList1"
runat="server"
Width="100%"
BorderWidth="0p x"
OnItemCommand=" OnSelectIndexCh anged"
footerstyle-horizontalalign ="center"
CellPadding="0"
CellSpacing="0"
style="margin:0 ">
<AlternatingIte mStyle cssClass=altern ateRow
></AlternatingItem Style>

<asp:DataGrid visible="False"
id="DataGrid1"
runat="server"
Width="400px"
Height="79px"
AutoGenerateCol umns="False"
GridLines="None "
onEditCommand=" DataEdit"
onCancelCommand ="DataCancel "
onUpdateCommand ="DataUpdate ">
</asp:datalist>
*************** *************** *************** *************** *************** ***************

Here there are multiple datagrids (one for each listitem). When I run my
onEditCommand routine, it needs to know the DataGrid to bind the data to.

It can't be DataGrid1.

How do I determine the Grid object from:

sub DataEdit(S as Object, E as DataGridCommand EventArgs)

Thanks,

Tom.

--

Scott Mitchell
mi******@4guysf romrolla.com
http://www.4GuysFromRolla.com

* When you think ASP.NET, think 4GuysFromRolla. com!

Nov 18 '05 #3

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

Similar topics

5
2525
by: pmud | last post by:
Hi, I need to display columns in a data grid based on 7 different queries. Now I have 32 questions: 1. Is it possble to have 1 single data adapter with 7 queries & 1 data set or do I need to have a separate data adapter & a separate data set for each select query? If thats possible then how?
1
1715
by: Ubi | last post by:
Hello, i have a table. a dataView and a DataGrid. I'm using the dataView to filter the table. When the user double clicks on the DataGrid i want to get the data of the first col from the row selected. The problem is that i can't get the row number of the original table because the grid is refering to the dataView... what can i do? please help...
1
2009
by: Steve | last post by:
Hi I have a db with 2 tables that I want to bind to a grid depending on a selection in a Dropdownlist Also I want to be able to select a row from the gris to fill some textboxes. The databases are static in that they will not be updated they are just for viewing I have everything working but not to perfection
4
3294
by: blackhawk | last post by:
I need to build a web page that has to potentially display a large amount of data in two grids on the same page. The HTML file with all of the formatting is about 7MB in size. This is too large and I need to implement some kind of "client side" lazy loading. What I mean is this: I want to display a grid that only shows, say, 20 records. I need an external scrollbar control that I can then show on the screen next to the grid. When...
4
4494
by: Girish | last post by:
Im trying to create a grid within a grid programmatically. Ive been successful in doing this but I need the embedded grid to fire its ItemDataBound event so I can handle it. The event does not seem to fire for some reason. The code is below. Look towards the end of the CustomerDataGrid_OnItemDataBound(object sender, DataGridItemEventArgs e) method. This is where I register the event and place the programmatically created grid into the...
2
5010
by: SStory | last post by:
I have a picture that I allow the user to move around and would like to offer grid support like VB and other apps so that it will snap to the nearest point. How can I offer grid support so that the image will snap in place on grid points like a commerical app? I am not sure how to implement that. Anyone have any code? Thanks,
0
1429
by: Stu | last post by:
Hi, Im using VB dot net and crystal 11 I have a mainReport with a parameter @Idcustomer and in the mainReport I have a subreport @customerId They are linked using crystal. I would like to determing in the subreport the parameter name it is linked to in this case @customerId is linked to @idCustomer using code. I know there is a subreports link collection but unsure how to use it. Any ideas/code samples
5
1668
by: =?Utf-8?B?RGF2aWQgTGV2aW5l?= | last post by:
This is really more of a "why was C# designed this way?" type of question. Hope this is the write forum for this question. Given the following : class Base1 { public int i; } struct Base2 {
1
4408
by: asharda | last post by:
I have a custom property grid. I am using custom property grid as I do not want the error messages that the propertygrid shows when abphabets are entered in interger fields. The custom property grid doesn't show colloections i.e. if I have a List<Objectthen the Collection is shown but when I click on the "..." button next to it nothing comes up. If I say CustomPropertyGrid p = new CustomPropertyGrid(); p.SelectedObject = new...
0
10125
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
11507
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
11280
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,...
0
10648
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9850
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7377
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4899
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
2
4441
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3495
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.