| | |
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 2.0 3.5 activexcontrol advice ajax alltypeofvideos asp asp.net bc30451 bottomasp.net browser businesslogiclayer button c# c#gridviewcolumn checkbox class click commonfunctions compatible confirmationcodegeneration content contenttype control countryselector courier css database datagrid datagridview datagridviewcheckbox datalist deadlock deployment development dgv dropdownlist dropdownmenu dynamic edit embeddingactivexcontrol expose findcontrol flash flv formatdecimal forms formview gridview homeedition iframe iis javascript jquery list login menu microsoft mono mssql multistepregistration nameisnotdeclared numerical objects order panelmasterpagebuttoncontrols problem ratings rotatepage save schoolproject search security serializesmo.table silverlight smartcard sql sqlserver2005 ssl suse textbox tracking unauthorized validation vb.net video virtualdirectory vista visual-studio visualstudio vs2008 web webarchitecture webdevelopemnt webdevelopment webservice wizard xml youareanotmemberofthedebuggerusers





