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
260
Dynamic Field Label
posted

hi,

I need to know is it possible to bind a field label dynamically with a field of an object. Please reply ASAP thanks.

Parents
  • 69686
    Verified Answer
    posted

     Hello,

    Yes, it is possible and quite easily achieved at least what I think you are asking for. You simply have to get the value of the cell (which I think if you saying "field of an object") and set the label to that value like this:

                DataRecord dr = xamDataGrid1.Records[2] as DataRecord;
                var value = dr.Cells[2].Value.ToString();
                xamDataGrid1.FieldLayouts[0].Fields[3].Label = value.ToString();
                xamDataGrid1.UpdateLayout();

    Hope this helps,

    Alex. 

Reply Children
No Data