Click here to Skip to main content
14,640,723 members
Rate this:
Please Sign up or sign in to vote.
See more:
i have wpf application. my question is i how to assign decimal value which is store in decimal datatype variable into datagridtextcolumn?
Posted
Comments
Mark Salsbery 25-Jun-11 5:03am
   
If there's a decimal property in the row data objects, then you can bind the same as always, like <wpftk:DataGridTextColumn Header="Decimal" Binding="{Binding Path=SomeDecimalProperty}" />

What did you try that didn't work the way you intended?

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

you can use this instead
<datagrid.columns>
    <datagridtemplatecolumn>
        <datagridtemplatecolumn.celltemplate>
            <datatemplate>
                <textblock text="{Binding YourDecimalPropertyHere}" />
            </datatemplate>
        </datagridtemplatecolumn.celltemplate>
    </datagridtemplatecolumn>
</datagrid.columns>
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100