Microsoft GridView Bug

Discussion in 'ASP .Net Datagrid Control' started by Etariq, Jul 29, 2006.

  1. Etariq

    Etariq Guest

    Hi all
    i Dont know if its my code or its a microsoft issu
    i have a gridview that has a Multi header genereated with this Code


    SortedList creatCels = new SortedList();

    creatCels.Add("1", ",5,2");

    creatCels.Add("2", "Comments,4,1");

    creatCels.Add("3", ",1,2");

    SortedList creatCels2 = new SortedList();

    creatCels2.Add("1", "Total Amount of,2,1");

    creatCels2.Add("2", "Total Amount of,2,1");



    this.Master.GetMyMultiHeader(e, creatCels2);

    this.Master.GetMyMultiHeader(e, creatCels);

    this is the methode

    public void GetMyMultiHeader(GridViewRowEventArgs e, SortedList GetCels)

    {

    if (e.Row.RowType == DataControlRowType.Header)

    {

    GridViewRow row;

    IDictionaryEnumerator enumCels = GetCels.GetEnumerator();


    row = new GridViewRow(-1, -1, DataControlRowType.Header,
    DataControlRowState.Normal);

    while (enumCels.MoveNext())

    {

    string[] cont = enumCels.Value.ToString().Split(Convert.ToChar(","));

    TableCell Cell;

    Cell = new TableCell();

    Cell.RowSpan = Convert.ToInt16(cont[2].ToString());

    Cell.ColumnSpan = Convert.ToInt16(cont[1].ToString());

    Cell.Controls.Add(new LiteralControl(cont[0].ToString()));

    Cell.HorizontalAlign = HorizontalAlign.Center;

    Cell.ForeColor = System.Drawing.Color.White;

    row.Cells.Add(Cell);

    }


    e.Row.Parent.Controls.AddAt(0, row);


    }

    }






    when i try to select a row in the grid for some reason the sit gives me the
    wrong data
    but when tracking the the selection its right selection the i have tried
    every thing when selecting from the grid
    from selected index to refrencingthe gridrow and getting its data
    Etariq, Jul 29, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Charles A. Lackman
    Replies:
    1
    Views:
    1,330
    smith
    Dec 8, 2004
  2. SpamProof
    Replies:
    0
    Views:
    534
    SpamProof
    Oct 21, 2003
  3. =?Utf-8?B?ZGF2aWQ=?=

    Microsoft TreeView: Microsoft.Web.UI.WebControls.dll

    =?Utf-8?B?ZGF2aWQ=?=, Apr 11, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    3,585
    Patrick Olurotimi Ige
    Apr 11, 2005
  4. Replies:
    0
    Views:
    3,563
  5. bazzer
    Replies:
    0
    Views:
    897
    bazzer
    Mar 24, 2006
Loading...

Share This Page