Hi All,
I have a functioning datagrid on "Page 1" that displays order information
for a single order (this is for an e-commerce site). It's actually a
combination of a couple datagrids to display all of the information.
I now have a need to drop this datagrid into a repeater on "Page 2". The
repeater will grab ALL orders within a given date range and output the
datagrids for each order. Remember, the Page 1 is built to display one
order, Page 2 will be built to display ALL orders in the same fashion as
Page 1, but listing one right after the other.
Is there an easy way to take the datagrids I already have and drop them into
the ItemTemplate container of a repeater without a lot of work? I can figure
it all out if I spent the time on it, but if there's a simple way to do
this, I'd rather just ask. ;-) How do I bind the datagrids? I'd assume
within the Repeater_ItemDataBound event I'll have to do something, but how
would that work?
Thanks,
Scott 7 1903
Scott,
You're on the right track. You should be able to copy and paste your
datagrid into the repeater. Keep it's ID the same.
Then inside the Item_DataBound event of the repeater you'll get each
datagrid like this:
Dim MyDataGrid As DataGrid = CType(e.Item.FindControl("DataGridId"),
DataGrid)
"e" represents each row of the repeater.
Now you can work with the datagrid to databind it as you normally would.
MyDataGrid.DataSource = DataReader
Etc.
--
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer
Free code library at: www.aboutfortunate.com
"Out of chaos comes order."
Nietzche
"Scott Schluer" <us****@webservicesinc.biz> wrote in message
news:uV**************@TK2MSFTNGP12.phx.gbl... Hi All,
I have a functioning datagrid on "Page 1" that displays order information for a single order (this is for an e-commerce site). It's actually a combination of a couple datagrids to display all of the information.
I now have a need to drop this datagrid into a repeater on "Page 2". The repeater will grab ALL orders within a given date range and output the datagrids for each order. Remember, the Page 1 is built to display one order, Page 2 will be built to display ALL orders in the same fashion as Page 1, but listing one right after the other.
Is there an easy way to take the datagrids I already have and drop them
into the ItemTemplate container of a repeater without a lot of work? I can
figure it all out if I spent the time on it, but if there's a simple way to do this, I'd rather just ask. ;-) How do I bind the datagrids? I'd assume within the Repeater_ItemDataBound event I'll have to do something, but how would that work?
Thanks,
Scott
Thank you! :)
"S. Justin Gengo" <sj*****@aboutfortunate.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl... Scott,
You're on the right track. You should be able to copy and paste your datagrid into the repeater. Keep it's ID the same.
Then inside the Item_DataBound event of the repeater you'll get each datagrid like this:
Dim MyDataGrid As DataGrid = CType(e.Item.FindControl("DataGridId"), DataGrid)
"e" represents each row of the repeater.
Now you can work with the datagrid to databind it as you normally would.
MyDataGrid.DataSource = DataReader
Etc.
-- Sincerely,
S. Justin Gengo, MCP Web Developer / Programmer
Free code library at: www.aboutfortunate.com
"Out of chaos comes order." Nietzche
"Scott Schluer" <us****@webservicesinc.biz> wrote in message news:uV**************@TK2MSFTNGP12.phx.gbl... Hi All,
I have a functioning datagrid on "Page 1" that displays order
information for a single order (this is for an e-commerce site). It's actually a combination of a couple datagrids to display all of the information.
I now have a need to drop this datagrid into a repeater on "Page 2". The repeater will grab ALL orders within a given date range and output the datagrids for each order. Remember, the Page 1 is built to display one order, Page 2 will be built to display ALL orders in the same fashion as Page 1, but listing one right after the other.
Is there an easy way to take the datagrids I already have and drop them into the ItemTemplate container of a repeater without a lot of work? I can figure it all out if I spent the time on it, but if there's a simple way to do this, I'd rather just ask. ;-) How do I bind the datagrids? I'd assume within the Repeater_ItemDataBound event I'll have to do something, but
how would that work?
Thanks,
Scott
One more question. My datagrid (called 'dgCart' which is inside the
repeater) also has an ItemDataBound event. Within that event is this code:
oRows = dtDetails.Select("orderitem_id=" &
dgCart.DataKeys(e.Item.ItemIndex))
Notice it references dgCart.DataKeys. Well, since dgCart now only has scope
within the ItemDataBound event for the repeater, how do I access it here?
Scott
"S. Justin Gengo" <sj*****@aboutfortunate.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl... Scott,
You're on the right track. You should be able to copy and paste your datagrid into the repeater. Keep it's ID the same.
Then inside the Item_DataBound event of the repeater you'll get each datagrid like this:
Dim MyDataGrid As DataGrid = CType(e.Item.FindControl("DataGridId"), DataGrid)
"e" represents each row of the repeater.
Now you can work with the datagrid to databind it as you normally would.
MyDataGrid.DataSource = DataReader
Etc.
-- Sincerely,
S. Justin Gengo, MCP Web Developer / Programmer
Free code library at: www.aboutfortunate.com
"Out of chaos comes order." Nietzche
"Scott Schluer" <us****@webservicesinc.biz> wrote in message news:uV**************@TK2MSFTNGP12.phx.gbl... Hi All,
I have a functioning datagrid on "Page 1" that displays order
information for a single order (this is for an e-commerce site). It's actually a combination of a couple datagrids to display all of the information.
I now have a need to drop this datagrid into a repeater on "Page 2". The repeater will grab ALL orders within a given date range and output the datagrids for each order. Remember, the Page 1 is built to display one order, Page 2 will be built to display ALL orders in the same fashion as Page 1, but listing one right after the other.
Is there an easy way to take the datagrids I already have and drop them into the ItemTemplate container of a repeater without a lot of work? I can figure it all out if I spent the time on it, but if there's a simple way to do this, I'd rather just ask. ;-) How do I bind the datagrids? I'd assume within the Repeater_ItemDataBound event I'll have to do something, but
how would that work?
Thanks,
Scott
Scott,
You're welcome. If you run into any trouble feel free to email me. I wrote
that sample code from memory so if I have something wrong and you can't
figure it out let me know and I'll straighten it out. :)
--
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer
Free code library at: www.aboutfortunate.com
"Out of chaos comes order."
Nietzche
"Scott Schluer" <us****@webservicesinc.biz> wrote in message
news:uB**************@TK2MSFTNGP11.phx.gbl... Thank you! :)
"S. Justin Gengo" <sj*****@aboutfortunate.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl... Scott,
You're on the right track. You should be able to copy and paste your datagrid into the repeater. Keep it's ID the same.
Then inside the Item_DataBound event of the repeater you'll get each datagrid like this:
Dim MyDataGrid As DataGrid = CType(e.Item.FindControl("DataGridId"), DataGrid)
"e" represents each row of the repeater.
Now you can work with the datagrid to databind it as you normally would.
MyDataGrid.DataSource = DataReader
Etc.
-- Sincerely,
S. Justin Gengo, MCP Web Developer / Programmer
Free code library at: www.aboutfortunate.com
"Out of chaos comes order." Nietzche
"Scott Schluer" <us****@webservicesinc.biz> wrote in message news:uV**************@TK2MSFTNGP12.phx.gbl... Hi All,
I have a functioning datagrid on "Page 1" that displays order information for a single order (this is for an e-commerce site). It's actually a combination of a couple datagrids to display all of the information.
I now have a need to drop this datagrid into a repeater on "Page 2".
The repeater will grab ALL orders within a given date range and output the datagrids for each order. Remember, the Page 1 is built to display one order, Page 2 will be built to display ALL orders in the same fashion
as Page 1, but listing one right after the other.
Is there an easy way to take the datagrids I already have and drop
them into the ItemTemplate container of a repeater without a lot of work? I can figure it all out if I spent the time on it, but if there's a simple way to
do this, I'd rather just ask. ;-) How do I bind the datagrids? I'd assume within the Repeater_ItemDataBound event I'll have to do something, but
how would that work?
Thanks,
Scott
Scott,
The datagrid won't be declared in your code-behind page so you won't have
access to it's events in order to hook up a subroutine using "Handles". But,
you can wire it up manually.
In the html view of the datagrid add "OnItemDataBound" along with the method
you want to fire:
This will act just like "Handles" did. (Except you don't need "Handles"
after the subroutine.)
<asp:DataGrid id="DataGrid1" runat="server"
OnItemDataBound="MyDataGrid_ItemDataBound"></asp:DataGrid>
--
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer
Free code library at: www.aboutfortunate.com
"Out of chaos comes order."
Nietzche
"Scott Schluer" <us****@webservicesinc.biz> wrote in message
news:uw*************@TK2MSFTNGP11.phx.gbl... One more question. My datagrid (called 'dgCart' which is inside the repeater) also has an ItemDataBound event. Within that event is this code:
oRows = dtDetails.Select("orderitem_id=" & dgCart.DataKeys(e.Item.ItemIndex))
Notice it references dgCart.DataKeys. Well, since dgCart now only has
scope within the ItemDataBound event for the repeater, how do I access it here?
Scott
"S. Justin Gengo" <sj*****@aboutfortunate.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl... Scott,
You're on the right track. You should be able to copy and paste your datagrid into the repeater. Keep it's ID the same.
Then inside the Item_DataBound event of the repeater you'll get each datagrid like this:
Dim MyDataGrid As DataGrid = CType(e.Item.FindControl("DataGridId"), DataGrid)
"e" represents each row of the repeater.
Now you can work with the datagrid to databind it as you normally would.
MyDataGrid.DataSource = DataReader
Etc.
-- Sincerely,
S. Justin Gengo, MCP Web Developer / Programmer
Free code library at: www.aboutfortunate.com
"Out of chaos comes order." Nietzche
"Scott Schluer" <us****@webservicesinc.biz> wrote in message news:uV**************@TK2MSFTNGP12.phx.gbl... Hi All,
I have a functioning datagrid on "Page 1" that displays order information for a single order (this is for an e-commerce site). It's actually a combination of a couple datagrids to display all of the information.
I now have a need to drop this datagrid into a repeater on "Page 2".
The repeater will grab ALL orders within a given date range and output the datagrids for each order. Remember, the Page 1 is built to display one order, Page 2 will be built to display ALL orders in the same fashion
as Page 1, but listing one right after the other.
Is there an easy way to take the datagrids I already have and drop
them into the ItemTemplate container of a repeater without a lot of work? I can figure it all out if I spent the time on it, but if there's a simple way to
do this, I'd rather just ask. ;-) How do I bind the datagrids? I'd assume within the Repeater_ItemDataBound event I'll have to do something, but
how would that work?
Thanks,
Scott
Hi,
That's already been taken care of, its the reference to "dgCart" in the
dgCart's itemdatabound event that I can't figure out. Since "dgCart" is
declared in the REPEATERS itemdatabound event, it can't be accessed within
the other event because it's out of scope at that point.
Scott
"S. Justin Gengo" <sj*****@aboutfortunate.com> wrote in message
news:ev**************@TK2MSFTNGP10.phx.gbl... Scott,
The datagrid won't be declared in your code-behind page so you won't have access to it's events in order to hook up a subroutine using "Handles".
But, you can wire it up manually.
In the html view of the datagrid add "OnItemDataBound" along with the
method you want to fire:
This will act just like "Handles" did. (Except you don't need "Handles" after the subroutine.)
<asp:DataGrid id="DataGrid1" runat="server" OnItemDataBound="MyDataGrid_ItemDataBound"></asp:DataGrid>
-- Sincerely,
S. Justin Gengo, MCP Web Developer / Programmer
Free code library at: www.aboutfortunate.com
"Out of chaos comes order." Nietzche
"Scott Schluer" <us****@webservicesinc.biz> wrote in message news:uw*************@TK2MSFTNGP11.phx.gbl... One more question. My datagrid (called 'dgCart' which is inside the repeater) also has an ItemDataBound event. Within that event is this
code: oRows = dtDetails.Select("orderitem_id=" & dgCart.DataKeys(e.Item.ItemIndex))
Notice it references dgCart.DataKeys. Well, since dgCart now only has scope within the ItemDataBound event for the repeater, how do I access it
here? Scott
"S. Justin Gengo" <sj*****@aboutfortunate.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl... Scott,
You're on the right track. You should be able to copy and paste your datagrid into the repeater. Keep it's ID the same.
Then inside the Item_DataBound event of the repeater you'll get each datagrid like this:
Dim MyDataGrid As DataGrid = CType(e.Item.FindControl("DataGridId"), DataGrid)
"e" represents each row of the repeater.
Now you can work with the datagrid to databind it as you normally
would. MyDataGrid.DataSource = DataReader
Etc.
-- Sincerely,
S. Justin Gengo, MCP Web Developer / Programmer
Free code library at: www.aboutfortunate.com
"Out of chaos comes order." Nietzche
"Scott Schluer" <us****@webservicesinc.biz> wrote in message news:uV**************@TK2MSFTNGP12.phx.gbl... > Hi All, > > I have a functioning datagrid on "Page 1" that displays order information > for a single order (this is for an e-commerce site). It's actually a > combination of a couple datagrids to display all of the information. > > I now have a need to drop this datagrid into a repeater on "Page 2". The > repeater will grab ALL orders within a given date range and output
the > datagrids for each order. Remember, the Page 1 is built to display
one > order, Page 2 will be built to display ALL orders in the same
fashion as > Page 1, but listing one right after the other. > > Is there an easy way to take the datagrids I already have and drop them into > the ItemTemplate container of a repeater without a lot of work? I
can figure > it all out if I spent the time on it, but if there's a simple way to
do > this, I'd rather just ask. ;-) How do I bind the datagrids? I'd
assume > within the Repeater_ItemDataBound event I'll have to do something,
but how > would that work? > > Thanks, > > Scott > > >
Scott,
Yes, I think that if you add OnItemDataBound =
"YourItemDataBoundSubroutineHere" to the dgCart code inside of the repeater
then that subroutine should fire while dgCart is being databound.
--
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer
Free code library at: www.aboutfortunate.com
"Out of chaos comes order."
Nietzche
"Scott Schluer" <us****@webservicesinc.biz> wrote in message
news:e2**************@TK2MSFTNGP09.phx.gbl... Hi,
That's already been taken care of, its the reference to "dgCart" in the dgCart's itemdatabound event that I can't figure out. Since "dgCart" is declared in the REPEATERS itemdatabound event, it can't be accessed within the other event because it's out of scope at that point.
Scott
"S. Justin Gengo" <sj*****@aboutfortunate.com> wrote in message news:ev**************@TK2MSFTNGP10.phx.gbl... Scott,
The datagrid won't be declared in your code-behind page so you won't
have access to it's events in order to hook up a subroutine using "Handles". But, you can wire it up manually.
In the html view of the datagrid add "OnItemDataBound" along with the method you want to fire:
This will act just like "Handles" did. (Except you don't need "Handles" after the subroutine.)
<asp:DataGrid id="DataGrid1" runat="server" OnItemDataBound="MyDataGrid_ItemDataBound"></asp:DataGrid>
-- Sincerely,
S. Justin Gengo, MCP Web Developer / Programmer
Free code library at: www.aboutfortunate.com
"Out of chaos comes order." Nietzche
"Scott Schluer" <us****@webservicesinc.biz> wrote in message news:uw*************@TK2MSFTNGP11.phx.gbl... One more question. My datagrid (called 'dgCart' which is inside the repeater) also has an ItemDataBound event. Within that event is this code: oRows = dtDetails.Select("orderitem_id=" & dgCart.DataKeys(e.Item.ItemIndex))
Notice it references dgCart.DataKeys. Well, since dgCart now only has scope within the ItemDataBound event for the repeater, how do I access it here? Scott
"S. Justin Gengo" <sj*****@aboutfortunate.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl... > Scott, > > You're on the right track. You should be able to copy and paste your > datagrid into the repeater. Keep it's ID the same. > > Then inside the Item_DataBound event of the repeater you'll get each > datagrid like this: > > Dim MyDataGrid As DataGrid = CType(e.Item.FindControl("DataGridId"), > DataGrid) > > "e" represents each row of the repeater. > > Now you can work with the datagrid to databind it as you normally would. > > MyDataGrid.DataSource = DataReader > > Etc. > > > -- > Sincerely, > > S. Justin Gengo, MCP > Web Developer / Programmer > > Free code library at: > www.aboutfortunate.com > > "Out of chaos comes order." > Nietzche > > > "Scott Schluer" <us****@webservicesinc.biz> wrote in message > news:uV**************@TK2MSFTNGP12.phx.gbl... > > Hi All, > > > > I have a functioning datagrid on "Page 1" that displays order information > > for a single order (this is for an e-commerce site). It's actually
a > > combination of a couple datagrids to display all of the
information. > > > > I now have a need to drop this datagrid into a repeater on "Page
2". The > > repeater will grab ALL orders within a given date range and output the > > datagrids for each order. Remember, the Page 1 is built to display one > > order, Page 2 will be built to display ALL orders in the same fashion as > > Page 1, but listing one right after the other. > > > > Is there an easy way to take the datagrids I already have and drop them > into > > the ItemTemplate container of a repeater without a lot of work? I can > figure > > it all out if I spent the time on it, but if there's a simple way
to do > > this, I'd rather just ask. ;-) How do I bind the datagrids? I'd assume > > within the Repeater_ItemDataBound event I'll have to do something, but how > > would that work? > > > > Thanks, > > > > Scott > > > > > > > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Lalit Bhatia |
last post by:
how can we fix first column in DataGrid?
Regards,
Lalit Bhatia
|
by: Lalit Bhatia |
last post by:
thanks for the answer
but I need it for windows forms. I have a desktop application where I need
to implement this.
--
Regards,
Lalit Bhatia
"Mona" <mona@discussions.microsoft.com> wrote in...
|
by: Stephen Miller |
last post by:
I am using the OnItemDataBound event of Repeater control to nest a
DataGrid within the Repeater. When I attempt to bind to the DataGrid
using the DataSource method I get the error message "Object...
|
by: Rick |
last post by:
Hello all, I hope all is well with you.
I am having a seriously difficult time with this problem. Allow me to
set
up the problem.
I have a System.Web.UI.Page with the following controls...
|
by: News |
last post by:
Hi I need help to display and edit data in a data grid within a repeater.
The code is below:
Sub dgrdEvents_EditCommand(sender As Object, e As DataGridCommandEventArgs)...
|
by: News |
last post by:
I have a page with many controls. Among these controls there is a table
which is a datagrid with nested repeater inside. My problem is that I can
not use DataGridCommandEventArgs to get datagrid...
|
by: James Moore |
last post by:
I've got a datagrid. One of the elements in the grid is a comma-seperated
string. I'd like to split the string and create N linkbuttons, one for each
element of the string.
Creating the grid...
|
by: Maziar Aflatoun |
last post by:
Hi everyone,
I have a datagrid that I create inside a Repeater at runtime. I have
defined a checkbox beside each row so that users can select multiple rows.
<asp:datagrid id="dgProducts"...
|
by: Sparky Arbuckle |
last post by:
I'm sure this question has been posted many times, but I have yet to
find an answer for it. I am trying to nest a repeater (or datalist)
inside of a datagrid and am trying to figure out how to nest...
|
by: Naresh1 |
last post by:
What is WebLogic Admin Training?
WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
|
by: antdb |
last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine
In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
|
by: Matthew3360 |
last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function.
Here is my code.
header("Location:".$urlback);
Is this the right layout the...
|
by: AndyPSV |
last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
|
by: Arjunsri |
last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
|
by: WisdomUfot |
last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
|
by: Matthew3360 |
last post by:
Hi,
I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
|
by: BLUEPANDA |
last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
|
by: Rahul1995seven |
last post by:
Introduction:
In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
| |