Can We add Data Rows To GridView With out Dataset ot Table

We can Add new rows to Grid dynamically in windows application by coding add new row(n)

can we do like that in GridView or any other data provider?

Presently I am adding Row only by genarating Dataset or Datatable 

can any one help me
0
bala2it4u
12/31/2007 1:35:58 PM
asp.net.presentation-controls 72751 articles. 1 followers. Follow

3 Replies
149 Views

Similar Articles

[PageSpeed] 20

Anything that implements IDatasource (http://msdn2.microsoft.com/en-us/library/system.web.ui.idatasource.aspx) can be bound as the datasource for a databoundcontrol (http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.databoundcontrol.aspx).  I think you can even use a generic list of objects so long as their properties are available.  Did you say windows application? 


Please mark as answered if I helped.
I don't answer personal emails unless I know you or of you. Feel free to post in the forum to get an answer from me.
0
jose_jimenez
12/31/2007 2:47:33 PM
No, by design the asp.net grid gets populated only from its datasource. As the other poster noted, the datasource doesn't have to be a dataset or a table.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
 
 
<bala2it4u> wrote in message news:2083665@forums.asp.net...
We can Add new rows to Grid dynamically in windows application by coding add new row(n) can we do like that in GridView or any other data provider? Presently I am adding Row only by genarating Dataset or Datatable can any one help me

http://forums.asp.net/p/1199555/2083665.aspx#2083665


Eliyahu Goldin,
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
0
Eliyahu
12/31/2007 3:39:29 PM

Hi:

  Yes you can add row to GridView. For example, add this in GridView's PreRender event handler:

  Dim fields As TableCellCollection = GridView1.Rows(0).Cells
        Dim headerCell As TableCell = New TableCell()

        headerCell.ColumnSpan = fields.Count
        headerCell.Text = "ABC"
        headerCell.HorizontalAlign = HorizontalAlign.Center

        Dim rowHeader As GridViewRow = New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal)
        rowHeader.Cells.Add(headerCell)


        GridView1.Controls(0).Controls.AddAt(0, rowHeader)

 

  If your problem isn't solved please inform us and feel free to mark my post as not answer.

Regards


Sincerely,
Allen Chen
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
0
Allen
1/4/2008 6:09:36 AM
Reply:

Similar Artilces:

Data Controls insert rows into gridview then insert rows from gridview into SQL Table
Hello there, I'm still new at performing miracles with code . Currently I am having trouble with my latest coding adventure I have a web application which records jobs and labour assigned to jobs. The issue in particular I'm having is the way in which labour is to be assigned. I want to use standard controls (Textbox, Dropdownlist) to record the values into a gridview (ie,put multiple rows into the gridview using the controls). Then, when all the inserting is complete, the user clicks a submit button to insert all the rows from the gridview into a database table. The reason for...

ADO.net problem: i can not view image data for the rest of my table rows except the image for the first row but i can read all the other non image fields for all rows.
Hi i have a table with the following fields imgid............int imgdata........image imgtitle.........varchar(max) imgType........varchar(max) imgLength.....bigint incident_id.....int i have no problem with uploading the image but viewing the uploaded image(s) in a gridview has caused me great pain. The probelm is i have two pages. page1 grabs the image to display and page2 has a gridview that displays the grabed image. I wanted to have an sql statement like SELECT * FROM mytable WHERE incident_id=someValue. IF i have 5 records in this table and i view page2 ...

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 ...

Is there a free table control by which can edit data,add row and and columns simply?
Is there a free table control for ASP.Net written with C#, so I can use it to edit data,add row and and columns simply? Thanks!  SuperCool Multiple ZIP - A utility to unzip multiple files and work with multiple zip filesSuperCool Random Number Generator could anyone  help me?SuperCool Multiple ZIP - A utility to unzip multiple files and work with multiple zip filesSuperCool Random Number Generator Could you help me?SuperCool Multiple ZIP - A utility to unzip multiple files and work with multiple zip filesSuperCool Random Number Generator Sure, sorry about the delay...

add data from multiple rows in table to one row in gridview
 heya is there any way of adding data from multiple rows in table to one row in gridview. eg. ipc                 column 1 ,            2 ,                       3,                 4  1,    11111                 33                  &nbs...

How to add the data present in the controls to a table control without any database involvement.
Hi All,i am four controls where i will write the text and once i click the add button those should get added to the table .i want 6 columns fixed in the table and rows as many as required.i tried doing that taking a table server control and able to load the table.but the problem is whenver i am adding a new row the old one is gfetting overwritten by this and at the end i am getting only one row.  System.Web.UI.WebControls.Table t1 = new System.Web.UI.WebControls.Table();  i have declared the below one global TableRow tr; TableCell tc1; TableCell tc2; TableCell tc...

