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
445
edit cell after click on a dedicated button
posted

Hello,

I have a webhierarchical datagrid with one parent level and one child.

Outside of this whdg, I have a toolbar with edit, save and cancel buttons.

By default, when I display my page, I would like to have the cell(4) non editable for all childs levels.

When I click on my edit button, I would like to edit cell 4 for all rows in child level. When I click save button, I would like to recover the new data server side in order to save data, then make my cells non editable.

In my grid, I have this:

 

<ig:WebHierarchicalDataGrid ID="GridSampleSize" runat="server" AutoGenerateBands="False"
 AutoGenerateColumns="false" EnableAjax="true" Height="450px" Width="746px" DataKeyFields="MAINKEY,SAMPLESIZE,PHASE"
 ClientEvents-Initialize="gridInit">
 <AjaxIndicator Enabled="False" />
 <ClientEvents RowExpanded="rowExpanded"/>
 <Columns>
  <ig:BoundDataField DataFieldName="PHASE" Key="PHASE">
   <Header Text="<%$ Resources:Labels, lblPHASE %>" />
  </ig:BoundDataField>
  <ig:BoundDataField DataFieldName="APPROVED" Key="APPROVED">
   <Header Text="APPROVED" />
  </ig:BoundDataField>
  <ig:BoundDataField DataFieldName="REJECTED" Key="REJECTED">
   <Header Text="REJECTED" />
  </ig:BoundDataField>
 </Columns>
 <Bands>
  <ig:Band AutoGenerateColumns="False" DataMember="dsMeasSampleSizeEnfant2_DefaultView"
   Key="dsMeasSampleSizeEnfant2_DefaultView">
   <Columns>
    <ig:BoundDataField DataFieldName="POINT" Key="POINT" Width="50px">
     <Header Text="<%$ Resources:Labels, lblPOINT %>" />
    </ig:BoundDataField>
    <ig:BoundDataField Width="250px" DataFieldName="DESCRIPT" Key="DESCRIPT">
     <Header Text="<%$ Resources:Labels, lblDESCRIPT %>" />
    </ig:BoundDataField>
    <ig:BoundDataField DataFieldName="TOLERANCE" Key="TOLERANCE" Width="50px" DataType="System.Decimal">
     <Header Text="<%$ Resources:Labels, lblTOLERANCE %>" />
    </ig:BoundDataField>
    <ig:BoundDataField DataFieldName="SIZE" Key="SIZE" Width="50px" DataType="System.Decimal">
     <Header Text="SIZE" />
    </ig:BoundDataField>
    <ig:BoundDataField DataFieldName="SUPVAL" Key="SUPVAL" Width="140px" DataType="System.Decimal">
     <Header Text="<%$ Resources:Labels, lblSUPVAL %>" />
    </ig:BoundDataField>
   </Columns>
   <Behaviors>
    <ig:EditingCore>
     <Behaviors>
      <ig:CellEditing EditModeActions-EnableF2="true">
       <ColumnSettings>
        <ig:EditingColumnSetting ColumnKey="POINT" ReadOnly="true" />
        <ig:EditingColumnSetting ColumnKey="DESCRIPT" ReadOnly="true" />
        <ig:EditingColumnSetting ColumnKey="TOLERANCE" ReadOnly="true" />
        <ig:EditingColumnSetting ColumnKey="SIZE" ReadOnly="true" />
        <ig:EditingColumnSetting ColumnKey="SUPVAL" ReadOnly="true" />
       </ColumnSettings>
      </ig:CellEditing>
     </Behaviors>
    </ig:EditingCore>
   </Behaviors>
  </ig:Band>
 </Bands>
 <Behaviors>
  <ig:Sorting>
  </ig:Sorting>
 </Behaviors>
 <Behaviors>
  <ig:Activation ActiveRowCssClass="igg_ActiveRow" ActiveCellCssClass="igg_ActiveCell"
   Enabled="true" />
 </Behaviors>
</ig:WebHierarchicalDataGrid> 

 

 And in code behind, when I click on edit, I have this line:

GridSampleSize.Bands["dsMeasSampleSizeEnfant2_DefaultView"].Behaviors.EditingCore.Behaviors.CellEditing.ColumnSettings["SUPVAL"].ReadOnly = false;

 But my cell is always readonly.

Where is my error?

Thanks for your help.

Best Regards

Damien