0
내 양식 중 하나에서 RadGrid를 사용하여 C#으로 웹 사이트를 개발 중입니다. 내가 클릭하거나 키를 누를 때 또는 다른 이벤트와 때 이을 Acc_Allocated 텍스트 상자에 coloumn AMT의 정확한 값을 전송하려면이 그리드에서coloumn 값을 교환하기위한 RadGrid의 RadNumeric TextBox KeyPress 이벤트
<telerik:RadGrid ID="GridViewAllocation" runat="server" Height="200px" Width="100%"
AutoGenerateColumns="False" GridLines="None"
OnItemDataBound="GridViewAllocation_ItemDataBound"
OnItemCommand="GridViewAllocation_ItemCommand">
<MasterTableView>
<Columns>
<telerik:GridBoundColumn HeaderText="Amount O/S" UniqueName="AMT" DataField="AMT">
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderText="Allocate" UniqueName="Acc_Allocated"
DataField="Acc_Allocated">
<ItemTemplate>
<telerik:RadNumericTextBox ID="TextGirdAmntAlloc" runat="server" Value="0"
CssClass="gridTextEntry" OnTextChanged="TextGirdAmntAlloc_TextChanged"
AutoPostBack="true">
<NumberFormat GroupSeparator="" DecimalDigits="4" />
</telerik:RadNumericTextBox>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn UniqueName="ACC_SOURCE" DataField="ACC_SOURCE" Visible="false">
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
: 아래 RadGrid 내 ASPX 코드입니다. 값을 전송하는 조건은 다음과 같습니다. Acc_Source 값이 "3" 인 경우 값을 전송하십시오. 그렇지 않으면 전송하지 마십시오. 현재 TextChanged 이벤트를 통해 서버 쪽에서 확인하고 있습니다.
다른 방법이 있습니까?
protected void TextGirdAmntAlloc_TextChanged(object sender, EventArgs e)
{
try
{
foreach (GridDataItem GrdItm in GridViewAllocation.MasterTableView.Items)
{
decimal GrdAccAllocAmnt = Convert.ToDecimal(((RadNumericTextBox)GrdItm.FindContro("TextGirdAmntAlloc")).Text);
if (GrdItm["ACC_SOURCE"].Text == "3")
{
LblAmnt_Alloc.Text = GrdItm.Cells[4].Text;
((RadNumericTextBox)GrdItm.FindControl("TextGirdAmntAlloc")).Text = GrdItm.Cells[4].Text;
}
}
}
catch { }
}
감사하지만, 그것의 클라이언트 측에서 열을 액세스하기 위해 아래 링크로 시도하십시오 get_cell.innerhtml – user1102001
의 속성을 설정할 수 있습니다 오류를주는. http://jayeshgoyani.blogspot.in/2012/07/access-radgrid-on-client.html#634843672348620742 –