problem in grid view

asp.net Madrid, Spain
  • 9 years ago

    iam using a grid view in a tab screen
    iam sorting tat grid if i click the column header as if i click one time it is ascending and another time it is descending...

    my problem is :
     
    i)when i mouse over the column heading it is under lined(like the anchor link) is there any way to avoid it?
     
    ii) and if i click the column heading the grid header gets expanded..i dont know why it is doing so....

    i attached my screen shots

    on click

     

    my codind is:

    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ACT" %>

    <%@ Register Namespace="Unisys.TM.CRMWebControls" TagPrefix="UCC" %>

    <asp:PlaceHolder ID="TeamName" runat="server">

    <div class="collapsePanelHeader">

    Unassigned Team Work:

    <UCC:Label runat="server" ID="lblTeamName" /></div>

    </asp:PlaceHolder>

    <ACT:TabContainer ID="unassignedWork" AutoPostBack="true" runat="server" ActiveTabIndex="0"

    CssClass="ajax__tab_technorati-theme">

    <ACT:TabPanel ID="tabSteps" runat="server" HeaderText="tabSteps">

    <ContentTemplate>

    <div class="collapsePanelHeader">

    <asp:UpdatePanel ID="upStepsRB" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="False">

    <ContentTemplate>

    </ContentTemplate>

    </asp:UpdatePanel>

    </div>

    <div class="content">

    <asp:UpdatePanel ID="upSteps" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="False">

    <ContentTemplate>

    <UCC:GridView ID="stepsGrid" runat="server" Width="100%" GridLines="None" EnableViewState="false"

    HeaderStyle-CssClass="GridViewHeader" DataKeyNames="TaskID" AllowPaging="true"

    PageSize="10" CssClass="GridView" OnPageIndexChanging="StepsGrid_PageIndexChanging"

    AllowSorting="true" AutoGenerateColumns="false" >

    <AlternatingRowStyle BackColor="#FBF5F6" />

    <Columns>

    <asp:TemplateField>

     

    <itemtemplate>

    <asp:Panel id="popupStep" runat="server" CssClass="pnlpopup" Width="98px"></asp:Panel>

    <asp:ImageButton id="stepGridButton" runat="server" HorizontalAlign="Center" ImageUrl="~/Images/CRM/menu_exp_.gif"></asp:ImageButton>

    <ACT:PopupControlExtender id="PopupControlExtender3" runat="server" Position="right"

    PopupControlID="popupStep" TargetControlID="stepGridButton" DynamicControlID="popupStep"

    DynamicContextKey='<%# ReassignStepPopupControl(Eval("TaskID"),Eval("StepName")) %>' DynamicServicePath="WebMethods.aspx"

    DynamicServiceMethod="GetUnassignedTeamStepsActions"></ACT:PopupControlExtender>

    </itemtemplate>

     

    </asp:TemplateField >

    <asp:BoundField HeaderText="Task Type" HeaderStyle-Font-Underline="false " HeaderStyle-ForeColor="white" HeaderStyle-Height="13px" SortExpression="PlanType" DataField="PlanType"/>

    <asp:BoundField HeaderText="Client Name" HeaderStyle-Font-Underline="false " HeaderStyle-ForeColor="white" HeaderStyle-Height="13px" SortExpression="ClientName" DataField="ClientName" />

    <asp:BoundField HeaderText="Task ID" SortExpression="TaskID" DataField="TaskID"/>

    <asp:BoundField HeaderText="Task Name" SortExpression="PlanName" DataField="PlanName"/>

    <asp:BoundField HeaderText="Action Step" SortExpression="StepName" DataField="StepName"/>

    <asp:BoundField HeaderText="Status Date" SortExpression="StatusDate" DataField="StatusDate"/>

    <asp:BoundField HeaderText="Status Description" SortExpression="StatusDesc" DataField="StatusDesc"/>

    <asp:BoundField HeaderText="End Date" SortExpression="EstmCompDate" DataField="EstmCompDate"/>

    <asp:BoundField HeaderText="Task Owner" SortExpression="TaskAssignedTo" DataField="TaskAssignedTo"/>

     

    </Columns>

    <PagerStyle CssClass="GridPager" />

    <PagerTemplate>

    <asp:Button ID="GoFirstPage" runat="server" CommandName="Page" ToolTip="First Page"

    CommandArgument="First" CssClass="first" />

    <asp:Button ID="PrevPage" runat="server" CommandName="Page" ToolTip="Prev." CommandArgument="Prev"

    CssClass="prev" />

    <asp:Button ID="NextPage" runat="server" CommandName="Page" ToolTip="Next" CommandArgument="Next"

    CssClass="next" />

    <asp:Button ID="GoLastPage" runat="server" CommandName="Page" ToolTip="Last Page"

    CommandArgument="Last" CssClass="last" />

    </PagerTemplate>

    <HeaderStyle CssClass="GridViewHeader" />

    </UCC:GridView>

    </ContentTemplate>

    </asp:UpdatePanel>

    </div>

    </ContentTemplate>

    <HeaderTemplate>

    Steps for others

    </HeaderTemplate>

    </ACT:TabPanel>

     

    and aspx.cs:

    using System;

    using System.Data;

    using System.Configuration;

    using System.Collections;

    using System.Web;

    using System.Web.Security;

    using System.Web.UI;

    using System.Web.UI.WebControls;

    using System.Web.UI.WebControls.WebParts;

    using System.Web.UI.HtmlControls;

    using Unisys.TM.UICommon.Helper;

    using Unisys.TM.CRMServices;

    using Resources;

    using Unisys.TM.Resource;

    using Unisys.TM.CRMEntities;

    using Unisys.TM.Framework.TMException;

    using System.Xml.XPath;

    public partial class unassignedTabContainer : Unisys.CRM.BaseForm.BaseCRMControlClass

    {

    public System.Int32 ContactsPage

    {

    get { return System.Convert.ToInt32(Unisys.TM.UICommon.Helper.SessionManager.GetSession("ContactsPage")); }set { Unisys.TM.UICommon.Helper.SessionManager.SetSession("ContactsPage", value); }

    }

    public System.Int32 TasksPage

    {

    get { return System.Convert.ToInt32(Unisys.TM.UICommon.Helper.SessionManager.GetSession("TasksPage")); }

    set { Unisys.TM.UICommon.Helper.SessionManager.SetSession("TasksPage", value); }

    }

    // Added By Keane for CR-Begin

    public System.Int32 StepsPage

    {

    get { return System.Convert.ToInt32(Unisys.TM.UICommon.Helper.SessionManager.GetSession("StepsPage")); }set { Unisys.TM.UICommon.Helper.SessionManager.SetSession("StepsPage", value); }

    }

    // Added By Keane for CR-End

     

    #region OnInit

    #region

    // Modified By: Keane Inc.

    #endregion

    /// <summary>

    /// OnInit Page

    /// </summary>

    /// <param name="e">EventArgs</param>

    protected override void OnInit(EventArgs e)

    {

    base.OnInit(e);

    //Start of Keane modification

    ScriptManager scriptManager;

    string hdnField = string.Empty;

    scriptManager = ScriptManager.GetCurrent(Page);

    hdnField = "var hdnRowValue='" + this.hdnRowValue.ClientID + "'; "

    + "var hdnReassignUserID ='" + this.hdnReassignUserID.ClientID + "'; "

    + "var hdnReassignUserName ='" + this.hdnReassignUserName.ClientID + "'; "

    + "var hdnReassignUserType ='" + this.hdnReassignUserType.ClientID + "'; ";

    ScriptManager.RegisterClientScriptBlock(this.upSteps, this.upSteps.GetType(), "hdnField", hdnField, true);

    string roleString =

     

    "\n var tabcontainername = '" + this.unassignedWork.ClientID + "';" +

    "\n var ReassignOK = '" + this.imgOk.ClientID + "';";

    ScriptManager.RegisterClientScriptBlock(this, this.GetType(),

    "role", roleString, true);

    //End of Keane modification

    }

    #endregion

    protected void Page_Load(object sender, EventArgs e)

    {

    if (!this.ctlPostback)

    {

    lblTeamName.value = Unisys.TM.UICommon.Helper.SessionManager.UserData.UserTeamName;

    ContactsPage = 0;

    TasksPage = 0;

    // Added By Keane for CR-Begin

    StepsPage = 0;

    // Added By Keane for CR-End

    }

    LoadTabContent(unassignedWork);

    taskGrid.SelectedIndexChanged +=
    new EventHandler(TaskGrid_SelectedIndexChanged);

    // Added By Keane for CR-Begin

    stepsGrid.SelectedIndexChanged += new EventHandler(StepsGrid_SelectedIndexChanged);

    stepsGrid.Sorting += new GridViewSortEventHandler(StepsGrid_Sorting);

    // Added By Keane for CR-End

    }

    private void LoadTabContent(AjaxControlToolkit.TabContainer container)

    {

    string tabName = ((container.ActiveTab.ID.ToString() == string.Empty) || (container.ActiveTab.ID.ToString() == null)) ? ("tabTasks") : (container.ActiveTab.ID.ToString());switch (tabName)

    {

    case "tabTasks":

    taskGrid.ShowableFields.Add("PlanType", "TASK TYPE");

    //Modified by Keane - CR #1 - Start

    taskGrid.ShowableFields.Add("ClientID", "ClientID");

    //Modified by Keane - CR #1 - End

    taskGrid.ShowableFields.Add("ClientName", "CLIENT NAME");

    taskGrid.ShowableFields.Add("TaskID", "TASK ID");

    taskGrid.ShowableFields.Add("PlanName", "TASK NAME");

    taskGrid.ShowableFields.Add("StatusDate", "STATUS DATE");

    taskGrid.ShowableFields.Add("CurrentStepName", "CURRENT STEP");

    taskGrid.ShowableFields.Add("CurrentStepStatus", "STEP STATUS");

    taskGrid.ShowableFields.Add("EstmCompDate", "END DATE");

    // Added by Keane for CR #1 - Start

    taskGrid.ShowableFields.Add("ClientType", "Client Type");

    // Added by Keane for CR #1 - End

    taskGrid.Initialize("taskGrid", null);Unisys.TM.CRMServices.SvcTask svcTasks = new Unisys.TM.CRMServices.SvcTask();

    taskGrid.DataSource = svcTasks.GetUnassignedTasks(Unisys.TM.UICommon.Helper.SessionManager.UserData.UserTeam);

    taskGrid.DataBind();

    //Modified by Keane - CR #1 - Start

    taskGrid.Columns[2].Visible = false;

    //Modified by Keane - CR #1 - End

    upTasks.Update();

    break;

    case "tabReferrals":

    //TODO Iteracion II

    break;

    case "tabSteps":

    // Added By Keane for CR-Begin

    //for (int i = stepsGrid.Columns.Count - 1; i >= 1; i--)

    // stepsGrid.Columns.RemoveAt(i);

    // Unisys.TM.CRMServices.SvcTask svcTasksStep = new Unisys.TM.CRMServices.SvcTask();

    //Unisys.TM.CRMEntities.Steps steps = new Unisys.TM.CRMEntities.Steps();

    ViewState["sortExpr"] = null;

    stepsGrid.DataSource = stepsBind();

    stepsGrid.DataBind();

    upSteps.Update();

    upStepsRB.Update();

    // Added By Keane for CR-End

    break;

    }

    }

    #region TaskGrid_SelectedIndexChanged

    /// <summary>

    /// This function gets triggered when a row is seleted from the taskgrid.

    /// and depending on the selected row client search is done and if it is success it will navigate to

    /// Task step view page

    /// </summary>

    /// <param name="sender">object</param>

    /// <param name="e">Event Arguments</param>

    protected void TaskGrid_SelectedIndexChanged(object sender, EventArgs e)

    {

    //Modified By Keane - CR #1 - Start

    try

    {

    string clientID = string.Empty;

    string taskId = string.Empty;

    string planName = string.Empty;

    string clientType = string.Empty;

    string instID = "1001";

    string clientNotice = "Client not found.";

    string individualType = "I";string organizationType = "O";

    Clients clients;

    ClientSearchCriteria clientSearch;

    SvcClient svcClient;

    SessionManager sessionMgr;

    int rowValueID = taskGrid.SelectedIndex;if (rowValueID >= 0)

    {

    clientID = taskGrid.Rows[rowValueID].Cells[2].Text;

    taskId = taskGrid.Rows[rowValueID].Cells[4].Text;

    planName = taskGrid.Rows[rowValueID].Cells[5].Text;

    clientType = taskGrid.Rows[rowValueID].Cells[10].Text;

    //client search

    clientSearch = new ClientSearchCriteria();clientSearch.Account = string.Empty;

    clientSearch.CIF = clientID;

    svcClient = new SvcClient();

    clients = new Clients();if (clientType.Equals(individualType))

    {

    clients = svcClient.SearchClients(0, clientSearch, instID, 1);

    }

    else if (clientType.Equals(organizationType))

    {

    clients = svcClient.SearchClients(1, clientSearch, instID, 1);

    }

    if (clients.Count == 0)

    {

    base.RaiseStatuBarEvent(this, new StatusBarEventArgs(clientNotice));return;

    }

    else

    {

    AddActiveClient(clients[0]);

    SessionManager.SetSession(
    "PlanName", planName);sessionMgr = new SessionManager();

    sessionMgr.TaskID = taskId;

    base.NavigateTo(PAGELOCATION.TASK_STEP_VIEW);

    }

    }

    }

    catch(Exception ex)

    {

    if (ExceptionPolicy.HandleException(ex, RSLOGEXCP.UIPOLICY))

    {

    throw;

    }

    }

    //Modified By Keane - CR #1 - End

    }

    #endregion

    // Added By Keane for CR-Begin

    #region StepsGrid_SelectedIndexChanged Method

    /// <summary>

    /// Function to execute on the change of index

    /// </summary>

    /// <param name="sender">object</param>

    /// <param name="e">EventArgs</param>

    protected void StepsGrid_SelectedIndexChanged(object sender, EventArgs e)

    {

    XPathNavigator xPathNav;

    XPathDocument xPathDoc;

    string clientID = string.Empty;

    string clientType = string.Empty;

    string instID = string.Empty;

    string clientNotice = "Client not found.";

    string individualType = "I";string organizationType = "O";

    ClientSearchCriteria clientSearch;

    SvcClient svcClient;

    Clients clients=
    new Clients();

    SessionManager sessionMgr=new SessionManager();

    int rowValueID = stepsGrid.SelectedIndex;

    string taskId = stepsGrid.Rows[rowValueID].Cells[3].Text;

    string stepName = stepsGrid.Rows[rowValueID].Cells[5].Text;

    string planName=stepsGrid.Rows[rowValueID].Cells[4].Text;

    bool c = false;

    const string NAVRUN_XPATH = "runtimeConfigurationLibrary/institutions/institution[@name='";

    xPathDoc = new XPathDocument(ConfigurationManager.AppSettings["NavRunPath"]);

    xPathNav = xPathDoc.CreateNavigator();

    instID = xPathNav.SelectSingleNode

    (NAVRUN_XPATH +
    ConfigurationManager.AppSettings[SRTMNet.InstitutionName] + "']").GetAttribute("id", "");

    sessionMgr.TaskID = taskId;

    sessionMgr.StepName = stepName;

    if (SessionManager.StepForOtherName.Equals(SRCRM.ClaimStep))

    {

    int index = -1;

    Unisys.TM.CRMServices.SvcTask taskDetails = new Unisys.TM.CRMServices.SvcTask();

    Unisys.TM.CRMEntities.Task task = new Unisys.TM.CRMEntities.Task();

    task = taskDetails.GetDetails(taskId);

    for (int i = 0; i < task.Steps.Count; i++)

    {

    if (stepName.Equals(task.Steps[i].StepName))

    {

    index = i;

    }

    }

    if (index >= 0)

    {

    clientID = task.ClientID;

    clientType = task.Steps[index].ClientType;

    //client search

    clientSearch = new ClientSearchCriteria();clientSearch.Account = string.Empty;

    clientSearch.CIF = clientID;

    svcClient = new SvcClient();

    if (clientType.Equals(individualType))

    {

    clients = svcClient.SearchClients(0, clientSearch, instID, 1);

    }

    else if (clientType.Equals(organizationType))

    {

    clients = svcClient.SearchClients(1, clientSearch, instID, 1);

    }

    string stepCode = task.Steps[index].StepCode;

    int seqNbr = System.Int32.Parse(task.Steps[index].SeqNbr);

    string ownerID = SessionManager.UserData.TellerID;

    Unisys.TM.CRMSupport.Service.SearchType searchType = Unisys.TM.CRMSupport.Service.SearchType.User;

    Unisys.TM.CRMServices.SvcTask svcTasksStep =
    new Unisys.TM.CRMServices.SvcTask();

    c = svcTasksStep.ReassignStep(taskId, stepCode, seqNbr, ownerID, searchType);

    }

     

    }

     

    if (c.Equals(true))

    {

    if (clients.Count == 0)

    {

    base.RaiseStatuBarEvent(this, new StatusBarEventArgs(clientNotice));return;

    }

    else

    {

    AddActiveClient(clients[0]);

    SessionManager.SetSession(
    "PlanName", planName);base.NavigateTo(PAGELOCATION.TASK_STEP_VIEW);

    }

    }

    //SessionManager.SetSession("TaskID", ((System.Web.UI.WebControls.GridView)sender).SelectedValue);

    }

    #endregion StepsGrid_SelectedIndexChanged Method

    // Added By Keane for CR-End

    protected void imgCancel_Click(object sender, EventArgs e)

    {

    SessionManager.StepForOtherName =
    string.Empty;

    //lblTaskDet.Text = string.Empty;

    }

    protected void hdnRowValue_ValueChanged(object sender, EventArgs e)

    {

    int rowIndex = Convert.ToInt32(hdnRowValue.Value);

    //lblTaskDet.Text = stepsGrid.Rows[rowIndex - 1].Cells[4].Text;

    }

    #region imgOk_Click

    #region

    // Added By: Keane Inc.

    #endregion

    /// <summary>

    /// Re-assigns referrals to the selected Users.

    /// </summary>

    /// <param name="sender"></param>

    /// <param name="e"></param>

    protected void imgOk_Click(object sender, EventArgs e)

    {

    string userName = this.hdnReassignUserName.Value;

    string userID = this.hdnReassignUserID.Value;

    string userType = this.hdnReassignUserType.Value;

    int rowValueID = stepsGrid.SelectedIndex;

    string taskId = SessionManager.GetSession("TaskID").ToString();

    string stepName = SessionManager.GetSession("StepName").ToString();

    bool reassignResult = false;

    int index = -1;

    Unisys.TM.CRMServices.SvcTask taskDetails = new Unisys.TM.CRMServices.SvcTask();Unisys.TM.CRMEntities.Task task = new Unisys.TM.CRMEntities.Task();

    task = taskDetails.GetDetails(taskId);

    for (int i = 0; i < task.Steps.Count; i++)

    {

    if (stepName.Equals(task.Steps[i].StepName))

    {

    index = i;

    }

    }

    if (index >= 0)

    {

    string stepCode = task.Steps[index].StepCode;

    int seqNbr = System.Int32.Parse(task.Steps[index].SeqNbr);

    string ownerID = userID;

    Unisys.TM.CRMSupport.Service.SearchType searchType = Unisys.TM.CRMSupport.Service.SearchType.User;

    Unisys.TM.CRMServices.SvcTask svcTasksStep =
    new Unisys.TM.CRMServices.SvcTask();

    reassignResult = svcTasksStep.ReassignStep(taskId, stepCode, seqNbr, ownerID, searchType);

    }

    if (reassignResult)

    {

    SvcTask svcTasksStep =
    new SvcTask();

    Steps steps = svcTasksStep.GetUnassignedSteps(Unisys.TM.UICommon.Helper.SessionManager.UserData.UserTeam);

    stepsGrid.DataSource = steps;

    stepsGrid.DataBind();

    upSteps.Update();

    upStepsRB.Update();

    }

     

    }

    public string ReassignStepPopupControl(object TaskID, object StepName)

    {

    string contextKey = string.Empty;

    contextKey = TaskID.ToString();

    string stepName = StepName.ToString();

    contextKey = contextKey + "|" + stepName;

    return contextKey;

    }

    #endregion

    protected void TasksGrid_PageIndexChanging(Object sender, GridViewPageEventArgs e)

    {

    if ((e.NewPageIndex == 0) || (e.NewPageIndex == 2147483647))

    {

    taskGrid.PageIndex = e.NewPageIndex;

    taskGrid.DataBind();

    upTasks.Update();

    }

    else

    if ((TasksPage + e.NewPageIndex <= taskGrid.PageCount) && (TasksPage - e.NewPageIndex > -1))

    {

    TasksPage += e.NewPageIndex;

    taskGrid.PageIndex = TasksPage;

    taskGrid.DataBind();

    upTasks.Update();

    }

    }

    // Added By Keane for CR-Begin

    #region StepsGrid_PageIndexChanging Method

    /// <summary>

    /// This is used for page index changing

    /// </summary>

    /// <param name="sender"></param>

    /// <param name="e"></param>

    protected void StepsGrid_PageIndexChanging(Object sender, GridViewPageEventArgs e)

    {

    if (e.NewPageIndex >= 0)

    {

    StepsPage += e.NewPageIndex;

    if ((e.NewPageIndex == 0) || (e.NewPageIndex == 2147483647))

    {

    stepsGrid.PageIndex = e.NewPageIndex;

    stepsGrid.DataSource = stepsBind();

    stepsGrid.DataBind();

    upStepsRB.Update();

    upSteps.Update();

    }

    else

    if ((StepsPage + e.NewPageIndex <= stepsGrid.PageCount) && (StepsPage - e.NewPageIndex > -1))

    {

    stepsGrid.PageIndex = StepsPage;

    stepsGrid.DataSource = stepsBind();

    stepsGrid.DataBind();

    upSteps.Update();

    upStepsRB.Update();

    }

    }

    }

    # endregion StepsGrid_PageIndexChanging Method

    #region StepsGrid_Sorting

    /// <summary>

    /// Sort for Grid

    /// </summary>

    /// <param name="sender">object</param>

    /// <param name="e">GridViewSortEventArgs</param>

    protected void StepsGrid_Sorting(object sender, GridViewSortEventArgs e)

    {

    ViewState[
    "sortExpr"] = e.SortExpression;

    stepsGrid.DataSource = stepsBind();

    stepsGrid.DataBind();

    upSteps.Update();

    upStepsRB.Update();

    }

    #endregion

    #region stepsBind

    #region

    // Added By: Keane Inc.

    #endregion

    /// <summary>

    /// Binds Referrals to the GridView

    /// </summary>

    /// <returns>Referrals</returns>

    private DataView stepsBind()

    {

    DataTable dtsteps = new DataTable();

    DataRow drsteps;

    DataView dvsteps;

    SvcTask svcTasksStep = new SvcTask();

    Steps steps = new Steps();

    steps = svcTasksStep.GetUnassignedSteps(Unisys.TM.UICommon.Helper.SessionManager.UserData.UserTeam);

    dtsteps.Columns.Add(
    "PlanType");

    dtsteps.Columns.Add("ClientName");

    dtsteps.Columns.Add("TaskID");

    dtsteps.Columns.Add("PlanName");

    dtsteps.Columns.Add("StepName");

    dtsteps.Columns.Add("StatusDate");

    dtsteps.Columns.Add("StatusDesc");

    dtsteps.Columns.Add("EstmCompDate");

    dtsteps.Columns.Add("TaskAssignedTo");for (int i = 0; i < steps.Count; i++)

    {

    drsteps = dtsteps.NewRow();

    drsteps[
    "PlanType"] = steps[i].PlanType;

    drsteps["ClientName"] = steps[i].ClientName;

    drsteps["TaskID"] = steps[i].TaskID;

    drsteps["PlanName"] = steps[i].PlanName;

    drsteps["StepName"] = steps[i].StepName;

    drsteps["StatusDate"] = steps[i].StatusDate;

    drsteps["StatusDesc"] = steps[i].StatusDesc;

    drsteps["EstmCompDate"] = steps[i].EstmCompDate;

    drsteps["TaskAssignedTo"] = steps[i].TaskAssignedTo;

    dtsteps.Rows.Add(drsteps);

    }

    if (ViewState["sortExpr"] != null)

    {

    dvsteps =
    new DataView(dtsteps);dvsteps.Sort = (string)ViewState["sortExpr"] + " " + getdir(ViewState["sortExpr"].ToString()) ;

    }

    else

    {

    dvsteps = dtsteps.DefaultView;

    }

    return dvsteps;

    }

    #endregion

    private string getdir(string se)

    {

    string lastSort = ViewState["lastSort"] == null ? "ID" : (string)ViewState["lastSort"];

    string lastDirection = ViewState["lastDirection"] == null ? "ASC" : (string)ViewState["lastDirection"];

    if (string.Compare(lastSort, se, true) == 0)

    {

    if (lastDirection == "ASC")

    ViewState["lastDirection"] = "DESC";

    else

    ViewState["lastDirection"] = "ASC";

    }

    else

    ViewState["lastDirection"] = "ASC";

    ViewState["lastSort"] = se;

    return (string)ViewState["lastDirection"];

    }

     

    // Added By Keane for CR-End

    }

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Brevity is the soul of wit” - Shakespeare