![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Is there a way to change the formatting expression of a column in the property builder of the datagrid to make boolean values appear as yes/no instead of true/false? |
#3
| |||
| |||
|
|
Is there a way to change the formatting expression of a column in the property builder of the datagrid to make boolean values appear as yes/no instead of true/false? thanks, shane |
#4
| |||
| |||
|
|
You can use PreRender event to go through all items and replace true/false with yes/no. Eliyahu "SStory" <TheStorys (AT) TAKEOUTTHISSPAMBUSTERsofthome (DOT) net> wrote in message news:%23rXfIT3NEHA.3124 (AT) TK2MSFTNGP12 (DOT) phx.gbl... Is there a way to change the formatting expression of a column in the property builder of the datagrid to make boolean values appear as yes/no instead of true/false? thanks, shane |
#5
| |||
| |||
|
|
could you show me a little code please? Thanks for the reply, Shane "Eliyahu Goldin" <removemeegoldin (AT) monarchmed (DOT) com> wrote in message news:%23AWuvEAOEHA.1456 (AT) TK2MSFTNGP09 (DOT) phx.gbl... You can use PreRender event to go through all items and replace true/false with yes/no. Eliyahu "SStory" <TheStorys (AT) TAKEOUTTHISSPAMBUSTERsofthome (DOT) net> wrote in message news:%23rXfIT3NEHA.3124 (AT) TK2MSFTNGP12 (DOT) phx.gbl... Is there a way to change the formatting expression of a column in the property builder of the datagrid to make boolean values appear as yes/no instead of true/false? thanks, shane |
#6
| |||
| |||
|
|
In this example the column # 3 contains boolean value you want to render as "Yes/No" private void myGrid_PreRender(object sender, System.EventArgs e) { // apply PreRender rules to every row foreach (DataGridItem item in (sender as DataGrid).Items) { if (item.Cells[3].Text.ToUpper() == "TRUE") item.Cells[3].Text = "Yes"; else item.Cells[3].Text = "No"; } } Eliyahu "SStory" <TheStorys (AT) TAKEOUTTHISSPAMBUSTERsofthome (DOT) net> wrote in message news:%23hYx44COEHA.3348 (AT) TK2MSFTNGP09 (DOT) phx.gbl... could you show me a little code please? Thanks for the reply, Shane "Eliyahu Goldin" <removemeegoldin (AT) monarchmed (DOT) com> wrote in message news:%23AWuvEAOEHA.1456 (AT) TK2MSFTNGP09 (DOT) phx.gbl... You can use PreRender event to go through all items and replace true/false with yes/no. Eliyahu "SStory" <TheStorys (AT) TAKEOUTTHISSPAMBUSTERsofthome (DOT) net> wrote in message news:%23rXfIT3NEHA.3124 (AT) TK2MSFTNGP12 (DOT) phx.gbl... Is there a way to change the formatting expression of a column in the property builder of the datagrid to make boolean values appear as yes/no instead of true/false? thanks, shane |
#7
| |||
| |||
|
|
awesome solution! Works great. thanks, Shane "Eliyahu Goldin" <removemeegoldin (AT) monarchmed (DOT) com> wrote in message news:eYJ6izLOEHA.3624 (AT) TK2MSFTNGP10 (DOT) phx.gbl... In this example the column # 3 contains boolean value you want to render as "Yes/No" private void myGrid_PreRender(object sender, System.EventArgs e) { // apply PreRender rules to every row foreach (DataGridItem item in (sender as DataGrid).Items) { if (item.Cells[3].Text.ToUpper() == "TRUE") item.Cells[3].Text = "Yes"; else item.Cells[3].Text = "No"; } } Eliyahu "SStory" <TheStorys (AT) TAKEOUTTHISSPAMBUSTERsofthome (DOT) net> wrote in message news:%23hYx44COEHA.3348 (AT) TK2MSFTNGP09 (DOT) phx.gbl... could you show me a little code please? Thanks for the reply, Shane "Eliyahu Goldin" <removemeegoldin (AT) monarchmed (DOT) com> wrote in message news:%23AWuvEAOEHA.1456 (AT) TK2MSFTNGP09 (DOT) phx.gbl... You can use PreRender event to go through all items and replace true/false with yes/no. Eliyahu "SStory" <TheStorys (AT) TAKEOUTTHISSPAMBUSTERsofthome (DOT) net> wrote in message news:%23rXfIT3NEHA.3124 (AT) TK2MSFTNGP12 (DOT) phx.gbl... Is there a way to change the formatting expression of a column in the property builder of the datagrid to make boolean values appear as yes/no instead of true/false? thanks, shane |
#8
| |||
| |||
|
|
You can try this method also . Check out "Manipulating DataSource Values while binding to DataGrid" section in the following article. http://www.microsoft.com/india/msdn/...rQuestions.asp x -- Saravana Microsoft MVP - ASP.NET www.extremeexperts.com "SStory" <TheStorys (AT) TAKEOUTTHISSPAMBUSTERsofthome (DOT) net> wrote in message news:O#Iox0OOEHA.2920 (AT) tk2msftngp13 (DOT) phx.gbl... awesome solution! Works great. thanks, Shane "Eliyahu Goldin" <removemeegoldin (AT) monarchmed (DOT) com> wrote in message news:eYJ6izLOEHA.3624 (AT) TK2MSFTNGP10 (DOT) phx.gbl... In this example the column # 3 contains boolean value you want to render as "Yes/No" private void myGrid_PreRender(object sender, System.EventArgs e) { // apply PreRender rules to every row foreach (DataGridItem item in (sender as DataGrid).Items) { if (item.Cells[3].Text.ToUpper() == "TRUE") item.Cells[3].Text = "Yes"; else item.Cells[3].Text = "No"; } } Eliyahu "SStory" <TheStorys (AT) TAKEOUTTHISSPAMBUSTERsofthome (DOT) net> wrote in message news:%23hYx44COEHA.3348 (AT) TK2MSFTNGP09 (DOT) phx.gbl... could you show me a little code please? Thanks for the reply, Shane "Eliyahu Goldin" <removemeegoldin (AT) monarchmed (DOT) com> wrote in message news:%23AWuvEAOEHA.1456 (AT) TK2MSFTNGP09 (DOT) phx.gbl... You can use PreRender event to go through all items and replace true/false with yes/no. Eliyahu "SStory" <TheStorys (AT) TAKEOUTTHISSPAMBUSTERsofthome (DOT) net> wrote in message news:%23rXfIT3NEHA.3124 (AT) TK2MSFTNGP12 (DOT) phx.gbl... Is there a way to change the formatting expression of a column in the property builder of the datagrid to make boolean values appear as yes/no instead of true/false? thanks, shane |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |