|
 |
|
พิมพ์เลขลง text box ในกริดวิว แล้วให้คำนวณมาใส่อีกช่องทำอย่างไรค่ะ Asp.net |
|
 |
|
|
 |
 |
|
ไม่มีคัยตอบเลย ช่วยหน่อยนะค่ะ โดนเร่งมากๆเลย
|
 |
 |
 |
 |
Date :
2014-02-26 16:15:56 |
By :
T_T |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองใช้ find control ดูครับ
|
 |
 |
 |
 |
Date :
2014-02-26 16:47:25 |
By :
tavada_b |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ใช้ พวก event text change ไรงี้อ่าครับ
|
 |
 |
 |
 |
Date :
2014-02-26 17:19:24 |
By :
mushilove |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ใช้พวก jQuery กับ Selector จะทำได้ครับ แต่อาจจะต้องคล่อง jQuery พอสมควรครับ
|
 |
 |
 |
 |
Date :
2014-02-26 21:10:33 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
jQuery ไม่ถนัดจริงๆค่ะ เลยลองทำแบบนี้ มันพอได้นะแต่ไม่ได้ คือใช้ find control นะค่ะ ถ้ากำหนดค่า text ไว้ใน textbox ในกริดวิวเรียกมาได้ แต่ที่ต้องการคือให้พิมลงไปแล้วเรียกค่าที่พิมพ์ลงไปออกมา มันต้องทำอย่างไรค่ะ ช่วยอธิบายหน่อยนะค่ะ T___T
Code (VB.NET)
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1" Width="1140px"
DataKeyNames="id_core" BackColor="White"
BorderColor="#CCCCCC" BorderStyle="None"
BorderWidth="1px" CellPadding="3" Height="189px" Font-Size="Medium">
<RowStyle ForeColor="#000066" />
<Columns>
<asp:TemplateField>
<ItemTemplate>
<%# Databinder.Eval(Container,"DataItemIndex") + 1 %>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Core Competency (สมรรถนะความสามารถหลัก)"
SortExpression="core">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("core") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("core") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:CommandField SelectText="รายละเอียด" ShowSelectButton="True" />
<asp:TemplateField HeaderText="id_core" SortExpression="id_core"
Visible="False">
<ItemTemplate>
<asp:Label ID="Label11" runat="server" Text='<%# Bind("id_core") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="1 ">
<ItemTemplate>
<asp:TextBox ID="txt1" runat="server" Width="40px" Text = "50" ></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="2">
<ItemTemplate>
<asp:TextBox ID="txt2" runat="server" Width="40px" ></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="3">
<ItemTemplate>
<asp:TextBox ID="txt3" runat="server" Width="40px" ></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="4">
<ItemTemplate>
<asp:TextBox ID="txt4" runat="server" Width="40px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="5">
<ItemTemplate>
<asp:TextBox ID="txt5" runat="server" Width="40px" ></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="เฉลี่ย">
<ItemTemplate>
<asp:TextBox ID="txtavg" runat="server" Width="40px" Enabled = "false" ></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
Protected Sub Button4_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button4.Click
Dim txta As TextBox
Dim txt1a, txt2a, txt3a, txt4a, txt5a, txtavga As TextBox
Dim i As Integer
'For i = 0 To GridView1.Rows.Count - 1
txt1a = CType(GridView1.Rows(1).FindControl("txt1"), TextBox)
txt2a = CType(GridView1.Rows(1).FindControl("txt2"), TextBox)
txt3a = CType(GridView1.Rows(1).FindControl("txt3"), TextBox)
txt4a = CType(GridView1.Rows(1).FindControl("txt4"), TextBox)
txt5a = CType(GridView1.Rows(1).FindControl("txt5"), TextBox)
txtavga = CType(GridView1.Rows(1).FindControl("txtavg"), TextBox)
txt1.Text = txt1a.Text
txt2.Text = txt2a.Text
txt3.Text = txt3a.Text
txt4.Text = txt4a.Text
txt5.Text = txt5a.Text
'Next
End Sub


|
 |
 |
 |
 |
Date :
2014-02-27 16:41:04 |
By :
T_T |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 05
|