Hi,
I would like to achieve this Grid - Automatic Operations but I don't want to use Item Template. I would like to have the edit options so the data could be edited by user. Please guide. Below are my codes:
Thank you in advance
I would like to achieve this Grid - Automatic Operations but I don't want to use Item Template. I would like to have the edit options so the data could be edited by user. Please guide. Below are my codes:
1.
<
telerik:RadGrid
ID
=
"dgvSummary"
runat
=
"server"
AllowPaging
=
"true"
AllowSorting
=
"true"
CellSpacing
=
"0"
PageSize
=
"7"
Skin
=
"Hay"
Width
=
"100%"
GridLines
=
"None"
>
2.
<
MasterTableView
/>
3.
</
telerik:RadGrid
>
01.
Private
Sub
btnSearch_Click(
ByVal
sender
As
Object
,
ByVal
e
As
System.EventArgs)
Handles
btnSearch.Click
02.
Me
.dgvSummary.DataSource =
Me
._PopulatedgvSummary()
03.
04.
If
Me
.dgvSummary.DataSource IsNot
Nothing
Then
05.
Me
.dgvSummary.DataBind()
06.
Me
.pnlSummary.Visible =
True
07.
Else
08.
Me
.pnlSummary.Visible =
False
09.
End
If
10.
End
Sub
01.
Private
Function
_PopulatedgvSummary()
02.
Dim
tblData
As
DataTable =
Me
._GenerateTableShema
03.
Dim
intIndex
As
Integer
= 1
04.
Dim
strEdit
As
String
=
String
.Empty
05.
06.
For
Each
objView_EvalSummaryRow
As
DSHREval.HREvalRow
In
HREvalDALC.GetEvalSummary(
Me
.radDepartment.SelectedValue,
Me
.radPosition.SelectedValue,
Me
.txtStarYear.Text,
Me
.cboStarTerm.SelectedValue)
07.
08.
strEdit =
"<a id="
"popup"
" href="
""
& SharedCommon.GenerateLink(Request, SharedCommon.EditEvaSummary) &
"?"
& SharedCommon.ID &
"="
& objView_EvalSummaryRow.ID.ToString &
""
">"
&
"Edit"
&
"</a>"
09.
tblData.Rows.Add(
New
Object
() {intIndex, objView_EvalSummaryRow.EmpID, objView_EvalSummaryRow.EmpName, objView_EvalSummaryRow.PropertyCode, _
10.
objView_EvalSummaryRow.Department, objView_EvalSummaryRow.PresentPosition, _
11.
objView_EvalSummaryRow.Average, objView_EvalSummaryRow.FinalAverage, strEdit})
12.
13.
intIndex += 1
14.
Next
15.
16.
If
tblData.Rows.Count = 0
Then
17.
tblData =
Nothing
18.
End
If
19.
20.
Return
tblData
21.
End
Function
01.
Private
Function
_GenerateTableShema()
As
DataTable
02.
Dim
tblData
As
New
DataTable
03.
04.
With
tblData.Columns
05.
.Add(
"Num."
)
06.
.Add(
"Staff ID"
)
07.
.Add(
"Name"
)
08.
.Add(
"Property"
)
09.
.Add(
"Department"
)
10.
.Add(
"Position"
)
11.
.Add(
"Average Mark"
)
12.
.Add(
"Final Mark"
)
13.
.Add(
" "
)
14.
End
With
15.
16.
Return
tblData
17.
End
Function
Thank you in advance