You must Sign In to post a response.
  • Category: ASP.NET

    Gridview1.Columns(3).ItemStyle.HorizontalAlign = HorizontalAlign.Center.....Pls Hlp..............

    Grid1.Columns(3).ItemStyle.HorizontalAlign = HorizontalAlign.Center
    Grid view item style Center is not change.

    how is handle.
    pls hlp me.
    adv tks.
  • #220593
    // DataSet ds;
    // Column index starts with 0, so index of 3 means we are dealing with the 4th column.
    // paste the code where you bind the data to the grid view.

    int i = 0;
    foreach (DataRow row in ds.Tables["Table"].Rows)
    {
    GridView1.Rows[i].Cells[3].HorizontalAlign = HorizontalAlign.Center;

    i++;
    }

  • #220606
    Thanks Mr.Suresh
    But Not worked

    For i As Integer = 0 To Grid1.Rows.Count - 1
    Grid1.Rows(i).Cells(7).HorizontalAlign = HorizontalAlign.Right
    Next

  • #220607
    Thanks Mr.Suresh
    But Not worked

    For i As Integer = 0 To Grid1.Rows.Count - 1
    Grid1.Rows(i).Cells(7).HorizontalAlign = HorizontalAlign.Right
    Next


  • This thread is locked for new responses. Please post your comments and questions as a separate thread.
    If required, refer to the URL of this page in your new post.