Professional Web Applications Themes

Datagrid problem in ASP.NET 2.0 - ASP Components

Hello, I've converted an existing ASP.NET 1.1 project to Visual Studio 2005. There is a problem with the Datagrid control. The Update & Cancel commands are not working anymore (Edit is working). Ive noticed that the postback generated javascript has changed since ASP.NET 1.1. For Example in ASP.NET 1.1, the Updade shortcut is "javascript :__doPostBack('dgReceivedHistory$_ctl3$ lbValidate','')" In 2.0 it is now "javascript :__doPostBack('lbValidate','')". The main differences is that there is no more reference to the datagrid in the client ID of the control... Any help apreciated. TIA....

  1. #1

    Default Datagrid problem in ASP.NET 2.0

    Hello,
    I've converted an existing ASP.NET 1.1 project to Visual Studio 2005.
    There is a problem with the Datagrid control. The Update & Cancel commands
    are not working anymore (Edit is working).

    Ive noticed that the postback generated javascript has changed since
    ASP.NET 1.1. For Example in ASP.NET 1.1, the Updade shortcut
    is "javascript:__doPostBack('dgReceivedHistory$_ctl3$ lbValidate','')"
    In 2.0 it is now "javascript:__doPostBack('lbValidate','')".
    The main differences is that there is no more reference to the datagrid in
    the client ID of the control...

    Any help apreciated.
    TIA.
    Olivier MATROT Guest

  2. #2

    Default RE: Datagrid problem in ASP.NET 2.0

    Hello,

    I convert a simple VS.NEt 2003 ASP.NET project with datagrid control (see
    code below) in VS 2005, anyway I didn't found the problem:

    <asp:DataGrid id=DataGrid1 style="Z-INDEX: 101; LEFT: 96px; POSITION:
    absolute; TOP: 48px" runat="server" Width="392px" Height="200px"
    DataSource="<%# dataSet11 %>" autoGenerateColumns="False"
    OnEditCommand="MyDataGrid_Edit"
    OnCancelCommand="MyDataGrid_Cancel"
    OnUpdateCommand="MyDataGrid_Update"
    OnDeleteCommand="MyDataGrid_Delete" DataKeyField="ID">
    <Columns>
    <asp:EditCommandColumn ButtonType="LinkButton" UpdateText="Update"
    CancelText="Cancel" EditText="Edit"></asp:EditCommandColumn>
    <asp:ButtonColumn Text="Delete"
    CommandName="Delete"></asp:ButtonColumn>
    <asp:BoundColumn DataField="ID" ReadOnly="True"
    HeaderText="ID"></asp:BoundColumn>
    <asp:BoundColumn DataField="dd" HeaderText="dd"></asp:BoundColumn>
    </Columns>
    </asp:DataGrid

    protected void MyDataGrid_Cancel(Object sender, DataGridCommandEventArgs e)
    {
    DataGrid1.EditItemIndex = -1;
    DataGrid1.DataBind();


    }
    protected void MyDataGrid_Edit(Object sender, DataGridCommandEventArgs e)
    {
    DataGrid1.EditItemIndex = e.Item.ItemIndex;
    DataGrid1.DataBind();
    }

    The Edit and Cancel works without any flaws. Is there any differences
    between my datagrid and yours?

    BTW, this group is for traditional ASP technology, for such ASP.NET issue,
    you may post in microsoft.public.dotnet.framework.aspnet. And you may be
    luck to find more ASP.NET experts there.

    reagrds,

    Luke

    [MSFT] Guest

Similar Threads

  1. Datagrid problem
    By Raj Anand in forum ASP.NET
    Replies: 19
    Last Post: March 14th, 03:04 PM
  2. problema ultima pagina datagrid asp.net/problem last page datagrid
    By roberto in forum ASP.NET Data Grid Control
    Replies: 1
    Last Post: February 17th, 07:50 AM
  3. problem in datagrid
    By vijay.annan@igate.com in forum ASP.NET Data Grid Control
    Replies: 1
    Last Post: December 7th, 08:25 AM
  4. see this datagrid problem
    By a developer in forum ASP.NET Data Grid Control
    Replies: 0
    Last Post: November 13th, 06:38 AM
  5. Datagrid BIG Problem Please Help
    By Jonathan Dixon in forum ASP.NET Data Grid Control
    Replies: 4
    Last Post: July 1st, 03:17 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139