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
670
grid column mapping
posted

Hi,

How can I map an unbound column to a bound column with additional logic? Here is what I am trying to do;

Actual Datatable column : Amount, PC

Display in grid : PC, Prepaid Amount, Collect Amount

If column PC data is set to P, then display Amount in the unbound Prepaid column and clear Collect column

If column PC data is set to C, then display Amount in the unbound Collect column and clear Prepaid column

When update in the grid, bound column Amount needed to be update from either 1 of them.

Thanks !

 

Parents
No Data
Reply
  • 20872
    Offline posted

    Hello,

    What you could do in this case is to add the unbound columns in the InitializeLayout event of the Grid. Populate them in the InitializeRow event of the Grid accordingly to the value of the your first column, like: e.Row.Cells["Desired Column Key"].Value ...

    When you are changing the values of the UltraGrid you could update your desired column accordingly by setting the new value of that column in the BeforeExitEdit mode, of BeforeCellUpdate events, and also to clear the value of the other column, the code snippet might look something like that;

    if (e.Cell.Column.Key == "Desired Column Key" || e.Cell.Column.Key == "Desired  second Column Key" )

    {

    //Do you logic

    Hope this helps.

    Sincerely,

    Danko

    Developer Support Engineer

    Infragistics

    www.infragistics.com/support

     

Children
No Data