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

How to don't display value?

I wrote an aspx page.
It shows datagrid with values:

server | parameter
---------------------
server1 | parameter1
server1 | parameter2
server1 | parameter3
server1 | parameter4
server1 | parameter5
server2 | parameter1
server2 | parameter2
server2 | parameter6
server3 | parameter3
server3 | parameter7
server3 | parameter13
server3 | parameter34

I'm trying to do something like that:
server | parameter
---------------------
server1 | parameter1
| parameter2
| parameter3
| parameter4
| parameter5
server2 | parameter1
| parameter2
| parameter6
server3 | parameter3
| parameter7
| parameter13
| parameter34

Can someone make a hint/help/anything, how can i do that?
Nov 19 '05 #1
6 1315
In PreRender event handler loop through the grid records. Every loop
remember server column value. If the next iteration the value is the same,
replace it with empty string.

Eliyahu

"Leszek" <ma***@zegarek.pl> wrote in message
news:O1**************@TK2MSFTNGP09.phx.gbl...
I wrote an aspx page.
It shows datagrid with values:

server | parameter
---------------------
server1 | parameter1
server1 | parameter2
server1 | parameter3
server1 | parameter4
server1 | parameter5
server2 | parameter1
server2 | parameter2
server2 | parameter6
server3 | parameter3
server3 | parameter7
server3 | parameter13
server3 | parameter34

I'm trying to do something like that:
server | parameter
---------------------
server1 | parameter1
| parameter2
| parameter3
| parameter4
| parameter5
server2 | parameter1
| parameter2
| parameter6
server3 | parameter3
| parameter7
| parameter13
| parameter34

Can someone make a hint/help/anything, how can i do that?

Nov 19 '05 #2
Can someone help me?
Użytkownik "Leszek" <ma***@zegarek.pl> napisał w wiadomości
news:O1**************@TK2MSFTNGP09.phx.gbl...
I wrote an aspx page.
It shows datagrid with values:

server | parameter
---------------------
server1 | parameter1
server1 | parameter2
server1 | parameter3
server1 | parameter4
server1 | parameter5
server2 | parameter1
server2 | parameter2
server2 | parameter6
server3 | parameter3
server3 | parameter7
server3 | parameter13
server3 | parameter34

I'm trying to do something like that:
server | parameter
---------------------
server1 | parameter1
| parameter2
| parameter3
| parameter4
| parameter5
server2 | parameter1
| parameter2
| parameter6
server3 | parameter3
| parameter7
| parameter13
| parameter34

Can someone make a hint/help/anything, how can i do that?

Nov 19 '05 #3
> Can someone help me?

I think so. :-)

What you can do is use two datagrids. One inside the other. In my example, I
have a grid (datagrid1) with customers in it. For each customer, I want to
display the orders for THAT customer.

Inside a "template column" in the customer grid, I have another grid
(datagrid2). The datasource for the Customers datagrid is the Customers
datatable in in my dataset. The datasource for the order grid, is a function
that returns the orders for THAT customer.

The HTML looks like this:

<asp:DataGrid id=DataGrid1 runat="server" DataSource="<%# ds %>"
DataMember="Customers" Height="88px" Width="376px"
AutoGenerateColumns="False">
<Columns>
<asp:BoundColumn DataField="CustomerID" SortExpression="CustomerID"
HeaderText="CustomerID"></asp:BoundColumn>
<asp:BoundColumn DataField="CompanyName" SortExpression="CompanyName"
HeaderText="CompanyName"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Orders">
<ItemTemplate>
<asp:DataGrid id=DataGrid2 runat="server" DataSource='<%#
getOrders(container.dataitem("CustomerID")) %>' AutoGenerateColumns="False">
<Columns>
<asp:BoundColumn DataField="OrderID" SortExpression="OrderID"
HeaderText="OrderID"></asp:BoundColumn>
<asp:BoundColumn DataField="OrderDate" SortExpression="OrderDate"
HeaderText="OrderDate"></asp:BoundColumn>
</Columns>
</asp:DataGrid>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>

The getOrders function is in my codebehind file. The codebehind contains two
functions: The Page_Load eventhandler, and the getOrders function. The
codebehind looks like this:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
daCustomers.Fill(ds, "Customers")
daOrders.Fill(ds, "Orders")
DataGrid1.DataBind()
End Sub

Public Function getOrders(ByVal custid As String) As DataRow()
Return ds.Orders.Select("CustomerID ='" & custid & "'")
End Function

Hope this can help you out.

Jeppe Jespersen
Nov 19 '05 #4
Thank you for your help! :-)
Now i know, how can i do this in VB.NET