How to add multiply Gridview control to the table cell when the gridview dynamically bind the data
Hello:  I add four gridview in the table cell in the design mood. I use databind for each of gridview, but only first gridview showed up after running the code. What am I missing here?   Thanks   Never mind. I figure it out.  Thanks...

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 can I add rows of blank data to a dataset?
Dim AddRows As Integer For i = 1 To AddRows ds.Tables(0).NewRow() Next I need to add the string "" to each column in each new row?? Thanks in advance, Marc...

Y ADO.NET does not return a simple ReadOnly Query data as a DataTable though we need most of the times a Single Table of Data from DataBase ? Similar to DataAdapter returning a DataSet ! Or can we Typ
Hi All, After we moved from JSP and started developing a web application in ASP.NET, the DataAdapter is used for all sort of operations like insert/update/delete for a table. But, most of the time we need to query the data from db for a Table/View and the returned data will be a Single Table of data. Though ADO.NET has a facility of keeping such a data in DataTable, y does ADO.NET have not provided a way to return a DataTable. Similar to DataAdapter returning a DataSet. Its like a mix up of DataReader and DataAdapter with Read Only component returning DataTable. Or, please let me know...

Data presentation control in another Data presentation control
 Hello,I want to make a menu with datalist or gridview control.Basically,the menu will be like this,Categories     Sub Categories.For example, for COMPUTING category there will be NOTEBOOKS DESKTOPS etc.There will be a image for CATEGORIES and linkbuttons with Subcategories.If I put a datalist inside a datalist and a link button inside the second datalist visually it satisfies my need.However,CommandArguments come from database to linkbutton.Andwhen one of these command buttons is cliked it must go to proper page.I dont know how to wrie an event_handler ,specifically, for...

how can i add row to table of sql with vb.net code?
how can i add row to table of sql with vb.net code?  You can use System.Data.SqlClient classes :  Using con As New SqlConnection(" your connection string goes here ") Dim com As New SqlCommand("Insert into Person (id,name) values(@id,@name) ", con) com.Parameters.AddWithValue("@id", 1) com.Parameters.AddWithValue("@name", "Nomi1") com.Connection.Open...

can I add a row to a data base table with VWD Express
I have a data table I have adabted for my own use and want to add a row to the table. Can I do that with Visual Web developer Express? I can add update modify the colums and data in the exciting table but I cannot figure out how to add a row. This is just a simple datalist of names. firstname lastname. there are 18 of them and i want to add more names-------------------------------------------------ReguardsJay I Hadley WWW.JAYIH.COM jayirvin wrote: I have a data table I have adabted for my own use and want to add a row to the table. Can I do that with Visual Web developer Express? I c...

How to add a blank row into GridView Control, for editing and inserting data into database.
Dear all:      I show my data in browser with ObjectDataSource and GridView .The GridView have Edit,Select,Update functions.However ,I have an idea that: if I click some button, the GridView Control can add one blank row in its bottom where I can Edit data and Insert these data into database.I don't know whether the GridView Control  have these function.      Please give me some advise.      Thanks a lot! The GridView don't support Insert. Take a look at th...

Web resources about - Can We add Data Rows To GridView With out Dataset ot Table - asp.net.presentation-controls

GridView SelectedItem Binding Gotcha in WinRT
Last night when I was doing some WinRT hacking I was trying to setup databinding to the selected item in the GridView control and I ran into ...

CNW Group
Home Services Beyond the Wire About CNW Financials Webcasts Events My CNW All News Releases Advanced Search Gridview Latest News Releases All ...

CNW Group
... Services Beyond the Wire About CNW my CNW CNW Access CNW Directories Financials Webcasts Events my CNW All News Releases Advanced Search Gridview ...

CNW Group
Home Services Beyond the Wire About CNW Financials Webcasts Events My CNW All News Releases Add a Filter Gridview Latest News Releases All Today ...

New CmdLets of Powershell 2.0
New CmdLets of Powershell 2.0

Price Drop: Softbox
... objects- create product reflection- changing the background with something more interestingUse it as:- softbox- honeycomb softbox- gridview ...

Profile.aspx: ASP Alliance
.NET,ASP,ASP.NET,SQL,XML,HTML,ADO,ADO.NET,JavaScript,JScript,CSharp,VBScript and VB tutorials from AspAlliance.

Quick Answers - CodeProject
Questions - Free source code and tutorials for Software developers and Architects.; Updated: 25 Oct 2012

DotNetKicks.com - Upcoming stories
DotNetKicks.com is a community based news site edited by our members. It specialises in .NET development techniques, technologies and tools including ...

View Features - ExtendASP
Call 847-681-9827 or Request a Demo View Features Testimonials Pricing About Us Coming Soon ExtendASP exposes every feature, more than any other ...

Resources last updated: 12/9/2015 10:59:46 AM