How to add values to DataGrid row by row

How do I add values to a DataGrid row by row without using a DataSource? Is this possible? Or should I just use a table?
my code works like this:
BoundColumn Col1
Add Col1 to DataGrid1
for every str in stringarray
Add New Row DataGrid1 with Col1 = str
2/26/2005 9:47:18 PM 72751 articles. 3 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 10

may be following URLwill help you
2/27/2005 2:29:16 PM
Well, DataGrid was found not to make you do it the old way as in ASP 3.0.

You can still get a datasource like datatable and then loop in it and display all the data row by row, is this what you want ?
Bilal Hadiar, MCP, MCTS, MCPD, MCT
Microsoft MVP - Telerik MVP
2/27/2005 2:45:15 PM

Similar Artilces:

select the row of the datagrid whose value is same as one of the value of row of datagrid
hellow all,  I have a datagrid which is bound to the ordertable,so all the orderdetails are shown on the page load. but my requirement is that,i have a textbox and a search button,when the user enter the order number in the text box and click on the search button the datagrid should show that record whose order number is entered by the user n most imp that the record may be in the 65th or 34th row of the datagrid,i wants to put it in the first row. how to do it. If there's a reason you can't filter down to just the one row, you'll have to come up with some paging algorithm that wil...

Add new controls to a gridview row; when editing that row using the edit row feature in the gridview control.
Hi all  I have a questions that looks hard / complex to me, and i know you can help me in this. Q {  I have row in a Gridview and i have an edit option to it. I press the edit button, to edit the values in that row and update data all the way back to the database. Now when i press the edit button, i want a drop down list to be displayed that contain values for a particular field in my grid view. (for now only plain text boxes appear.) } I hope you understand my question, all i need to do is replace the text box controls with a dropdown list when i am editing a row in ...

How do I add a blank row between each row in my DataGrid???
Hi I have got the following datagrid....But I want to add a blank row(that divides each row with some background color)....My datagrid is <Asp:datagrid Allowpaging="true" Page-Index="5"> <columns> <asp:TemplateColumn> <ItemTemplate> <Img src="sam.gif" width="200" height="150" /> </ItemTemplate> </asp:TemplateColumn> <asp:TemplateColumn> <ItemTemplate> <table> <tr><td><%#Container.DataItem("ID")%></td></tr> ...

DataGrid: Insert a new row value in footer based on the selected row value
Hi guys         I need immediate help with the datagrid taht I am making. I have about 9 rows and with edit template item and a footer template for the new row that can be inserted in the db.   When someone hits the insert link in a row in the datagrid say its row 2 with OrgId = 10, I was the new row that comes as a footer row for the insert to populate orgId 10, leving the rest of the colums emtry for the user to fill in. But one column of this new row I want it to be populated with the value that was selected upon htting insert. I hope I didnt c...