But maybe there is more short and faster solution for this?
Maybe simple SQL query?
I thought about "TOP" function. But i cannot use it. (I don't know how).

Użytkownik "Jeppe Dige Jespersen" <jeppe.jespersen gmail.com> napisał w
wiadomości news:uy**************@TK2MSFTNGP15.phx.gbl...
Can someone help me?


I think so. :-)

What you can do is use two datagrids. One inside the other. In my example,
I
have a grid (datagrid1) with customers in it. For each customer, I want to
display the orders for THAT customer.

Inside a "template column" in the customer grid, I have another grid
(datagrid2). The datasource for the Customers datagrid is the Customers
datatable in in my dataset. The datasource for the order grid, is a
function
that returns the orders for THAT customer.

The HTML looks like this:

<asp:DataGrid id=DataGrid1 runat="server" DataSource="<%# ds %>"
DataMember="Customers" Height="88px" Width="376px"
AutoGenerateColumns="False">
<Columns>
<asp:BoundColumn DataField="CustomerID" SortExpression="CustomerID"
HeaderText="CustomerID"></asp:BoundColumn>
<asp:BoundColumn DataField="CompanyName" SortExpression="CompanyName"
HeaderText="CompanyName"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Orders">
<ItemTemplate>
<asp:DataGrid id=DataGrid2 runat="server" DataSource='<%#
getOrders(container.dataitem("CustomerID")) %>'
AutoGenerateColumns="False">
<Columns>
<asp:BoundColumn DataField="OrderID" SortExpression="OrderID"
HeaderText="OrderID"></asp:BoundColumn>
<asp:BoundColumn DataField="OrderDate" SortExpression="OrderDate"
HeaderText="OrderDate"></asp:BoundColumn>
</Columns>
</asp:DataGrid>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>

The getOrders function is in my codebehind file. The codebehind contains
two
functions: The Page_Load eventhandler, and the getOrders function. The
codebehind looks like this:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
daCustomers.Fill(ds, "Customers")
daOrders.Fill(ds, "Orders")
DataGrid1.DataBind()
End Sub

Public Function getOrders(ByVal custid As String) As DataRow()
Return ds.Orders.Select("CustomerID ='" & custid & "'")
End Function

Hope this can help you out.

Jeppe Jespersen

Nov 19 '05 #5
Did you try my suggestion? Can't be anything simplier...

Eliyahu

"Leszek" <ma***@zegarek.pl> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Thank you for your help! :-)
Now i know, how can i do this in VB.NET

But maybe there is more short and faster solution for this?
Maybe simple SQL query?
I thought about "TOP" function. But i cannot use it. (I don't know how).

Użytkownik "Jeppe Dige Jespersen" <jeppe.jespersen gmail.com> napisał w
wiadomości news:uy**************@TK2MSFTNGP15.phx.gbl...
Can someone help me?


I think so. :-)

What you can do is use two datagrids. One inside the other. In my example, I
have a grid (datagrid1) with customers in it. For each customer, I want to display the orders for THAT customer.

Inside a "template column" in the customer grid, I have another grid
(datagrid2). The datasource for the Customers datagrid is the Customers
datatable in in my dataset. The datasource for the order grid, is a
function
that returns the orders for THAT customer.

The HTML looks like this:

<asp:DataGrid id=DataGrid1 runat="server" DataSource="<%# ds %>"
DataMember="Customers" Height="88px" Width="376px"
AutoGenerateColumns="False">
<Columns>
<asp:BoundColumn DataField="CustomerID" SortExpression="CustomerID"
HeaderText="CustomerID"></asp:BoundColumn>
<asp:BoundColumn DataField="CompanyName" SortExpression="CompanyName" HeaderText="CompanyName"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Orders">
<ItemTemplate>
<asp:DataGrid id=DataGrid2 runat="server" DataSource='<%#
getOrders(container.dataitem("CustomerID")) %>'
AutoGenerateColumns="False">
<Columns>
<asp:BoundColumn DataField="OrderID" SortExpression="OrderID"
HeaderText="OrderID"></asp:BoundColumn>
<asp:BoundColumn DataField="OrderDate" SortExpression="OrderDate" HeaderText="OrderDate"></asp:BoundColumn>
</Columns>
</asp:DataGrid>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>

The getOrders function is in my codebehind file. The codebehind contains
two
functions: The Page_Load eventhandler, and the getOrders function. The
codebehind looks like this:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
daCustomers.Fill(ds, "Customers")
daOrders.Fill(ds, "Orders")
DataGrid1.DataBind()
End Sub

Public Function getOrders(ByVal custid As String) As DataRow()
Return ds.Orders.Select("CustomerID ='" & custid & "'")
End Function

Hope this can help you out.

Jeppe Jespersen


Nov 19 '05 #6
I'm changing you code.
I'm trying to asscociate your code with my webpage.

