(1)By ID
CommandArgument='<%# Bind("Pk_CategoryId") %>'
(2)By Data Key
DataKeyNames="Pk_CategoryId"
CommandArgument='<%# Convert.ToString(Container.DataItemIndex) %>'
RowCommand Event
int id = Convert.ToInt32(e.CommandArgument);
if (id >= Convert.ToInt32(grdAreaVillage.PageSize))
{
id = id - (Convert.ToInt32(grdAreaVillage.PageSize) * Convert.ToInt32(grdAreaVillage.PageIndex));
}
decimal AreaVillageId = Convert.ToDecimal(grdAreaVillage.DataKeys[id]["Pk_CategoryId"]);
Fromat Date
Text='<%# Convert.ToDateTime(Eval("AnswerDate")).ToString("MMMM d, yyyy") %>'
Thursday, April 29, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment