ASP.NET Dynamic Table - 116872

Hi All,

Am using VS2010 with Framework 4.0 in VB.NET

I have a table which I wish to create on page load which isn't
database driven

I can create the table single column using new LinkLabel controls but
I wish to have the links in 3 or 4 columns, not just one. Example

At the moment:

LinkLabel1
LinkLabel2
LinkLabel3
LinkLabel4
LinkLabel4
LinkLabel6
....

Would like them:

LinkLabel1                LinkLabel2                  LinkLabel3
LinkLabel4                LinkLabel5                  LinkLabel6
....

This is the code I have so far, taken from an example & changed for my
requirements:

    Private Sub CreateRootTable()
        PlaceHolder1.Controls.Clear()

        Dim tblRows As Integer = 60
        Dim tblCols As Integer = 1 ' Changing to 3 just repeats the
same link 3 times
        Dim tbl As Table = New Table()
        PlaceHolder1.Controls.Add(tbl)
        For i As Integer = 0 To tblRows - 1
            Dim tr As TableRow = New TableRow()
            For j As Integer = 0 To tblCols - 1
                Dim tc As TableCell = New TableCell()
                Dim hl As HyperLink = New HyperLink()
                hl.Text = "Some Text Here " & (i + 1)
                hl.ToolTip = "Click here to download"
                hl.NavigateUrl = "/URL HERE"
                hl.Font.Underline = False
                hl.Font.Size = FontUnit.Medium
                ' hl.Target = "_self"
                tc.Controls.Add(hl)
                tr.Cells.Add(tc)
            Next j
            tbl.Rows.Add(tr)
        Next i

        ViewState("dynamictable") = True
    End Sub

Changing the column variable to 3 just does the following

LinkLabel1 LinkLabel1 LinkLabel1
LinkLabel2 LinkLabel2 LinkLabel2
LinkLabel3 LinkLabel3 LinkLabel3
LinkLabel4 LinkLabel4 LinkLabel4
LinkLabel5 LinkLabel5 LinkLabel5
LinkLabel6 LinkLabel6 LinkLabel6

When I am looking to centre them and space them equally on screen like
so:

                         LinkLabel1
LinkLabel2                            LinkLabel3
                         LinkLabel4
LinkLabel5                            LinkLabel6

Please help

Thanks in advance
0
D
9/19/2010 12:14:13 PM
dotnet.framework.aspnet 1425 articles. 0 followers. Follow

0 Replies
921 Views

Similar Articles

[PageSpeed] 56

Reply:

Similar Artilces:

Linking to Access Table
Hi. I have a Excel workbook with 12 worksheets. I want to be able to retrieve data stored in an Access table and import that data into the last worksheet. Is there a code that will enable a permanent link and refresh each time I open the Excel workbook. Thanks R u using excel 2007 or other version On Nov 19, 8:29=A0am, will07 <wil...@discussions.microsoft.com> wrote: > Hi. =A0I have a Excel workbook with 12 worksheets. =A0I want to be able t= o > retrieve data stored in an Access table and import that data into the las= t > worksheet. Is there a code that ...

ASP to ASP.NET --- XMLHTTP error--XML document must have a top level element
Hi i am converting an ASP page to ASP.NET. The original ASP code works perfectly but in ASP.NET i am getting the error "XML document must have a top level element." I have checked the XML being sent and it looks exactly the same as the live (working version). The back end code has not changed at all. The client side code is as follows: Dim xmlhttp, WISERServer WISERServer = "JK-VM1/production/Pages/XML.asp" xmlhttp = CreateObject("MSXML2.XmlHttp.4.0") xmlhttp.open("GET", WISERServer, False) xmlhttp.setReques...

