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
4110
Ultrawebgrid editing
posted

I have an Ultrawebgrid (below) that is loaded dynamically and has several columns, but only one column is editable. It is a numeric value, that can be either a number, percent, or boolean (that must show as yes/no). There is no sorting or paging. My problem is two-fold. 1) I can't figure out how to edit the cells in the value column, also, how to dynamically format the value, number, percent, or boolean(yes/no) depending upon the value in another (hidden) column that notes the record type. Can anyone give me some ideas or an example please? Thanks.

<igtbl:UltraWebGrid ID="igGrid" runat="server" DisplayLayout-AutoGenerateColumns="true"
EnableAppStyling="True" StyleSetName="Office2007Blue" StyleSetPath="~/ig_res/"
DisplayLayout-CellPaddingDefault="5" >
<Bands>
<igtbl:UltraGridBand>
<AddNewRow View="NotSet" Visible="NotSet">
</AddNewRow>
</igtbl:UltraGridBand>
</Bands>
<DisplayLayout BorderCollapseDefault="Separate" CellPaddingDefault="5" Name="igStop"
RowHeightDefault="20px" Version="4.00" >
<FrameStyle>
</FrameStyle>
<ActivationObject BorderColor="" BorderWidth="">
</ActivationObject>
</DisplayLayout>
</igtbl:UltraWebGrid>

Parents
  • 29417
    Verified Answer
    Offline posted

    Hello dbishop9 ,

     

    Thank you for posting in our forum.

     

    Regarding the editing of the cell. If you need only one particular cell to be editable you can set the  Allow Update property under the Updating feature to “Do not allow” and specifically set the AllowUpdate property of the column you want to be editable to AllowUpdate.Yes.

     

    Regarding the dynamic reformatting.There are two approaches you could take.

     

    1)You could change the type of data you send to the column from the data source of the grid before you bind since you may change the Text property of the cell to whatever string you like but the Value would continue containing the data from the data source(for example the shown text in a cell may be “Yes” but when you enter edit mode you’ll have the actual value). This means that the data will be displayed correctly but once you enter edit mode you’ll see the numeric value from the data source.

     

    2) Use an unbound column to show and edit the data and then manually update the data source.

    In this case you can use an unbound column of type string in which you can show the data you want to the user(Yes/No for Boolean, number + % or normal number).

    You could also delete this column on postback and re-create it if you want further control over what it displays. For example if you want it to contain differnt data type or some editor in certain cases or if you want to specify  some Format for that column(with the Format property of the column).

     

    I’m attaching a simple sample for your reference. Let me know if you have any further questions or concerns.

     

    Best Regards,

    Maya Kirova

    Developer Support Engineer

    Infragistics, Inc.

    http://ko.infragistics.com/support

     

    UWG_EditingCell.zip
Reply Children
No Data