Ascending , descending is working fine but i am unable to arrows to the grid , i have tried all the possible ways but couldnt do it , dono where i am going wrong , please help me to achieve the task..
protected void grdInformation_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row != null && e.Row.RowType == DataControlRowType.Header)
{
foreach (TableCell cell in e.Row.Cells)
{
if (cell.HasControls())
{
LinkButton button = cell.Controls[0] as LinkButton;
HtmlGenericControl gv = new HtmlGenericControl("div");
Label lnkName = new Label();
lnkName.Text = button.Text;
if (button != null)
{
Image imageSort = new Image();
imageSort.ImageUrl = "~/images/asc.png";
if (grdInformation.SortExpression == button.CommandArgument)
{
if (grdInformation.SortDirection == SortDirection.Ascending)
{
imageSort.ImageUrl = "~/images/desc.png";
}
else
{
imageSort.ImageUrl = "~/images/asc.png";
}
}
gv.Controls.Add(lnkName);
gv.Controls.Add(imageSort);
button.Controls.Add(gv);
}
}
}
}
}
This is the code i used to add arrows its not working.. please help??
I have Googled i got some answers but that too didnt work..Just need to add arrows rest all working fine..