2009-08-25 3 views
1

devXpress Gridview가 있으며 특정 행을 편집하는 기능이 있습니다. "dateModified"및 "modifiedBy"라는 두 개의 열이 있습니다. 누군가가 "편집"버튼을 클릭 할 때마다 자동으로이 두 필드에 현재 날짜와 사용자를 채우고 싶습니다. 클라이언트 코드에서이를 수행 할 수있는 방법이 있습니까? AspxGridview 업데이트 행 기본값

내가 지금까지 가지고 있지만, 내가하고 싶은 일을하지 않는 것 같습니다 무엇 :

No default member found for type

어떤 아이디어 :

Protected Sub ASPxGridView1_UpdateRow(ByVal sender As Object, ByVal e As DevExpress.Web.Data.ASPxStartRowEditingEventArgs) Handles grid.StartRowEditing 
    Dim currentTime As Date = System.DateTime.Today 

    e.EditingKeyValue("date_modified") = Format(currentTime, "MM/dd/yyyy") 
    e.EditingKeyValue("modified_by") = Environment.UserName 
End Sub 

나는 그것을 테스트, 그것은 나에게 오류를 준 사용자가 편집 할 때 기본 값을 표시하는 방법은 무엇입니까?

업데이트 : 고정, 다른 사람이이 문제가 들어 솔루션

답변

1

은 아래를 참조,이 그것을 작동하도록하는 방법입니다 :

Protected Sub ASPxGridView1_UpdateRow(ByVal sender As Object, ByVal e As DevExpress.Web.Data.ASPxStartRowEditingEventArgs) Handles grid.StartRowEditing 
    Dim currentTime As Date = System.DateTime.Today 
    grid.GetDataRow(grid.EditingRowVisibleIndex()).Item("date_modified") = Format(currentTime, "MM/dd/yyyy") 
    grid.GetDataRow(grid.EditingRowVisibleIndex()).Item("modified_by") = Environment.UserName 
End Sub 
+0

감사합니다, 그것은 도움이되었다 – SharpAffair