Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
550
RowSelectionChanged on webdatagrid does not work.
posted
I want to show a button on select of a Grid row , I am using  RowSelectionChanged  event to enable the button .when i debug on my local the event is fired immediately but which should enable the button on the page ...  but my button is still disabled.

 protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                DataTable dt = new DataTable();
                dt.Clear();
                dt.Columns.Add("Name");
                dt.Columns.Add("Address");
                object[] o = { "abhi""USA" };
                object[] o1 = { "arjun""USA" };
                object[] o2 = { "vijaya""USA" };
                dt.Rows.Add(o);
                dt.Rows.Add(o1);
                dt.Rows.Add(o2);
            Grid.ClearDataSource();
            Grid.DataSource = dt;
            Grid.DataBind();
            EditButton.Enabled = false;
          }
        }
        protected void Grid_RowSelectionChanged(object sender, SelectedRowEventArgs e)
        {
            EditButton.Enabled = true;
        }

    <asp:ScriptManager ID="ScriptManager1" runat="server">   </asp:ScriptManager>   
    <ig:WebDataGrid ID="Grid" runat="server" EnableAppStyling="False" EnableAjax="True" EnableAjaxViewState="true" Height="150px" EnableDataViewState="True"
       AutoGenerateColumns="False"  OnRowSelectionChanged="Grid_RowSelectionChanged" >
                                                      <Columns>
                                                                <ig:BoundDataField DataFieldName="Name" Key="Name" Width="200px" 
                                                                    HtmlEncode="False">
                                                                </ig:BoundDataField>
                                                               <ig:BoundDataField DataFieldName="Address" Key="Address" Width="200px" DataFormatString="">
                                                                </ig:BoundDataField>
                                                            </Columns>
                                                    <Behaviors>
                                                       <ig:Selection Enabled="true"  RowSelectType="Single" CellClickAction="Row">
                                                          <AutoPostBackFlags RowSelectionChanged="True" ></AutoPostBackFlags>  
                                                         </ig:Selection>
                                                     </Behaviors>
                                                </ig:WebDataGrid>
                               <asp:Button runat="server" ID="EditButton"  Text="EDIT"/>