| | |
help with datagrid
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2009
Posts: 9
Reputation:
Solved Threads: 0
I have a datagrid bound to a sql proc. I have made the last column in the datagrid into text boxes so the items are editable. how do i return the values from these cells? Basically I want to be able to sum the entire column, as well as set the values in each item of the column to 0 upon a button_click. I'm very new to vb.net and if I'm not explaining this correctly please let me know.
the datagrid is built through this funtion:
the html for the column that I made editable and want to sum/set to zero looks like this:
the datagrid is built through this funtion:
ASP.NET Syntax (Toggle Plain Text)
Dim strConnString As String Dim strSQLText As String strConnString = ConfigurationManager.ConnectionStrings("SDWConnectionString").ToString strSQLText = "SELECT TN_CN_S_Desc, Item, Pack, Location, Lot, Label_Nb from sdw.sdw_user.SAR_DTD_840_copy where Pick_Num = '" & Picklist & "'" Dim SqlCOnnection As New SqlConnection(strConnString) SqlCOnnection.Open() Dim sqlCmd As New SqlCommand(strSQLText, SqlCOnnection) Dim adapter As New SqlClient.SqlDataAdapter(strSQLText, SqlCOnnection) Dim ds As New DataSet adapter.Fill(ds, "sdw.sdw_user.SAR_DTD_840_copy") Dim dataTable = ds.Tables("sdw.sdw_user.SAR_DTD_840_copy") Me.DataGrid1.DataSource = dataTable Me.DataGrid1.AutoGenerateColumns = False Me.DataGrid1.DataBind()
the html for the column that I made editable and want to sum/set to zero looks like this:
ASP.NET Syntax (Toggle Plain Text)
<asp:TemplateColumn HeaderText="# Labels"> <EditItemTemplate> <asp:TextBox ID="txtlbls" runat="server" Style="text-align: right" Text='<%# DataBinder.Eval(Container.DataItem,"Label_Nb") %>' Width="65"></asp:TextBox> </EditItemTemplate> <ItemTemplate> <asp:TextBox ID="txtlbls" runat="server" Style="text-align: right" Text='<%# DataBinder.Eval(Container.DataItem,"Label_Nb") %>' Width="65"></asp:TextBox> </ItemTemplate> </asp:TemplateColumn>
![]() |
Similar Threads
- Filter record using vb net 2003 through textbox on Datagrid (VB.NET)
- DataGrid SortCommand does not fire (ASP.NET)
- Help with datagrid (VB.NET)
- Printing the datagrid control (ASP.NET)
- Use of DataGrid (ASP.NET)
- Remove link frame around picture in Datagrid (ASP.NET)
- Linking to E-mail through datagrid (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: Retrieve EditItemTemplate controls of GridView at code-behind file
- Next Thread: Membership, Profiles and Security
| 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





