| | |
datagrid return value - please help
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2009
Posts: 9
Reputation:
Solved Threads: 0
will someone please help me with this. It seems simple enough but I'm very new to asp and vb. I have a datagrid and I want to know how to access the values in a specific column. The dg is bound to a sql query. The column returns integer values in sql. I want to be able to sum the column and have a button_click command send the datagrid values to 0. I only want to change the datagrid values NOT the sql values (I currently have an Update/Set sql command in vb for this but as I said I only want the Datagrid values to change). Simply put where, if anywhere are the datagrid values stored? I have the column set as a template column and the items are displayed in the datagrid as textboxes (to allow the cells in this column to be changed). can someone please help or at least tell me if this question makes any sense. thank you
1
#2 16 Days Ago
Show us your code work please. You will find some useful information from this MSDN page - http://msdn.microsoft.com/en-us/library/aa479339.aspx
Failure is not fatal, but failure to change might be. - John Wooden
•
•
Join Date: Jan 2009
Posts: 11
Reputation:
Solved Threads: 1
0
#3 15 Days Ago
You can access a perticular colum in dataset by
ds.Tables[0].Rows[0]["Columnname"].ToString()
You can access a particular column of gridview in its Rowdatabound event
Hope one of it may help u
ds.Tables[0].Rows[0]["Columnname"].ToString()
You can access a particular column of gridview in its Rowdatabound event
Hope one of it may help u
•
•
•
•
will someone please help me with this. It seems simple enough but I'm very new to asp and vb. I have a datagrid and I want to know how to access the values in a specific column. The dg is bound to a sql query. The column returns integer values in sql. I want to be able to sum the column and have a button_click command send the datagrid values to 0. I only want to change the datagrid values NOT the sql values (I currently have an Update/Set sql command in vb for this but as I said I only want the Datagrid values to change). Simply put where, if anywhere are the datagrid values stored? I have the column set as a template column and the items are displayed in the datagrid as textboxes (to allow the cells in this column to be changed). can someone please help or at least tell me if this question makes any sense. thank you
•
•
Join Date: Nov 2009
Posts: 9
Reputation:
Solved Threads: 0
0
#4 14 Days Ago
I am able to return all the values of the datagrid except the last column (item.cells(6).text). The vb looks like this
The difference with this column in the asp is that the values returned from the sql query are placed into editable text boxes. the asp for the datagrid is here
how am i to display the values from this template column?
ASP.NET Syntax (Toggle Plain Text)
For Each item In DataGrid1.Items Label1.Text &= "<br />" & item.Cells(0).Text & _ " " & item.Cells(1).Text & _ " " & item.Cells(2).Text & _ " " & item.Cells(3).Text & _ " " & item.Cells(4).Text & _ " " & item.Cells(5).Text & _ " " & item.Cells(6).Text Next item
The difference with this column in the asp is that the values returned from the sql query are placed into editable text boxes. the asp for the datagrid is here
ASP.NET Syntax (Toggle Plain Text)
<asp:DataGrid ID="DataGrid1" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black" GridLines="Horizontal"> <SelectedItemStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" /> <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Left" /> <FooterStyle BackColor="#CCCC99" ForeColor="Black" /> <Columns> <asp:BoundColumn DataField="Order_Line" HeaderText="Line"></asp:BoundColumn> <asp:BoundColumn DataField="TN_CN_S_Desc" HeaderText="Description"> <ItemStyle HorizontalAlign="Left" /> </asp:BoundColumn> <asp:BoundColumn DataField="Item" HeaderText="Item"></asp:BoundColumn> <asp:BoundColumn DataField="Pack" HeaderText="Pack"></asp:BoundColumn> <asp:BoundColumn DataField="Location" HeaderText="Location"></asp:BoundColumn> <asp:BoundColumn DataField="Lot" HeaderText="Lot"></asp:BoundColumn> <asp:TemplateColumn HeaderText="# Labels"> <ItemTemplate> <asp:TextBox runat="server" Style="text-align: right" Text='<%# DataBinder.Eval(Container.DataItem,"Label_Nb") %>' Width="65"></asp:TextBox> </ItemTemplate> <HeaderStyle Font-Bold="True" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Right" /> <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Right" /> </asp:TemplateColumn> </Columns> <PagerStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Left" /> </asp:DataGrid>
how am i to display the values from this template column?
![]() |
Similar Threads
- Help needed... (Search thru datagrid) (Visual Basic 4 / 5 / 6)
- Event from date in DataGrid (VB.NET)
- Same Content Multiple Pages with User Control, tabControl, Gridview? (C#)
- asp.net help needed URGENT (ASP.NET)
- datagrid delete function not auto update (ASP.NET)
- Datagrid inside repeater-simple reference problem (ASP.NET)
- DataGrid: Edit mode, the index of a dropdownlist does not start at the right Value (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: how to upload an asp.net site on any particular domain and how to configure it?
- Next Thread: Editing Registry Keys
| Thread Tools | Search this Thread |
.net 3.5 ajax alltypeofvideos appliances asp asp.net bc30451 beginner box browser businesslogiclayer button c# cac checkbox class commonfunctions control countryselector dataaccesslayer database datagrid datagridview datagridviewcheckbox datalist deployment development dgv dialog dropdownlist dropdownmenu dynamic dynamically edit embeddingactivexcontrol expose fileuploader fill findcontrol flash formatdecimal formview gridview gudi iis javascript list listbox login microsoft mouse mssql nameisnotdeclared news novell numerical opera panelmasterpagebuttoncontrols problem radio redirect registration relationaldatabases reportemail save schoolproject search security sessionvariables silverlight smartcard smoobjects software sql sql-server sqlserver2005 ssl suse textbox tracking treeview unauthorized validatedate validation vb.net video videos vista visualstudio vs2008 web webapplications webdevelopemnt webdevelopment webprogramming webservice wizard xsl youareanotmemberofthedebuggerusers