Użytkownik "Eliyahu Goldin" <re*************@monarchmed.com> napisał w
wiadomości news:el**************@TK2MSFTNGP15.phx.gbl...
Did you try my suggestion? Can't be anything simplier...

Eliyahu

"Leszek" <ma***@zegarek.pl> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Thank you for your help! :-)
Now i know, how can i do this in VB.NET

But maybe there is more short and faster solution for this?
Maybe simple SQL query?
I thought about "TOP" function. But i cannot use it. (I don't know how).

Użytkownik "Jeppe Dige Jespersen" <jeppe.jespersen gmail.com> napisał w
wiadomości news:uy**************@TK2MSFTNGP15.phx.gbl...
>> Can someone help me?
>
> I think so. :-)
>
> What you can do is use two datagrids. One inside the other. In my example, > I
> have a grid (datagrid1) with customers in it. For each customer, I want to > display the orders for THAT customer.
>
> Inside a "template column" in the customer grid, I have another grid
> (datagrid2). The datasource for the Customers datagrid is the Customers
> datatable in in my dataset. The datasource for the order grid, is a
> function
> that returns the orders for THAT customer.
>
> The HTML looks like this:
>
> <asp:DataGrid id=DataGrid1 runat="server" DataSource="<%# ds %>"
> DataMember="Customers" Height="88px" Width="376px"
> AutoGenerateColumns="False">
> <Columns>
> <asp:BoundColumn DataField="CustomerID" SortExpression="CustomerID"
> HeaderText="CustomerID"></asp:BoundColumn>
> <asp:BoundColumn DataField="CompanyName" SortExpression="CompanyName" > HeaderText="CompanyName"></asp:BoundColumn>
> <asp:TemplateColumn HeaderText="Orders">
> <ItemTemplate>
> <asp:DataGrid id=DataGrid2 runat="server" DataSource='<%#
> getOrders(container.dataitem("CustomerID")) %>'
> AutoGenerateColumns="False">
> <Columns>
> <asp:BoundColumn DataField="OrderID" SortExpression="OrderID"
> HeaderText="OrderID"></asp:BoundColumn>
> <asp:BoundColumn DataField="OrderDate" SortExpression="OrderDate" > HeaderText="OrderDate"></asp:BoundColumn>
> </Columns>
> </asp:DataGrid>
> </ItemTemplate>
> </asp:TemplateColumn>
> </Columns>
> </asp:DataGrid>
>
> The getOrders function is in my codebehind file. The codebehind
> contains
> two
> functions: The Page_Load eventhandler, and the getOrders function. The
> codebehind looks like this:
>
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> daCustomers.Fill(ds, "Customers")
> daOrders.Fill(ds, "Orders")
> DataGrid1.DataBind()
> End Sub
>
> Public Function getOrders(ByVal custid As String) As DataRow()
> Return ds.Orders.Select("CustomerID ='" & custid & "'")
> End Function
>
> Hope this can help you out.
>
> Jeppe Jespersen
>
>



Nov 19 '05 #7

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

Similar topics

10
by: DettCom | last post by:
Hello, I would like to be able to display or hide fields based on whether a specific Yes/No radio button is selected. This is in conjunction with a posting a just made here in the same group...
19
by: dmiller23462 | last post by:
Hi guys....I have absolutely NO IDEA what I'm doing with Javascript but my end result is I need two text boxes to stay hidden until a particular option is selected....I've cobbled together the...
16
by: Jace Benson | last post by:
Ok I have read alot of things on zend.com, php.net and other sites went to the wikibooks to try to understand how to use a class. I have this project I want to do that I am sure would work great...
1
by: rbinington | last post by:
Hi, I am trying to write a DNN module that has the ability to insert articles into an article repository. I want the users to be able to move pages around and enter text into the FCKEditor. I...
4
by: Dave | last post by:
TIA for the help.....this should be easy for a pro....I need the two divs with text to display on the same line at the top of the container..??? <html> <head> <style> body...
2
by: HarisHohkl | last post by:
Hi, I've this function in a class to update the total value.but when i try to remove the these row highlight in Bold it crash, what should i do???? void display_total_value() { double...
3
by: remya1000 | last post by:
i'm using ASP with MSAccess as database. i have two buttons and two textbox in my page. when i press my first button (First month) i need to display the current month in one textbox and last one...
2
by: mervyntracy | last post by:
Hi There, I have recently started coding in asp.net (just 2 and a half days now). I am writing a simple test app that gets data from a data base and displays the value perfectly in the drop down...
7
by: khinester | last post by:
Hello, I have the following template that basically does the following: User select Country, then a sub-list is generated with Regions and then this returns the Counties ############### ...
2
by: wreed06 | last post by:
Hello, I have 2 problems. In my webpage, I have a dropdown list with a button that takes the user to a popup window specific to the option. I am using Firefox 2.0.0.13. I have successfully...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.