Vertical templates for Microsoft Dynamics CRM (any experience )
anyone has experience in "Vertical templates for Microsoft Dynamics CRM" ? if it works in proper manner? I have noticed : 1 =) They have changed "Service " area to Customer service and added some more entities (return authorization , correction actions....) Whenever you click any entity ,there is error (object reference not set an instance of an object". 2=) Operation support area has been added . where employee entity is same as contact. I was thinking if internal employees have parent customer ? 3= ) in Distribution Mgmt , Distribution Portal is not working . ...

Sending mail from an ASP webpage
Hi all, We have just converted to Windows SBS2003 with Exchange 2003. Our intranet and a few other internal webbased systems used to rely on CDO Mail to send emails via these webpages (be they webmail type pages or alerts etc). We were running a Win2K server before hand and were able to use the Default SMTP Virtual Server to send our mail with. Now that we have upgraded, it has changed somewhat and it appears to no longer operate in the same fashion. IIS is considerably different (which i'm slowly getting the hang of) and we now use exchange as our mail server. How do we set this new m...

vb.net Datagridview RowValidating
Greetings, The code below never sets the current cell to the error location, allowing user to correct the mistake (see below), though does display the error message. This is activated when they press tab to leave the row (RowValidating) and the next row is populated with values from DefaultValuesNeeded I was wondering where my logic and code have failed me, instead of setting the focus to the cell containing the error it moves to the next row with the default values set but the error logo and text displayed? Thanks Rob 'Validation for day of weekends Select Case Dir...

Can't find IV
I have an Excel schedule that I can import data from GP V9 using table IV00500, "QTY Avail" field. I used this worksheet weekly for our production schedule and it worked wonderfully until I upgraded to V10 SP3 last week. Now, table IV00500 does not exist and I can't find the QTY Avail field in any other table. Does anybody know which tables I can find this field? I found the QTY On Hand field but I need the QTY Avail field. Help! -- MCEng MC, I did a search for the field and it appears in 10.0 that it is included only in temp tables. Makes sense since QTY Available i...

Records dissapear from table
Dear All, Something strange happen with me , the records of cashier table disappear suddenly for the first time we thought that somebody might deleted them although its not shown in RecordDeleted table, when we insert new records the ID field takes number 1 which means nobody touch the table it just disappear. This is not the first time it happens with me for physical inventory records also, the records disappear after inserted from InventoryTransferLog while its exist in PhysicalInventory (Header & Detail). Please advise me to find the reason why this happen, it's really scare...

Version Control with Dynamics.vba
Does anyone have a good system for version control with dynamics vba programming? I have had problems with dynamics.vba becoming corrupted in the past - I lost work each and every time. It was suggested to me that Sourcesafe, ironically, was the culprit. I don't know for certain that that was the case. At any rate, Dynamics.vba, Forms.dic, Reports.dic, .frxs and ..frms all need to be under version control. Any recommendations or comments would be appreciated. ...

.NET Framework 1.1 Service Pack 1 Security Update
Hi I am unable to install the .NET Framework 1.1 Service Pack 1 Security Update - error code 0x643 (tried dozens of times). I have found a resolution on the MS site but it does not show me where to find .NET Framework version 2.0 SP2, version 3.0 SP2 or version 3.5 SP1 which I will need to reinstall after deleting the originals and running the cleanup utility. Any ideas? Search this newsgroup for "643." -- "Don't pick a fight with an old man. If he is too old to fight, he'll just kill you." "Mac 33" <Mac33@discussions.mic...

having a table in excel
How do I have a drop down list in a cell of a bunch of items and when you select on of the items in the drop down it will fill in the whole row and columns for that item. For example: Item Description Price Qty So when you select the item in column A it will fill in the Description, price and the quantity. Thanks Hi ashaback, I have a tutorial on how to do this here http://edferrero.m6.net/DataTutor01.shtml Ed Ferrero http://edferrero.m6.net/ > How do I have a drop down list in a cell of a bunch of items and when you > select on of the items in the d...

SQL connection management in ASP.Net
hi, I have to create a small website in ASP.Net 2.0. I have question about working with SQL connections. What are the best practises? How and where to create and store a connection? I see a few possibilities: - create, open/close a connection on each web page - create a connection on login page and store it on Session - how to create a connection? ie. SqlConnection = new SqlConnection or System.Data.Common.DbProviderFactory factory = System.Data.Common.DbProviderFactories.GetFactory("System.Data.SqlClient"); System.Data.Common.DbConnection conn = factory.Crea...

Programming in .ASP
the variables in the URL are populate above and are valid. when I send the email to myself or other local developers, no issue, the URL is correct, however, sometimes when sent to customers, the url will read: http://www.someurl.com/?name=Me&location=there&em%0D%0A%20ail=test@someurl.com&hash=ABCABC123 where does the %0D%0A%20 come from, what adds that to the url, which obviously makes it invalid and doesn't work for the customer. Any ideas would be great. iConf = Server.CreateObject("CDO.Configuration") iConf.Fields.item("http...

Charts from Pivot Table
I have a Pivot Table in Excel 2002 that has Budget and Actual columns, Months in the rows with a corresponding Budget and Actual, this repeats for each item in the row multiple (10-30) times down the table, each set of items is sub totaled in a row (10 - 20 subtotals) and then each sub total is totaled in a row, etc. 7000+ rows of data. I would like to graph each item and show a budget and actual line. I would also like to graph each item showing a cum budget and cum actual line. I hope to graph 'user' selected items, sub totals, totals. Thoughts? Suggested approach? I plan to...

Cannot Clean Up ActivityBase Table
Is there a fix for this yet? I would hate to have to clean up the database everyday? TechKnowledge Microsoft CRM Deletion Service Failure Error "Cannot Clean Up ActivityBase Table" Appears in the Application Event Log on the Microsoft CRM Server Printable Link Email this link Document ID: 30380 Date Created: 4/24/2003 Date Last Modified: 6/18/2003 10:39:47 AM Language: English - United States Country: USA Product: Microsoft CRM Versions: 1.0 Modules: Microsoft CRM Miscellaneous Issue Microsoft CRM Deletion Service failure error - "Cannot clean up ActivityBase table."...

sorting pivot table by sorts by "show value as"
Hello, Excel 2007. In my pivot table I have, in the value area, a quantity that has the value field settings: *Summarize value field by: Count *Show values as: % of row The only problem is when I try to sort the pivot table by value, it sorts by Count rather than the displayed % of row. I would rather it sorted by the displayed % of row value. Anyone know how to do this? cheers Vin Hi, Just a little more information. I think this must be a bug because the Summary section at the bottom of the sort dialog box suggests that it will sort the list by the displayed '% of row' valu...

Pivot Table not showing subtotals
In the simple example below, when doing a pivot table, one of the A's and B's are missing and the subtotals and grand total is missing. Item Amount A $1.00 A $1.00 A $1.00 B $2.00 B $2.00 B $2.00 To show the Grand Total, right-click on a cell in the Pivot Table, and choose Table Options. Add a check mark to 'Grand totals for columns. You shouldn't need subtotals, since there would be only one row for A and one row for B. Glenn wrote: > In the simple example below, when doing a pivot table, one of the A's and B's > are missing and the subtotals and grand t...

FREE .NET EBOOKS , DOTNET TUTORIALS, CODE SNIPPETS
Visit this site u will find good .Net ebooks, .Net source code, .net tutorials and lots more for vb.net, c#.net, asp.net and other dotnet stuff. URL: www.DotNetGuide.net I don't like the site because 1) There are 3 sets of adverts on each page 2) The page is fixed with, which is very annoying. I am reading on a wide-screen laptop but find I am limited to approximately 60 characters per line, I can't read articles like that! Pete ...

xml DTD visual stdio .net 2k3 autocomplete
Hello, I'm using visual studio .net 2k3 to work with Xml intensive integration App. When I using XML /XSD based documents I get autocomplete feature but not when I use Xml /Dtd based. Somebody know How work around Thansk Alejandro P. ? <alejandropacheco@hotmail.com> wrote in message news:esj0OEWYEHA.2972@TK2MSFTNGP12.phx.gbl... > Hello, > > I'm using visual studio .net 2k3 to work with Xml intensive integration > App. When I using XML /XSD based documents I get autocomplete feature but > not when I use Xml /Dtd based. Somebody know How work around > >...

Creating a dynamic chart
I posted here a few days ago and was given some ideas on how to do this. However, I seem lost. I have a main worksheet which is updated from several worksheets by using code. On this worksheet is approximately 15-20 columns something like this. trimester year RW RW% WIW WIW% etc 1st 2001 80 89% 79 75% 2nd 2001 90 89% 84 87% 3rd 2001 87 88% 92 89% 1st 2002 88 88% 90 88% etc etc What I would like to do is create one chart and by selecting the title of the column from either a combo box or by using a bu...

ASP.Net
Hi, I have a few questions about ASP.Net, as I've been using it for a while but my knowledge of the "big picture" is patchy in some areas. Any help would be appreciated... - Where is the line between "native" language features (e.g. in JScript), and those features which are part of .Net (or whatever), common to all .Net languages? Or put another way, how are the .Net facilities "mapped" onto a particular language? (I'm sorry of this question is somewhat vague...) - In a closely-related matter, do any languages have issues accessing the full A...

Dynamics Workflow windows in Dynamics
Hi there I have installed Dynamics Workflow for Dynamics version 10 successfully. I have created a simple Purchase Order workflow. I have clicked the Activate Workflow button in this company. However when the users capture a Purchase Order it does not have the additional workflow compnonents on the Purchase Order window e.g. Submit etc. I have logged out and back in again. What am I missing? Regards Robin The workflow functionality in GP 10 requires the deployment of MOSS 2007 (Enterprise Edition). Not a trivial thing. "Robinv" wrote: > Hi there > > I have ...

Dynamic Information in Templates
I would like to create a template with textboxes whose contents would be filled with the Personal Information of the user that is creating the document. If I use Insert->Personal Information in the template, the same text stays no matter who opens. Does anyone know how to make it change for each user? ...

VB.net
Hi, I am trying to update a field in a record of a Access Database (whose structure I can not modify). I got this error (translated from italian): "Data types do not match in the expression" = "Tipi di dati non corrispondenti nell'espressione criterio." The code is the following: (myField is a binary field as on Access 2007) 'determine new value Dim newValue() As Byte = ... (valid data) 'write new attributes Dim conn As OleDbConnection = myObj.getConnection Dim cmd As OleDbComman...

Piviot table help
I dont know why its doing this but i have a set of feilds that run horizontaly on my piviot table and it will not put them in numberical order. It will go 11, 12, 13, then 2, 3, ect. i wanna know how to get the feild to run numberically. Each number is proceded by a word that represents what the number means. Across the top of my table is says : 11 Consumption - 12 Pallets - 13 OTher - 2 contract date - 3 BOM. I want them to go across like 2 contract date - 3 BOM - 11 Consumption - 12 Pallets - 13 OTher thanks -- Message posted via http://www.officekb.com Because you have text in...

update a table from a form
HELP!!!!! OK, I have an parts inventory database that when the maintenance people need a part, they look up the part and they need to enter a qty that they took. There are also fields that show how many were ordered, received. I have the form set up so that the QtyAvail = [qtyreceived]-[qtyused] and that works fine.....once. I know we shouldn't store calc data in a table, but how can I keep a running total of my inventory and also be able to run a report showing all my parts, their qty's, etc... I'm desperate! Are there any good inventory templates out there? Thanks, Bill R....