Add row in datagrid from other controls
Hello all, I am using the VS.2003.I would like to add a row in a datagrid, the data will come from other controls. I am having 2 textboxes (name, surname), 1 dropdownlist (sex) and a datagrid. I want to enter some values into these controls and when i am pressing a button (add) to insert them into datagrid row (the columns are also: name, surname and sex).The other issue is that i should add the ability of editing the values in the datagrid by pressing "Edit" button (it exists in each datagrid row). And the datagrid columns will have to be also 2 textboxes and 1 dropdownlist (jus...

How to add dynamic row in between 2 existing rows in datagrid?
Is this possible to add dynamic rows in middle of the rows in datagrid?I want to find net total like thisPNo   SNo  status  day1  day 2  day3001     S01   Pack   10     30      20                    Used   05     01      20001     S02   Pack   20     10 ...

Add row to table with table.row.add()
Everytime I click on a button I want to add a tableRow to a table like this:        TextBox TB = new TextBox();                TableCell Cell = new TableCell();        Cell.Controls.Add(TB);        TableRow Row = new TableRow();        Row.Cells.Add(Cell);        table.Rows.Add(Row);It works the first time, but when I click the button again the last r...

how to compare rows in the datatable and remove the duplicate rows (before removal of duplicate row i need to append those values to original rows)
Hii.             I have a datatable in that i have some rows.. i need to compare those rows one among the other based on first column only. If its duplicate row i need to append those col values to original row. For example here is the data in the table.: Total - 13 columns Name:     Jan:   Feb:   March:...............................Dec  Phani      2        4          ...

Referencing BoundField Datafield values of Datagrid row when button on same row is selected????
Given the Gridview below: When I select the button "Rate" and fall into this code: How can I reference "carriercode" and other . Apparently selecting the button does not select the row. I've tried find control, and everything returns that I must reference and instance of the object.  CommandArgument is being sent corrently. If the button were a buttonfield I would have no problem getting the row index, but Im having problems because the button is an runat server button. snip...  Protected Sub PendingGridView_RowCommand(ByVal sender As Object, By...

Modify control values in row of Datagrid during edit
Hi! I have a datagrid, in which the first column holds a dropdownlist (during an edit). I would like to be able to modify the contents of the other columns based on what a user selects in the dropdownlist. So far I have set the "OnSelectedIndexChanged" event to a procedure called "ChangeDefaultValues" as follows: <EditItemTemplate> <asp:dropdownlist DataSource='<%# dsCurrentLocation.DefaultView %>' DataTextField="CurrentLocation" DataValueField = "CurrentLocation" ID="CurrentLocation" runat="server" OnS...

Dynamically add rows in the datagrid ..and enable view state in the previous rows, coloumns
Dear Developers, I have the datagrid below the structure.. ---------------------------------------------------------------------------------------------------------- Column1 Column2 Column3 Column4 Column5 ----------------------------------------------------------------------------------------------------------- dropdown1 dropdown2 dropdown 3 texbox nextbutton ----------------------------------------------------------------------------------------------------------- For my requirement .. i am sor...

add new row in datagrid, save all rows with just one trip to the server
I used a datagrid in my web app that can add a row dynamically. I added textboxes and radiobutton in the footer as the entry for new rows. Now, I want this new row to be added without posting back to the server then save them in the database with just one trip to the server. How will I do that? Hi, what do you exactly want? When I look at this sentence: this new row to be added without posting back to the server then save them in the database with just one trip to the server it becomes quite mystified to me. You can't add something to the database without a postback (or roundt...

New row in datagrid: Old values are overwritten instead of a new row appears
First post from a not so experienced VS.NET/VB programmer I am writing a short piece of code that allows users of the program to enter some data in textboxes and then by clicking on a button, allow them to add the information they put in the textboxes to a datagrid. The first time they press this button, it shows perfectly in the datagrid on the form, but the 2nd time it only updates the first row instead of adding a new row.By doing some searches on Google, I found out that I am not using the right code, but I can't find how to do it correctly. I hope to get an answer here.Below you see...

How to make template control invisible based on another col value (row by row)
In a gridview, I have a template like the following: <EditItemTemplate> <asp:DropDownList ID="ddl1" selectedValue='<%# Bind("id_hill_confidence") %>' ...> <asp:TextBox Runat="server" Text='<%# Bind("crit_variance") %>' ID="TextBox1" </EditItemTemplate> I want to check another value in the row (crit_show) and if it is 1 or true, I want tl make TextBox1.visible=true, otherwise I want to make it false (invisible). How can I do this on a row by row basis. I know how ...

Web resources about - How to add values to DataGrid row by row -

Want to preview our new DataGrid for Xamarin.Forms?
tl;dr Zumero.DataGrid is a Xamarin.Forms control for displaying data in rows and columns. If you would be interested in testing and previewing ...

Mad King DataGrid
This post is about scrolling in WPF and the egocentric DataGrid control. I’ll give the project background but if all you’re interested in is ...

Stack Overflow
Stack Exchange log in - careers - chat - meta - about - faq Questions Tags Users Badges Unanswered Ask Question Top Questions interesting 295 ...

Microsoft Silverlight - Wikipedia, the free encyclopedia
Microsoft Silverlight is an application framework for writing and running rich Internet applications , with features and purposes similar to ...

Flash Builder Plug-in for SAP Netweaver Gateway - Adobe Labs
Search Navigation Labs Home Wiki Home Technologies Alchemy Blueprint Camera Profiles and DNG Profile Editor Cirrus ColdFusion 10 DNG Codec Fireworks ...

Casaba Security » Products » X5s Testing Tool For Finding XSS Vulnerabilities
Security analysis, consulting, development and testing partners who understand your business strategy.

CodeGuru - Microsoft developers related ideas, articles, tips, tricks, comments, downloads, and so much ...
CodeGuru is where developers can come to share ideas, articles, questions, answers, tips, tricks, comments, downloads, and so much more related ...

Caliburn Micro: WPF, Silverlight, WP7 and WinRT/Metro made easy.
A small, yet powerful framework designed for WPF, Silverlight and WP7. It implements a variety of UI patterns for solving real-world problems. ...

Quick Answers - CodeProject
Questions - Free source code and tutorials for Software developers and Architects.; Updated: 11 Jul 2012 11636: first draft of license proliferation committee report
FYI,the first draft report of the OSI's License Proliferation Committee.To join the OSI's license proliferation discuss email list, send anemail ...

Resources last updated: 11/26/2015 4:22:15 AM