473,834 Members | 1,939 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is two datagrid headers possible? One for sorting, one to add seperate link button.

I have a datagrid with sorting enabled. When clickong on the colum
names in the header the datagrid is sorted no problem. Unfortunatly, I
have a graph that needs to be generated for each colum as well. I'd
like to have an additonal header at the top of the datagrid that has
an imagebutton for each colum that would generate the graph.

I've successfully created the second header and programatically added
the imagebutton to the second header. The only proble is that when the
"generate graph" image buttons are clicked, they perfrom the sort
rather than fire my drawGraph event handler. Anybody see what's wrong
with my code? I've been trying to get this right for two days.



'############## ############### ############### #####

Private Sub MyDatagrid_PreR ender(ByVal sender As Object, ByVal e
As System.EventArg s) Handles MyDatagrid.PreR ender

Dim cmdOne As New ImageButton
cmdOne.ImageUrl = "graph.gif"
cmdOne.Attribut es.Add("runat", "server")
cmdOne.Attribut es.Add("id", "ImageButto n1")
cmdOne.Attribut es.Add("OnComma nd", "ImageButton1_C lick")
cmdOne.Attribut es.Add("Command Name", "Click")

Dim dgitem As New DataGridItem(0, 0, ListItemType.He ader)

Dim mycell As New TableCell
mycell.Text = ""
mycell.Controls .Add(cmdOne)
dgitem.Cells.Ad d(mycell)

Dim mycell1 As New TableCell
mycell1.Text = "Two"
dgitem.Cells.Ad d(mycell1)

Dim mycell2 As New TableCell
mycell2.Text = "Three"
dgitem.Cells.Ad d(mycell2)

MyDatagrid.Cont rols(0).Control s.AddAt(0, dgitem)

End Sub

Sub ImageButton1_Cl ick(ByVal sender As Object, ByVal e As
CommandEventArg s)

'this is where the graph is rendered.

End Sub
Nov 18 '05 #1
0 1246

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

Similar topics

by: Rudolph Araujo | last post by:
Hi, I needed to build a data grid in which the first column has hyperlinks rather than simple text. I found the following code on this newsgroup and it works fine except for one problem. When I click the column headers all the columns sort except the hyperlink one. I checked the underlying dataview and that does get sorted so it seems like it is more of a display issue. I am guessing it has something to do with the hashtable used by the...
by: Craig Banks | last post by:
If a row of data in a dataset has a lot of columns the row displaying the data in a datagrid will run way off the screen. What I'd like to do is display a row of data over several datagrid rows so the user doesn't have to scroll horizontally. Essentially, I want to wrap a datagrid row (not text in individual columns) with as much control as possible. Make sense? While this seems simple enough on the surface, I can't figure out how to do...
by: rkbnair | last post by:
I have created a datagrid in my aspx with the 'AllowSorting' property to true. When clicking on the column header, the page refreshes. However the sorting is not done. Am I missing anything? I populate the data if !postback.
by: Lars Netzel | last post by:
I have a Datagrid using the Edit/Update mode to alter data in the datasource. I needed to have a bit more flexible interface in the editmode with a design that couldn't work in the columns. So I fixed this by only having ONE template column (plus the edit button column) and then have html tables in both the header and the edit items to have complete control over the design. This works fine. Now my boss wants Sorting in the column...
by: Sun | last post by:
Hi I had a sortable datagrid and it worked fine when I clicked the headers. Then I introduced 2 textboxes and a button, so I can pull data based on user input. The data came out fine but the datagrid failed to perform any sorting function. I got an error on the browser saying "Object does not support this property or method". If I commented out the button, the datagrid could perform the sorting function again. Is there a compatibility...
by: skOOb33 | last post by:
I successfully autosized the columns and rows on my Datagrid, and am now facing another issue. Having the sorting ability by clicking the column headers is key, but when I do that, it resizes all my rows back to their defaults. I populate the datagrid, resize it accordingly and it works fine...just when I click the headers is when it messes up. It would be fine if I could run my autosizing again after the sorting is done since there...
by: Mike Gorgone | last post by:
Hi All, I'm currently trying to show a datagrid with a parent and child table realtionship. I've got the expansion icon (+) in the row headers and when I click on it I see the link to the child table. However if I click on the child table link I get the child data but there is no "Show/Hide parent rows" icon and there is no back button to take me back to the original parent grid where I clicked on the link to open the child grid. Am I...
by: Gidi | last post by:
Hi, I've a dataGrid, and When I click with the mouse on one of it's header the DataGrid_Click event is called. I don't have problem with the event, but strange things happen to the dataGrid after I click on one of the headers. I have DataSet that bounded to this DataGrid so i could write into the dataGrid, but when i click on the headers new rows are suddenly added, sometime as a first row, sometimes between two exsisting rows. I change...
by: rn5a | last post by:
A DataGrid has the following TemplateColumn: <asp:DataGrid ID="dgCart"...OnSortCommand="SortGrid" AllowSorting="true"....> <Column> <asp:TemplateColumn HeaderImageUrl="Images\Up.gif" HeaderText="ID" SortExpression="PID"> <ItemTemplate> <asp:Label ID="lblPID" Text=<%# Container.DataItem("PID") %> runat="server"/>
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...
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...
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,...
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...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Duprť who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
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();...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
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
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.