I have a database nvarchar field which stores the phone number. I would like to add a column in the grid to display the formatted phone number and add a hyperlink. Some of the cellphone fields can be null, so I am trying to check for that before converting to Int64.
The error I am getting is The best overloaded method match for 'string.IsNullOrWhiteSpace(string)' has some invalid arguments. If I set the ItemTemplate to just Eval("CellPhone") the grid properly displays the cellphone numbers as an unformatted string.
What is the best approach here? Once I get the basic ItemTemplate working, I was going to try to add a hyperlink so users can click on the phone number and invoke the dialing app. ie. tel://2055551234
The error I am getting is The best overloaded method match for 'string.IsNullOrWhiteSpace(string)' has some invalid arguments. If I set the ItemTemplate to just Eval("CellPhone") the grid properly displays the cellphone numbers as an unformatted string.
What is the best approach here? Once I get the basic ItemTemplate working, I was going to try to add a hyperlink so users can click on the phone number and invoke the dialing app. ie. tel://2055551234
<telerik:GridTemplateColumn DataField="CellPhone" FilterControlAltText="Filter CellPhoneNumber column" HeaderText="Cell Phone" UniqueName="CellPhoneNumber"> <ItemTemplate> <%# !string.IsNullOrWhiteSpace(Eval("CellPhone")) ? string.Format("{0:(###)###-####}", Convert.ToInt64(Eval("CellPhone"))) : "" %> </ItemTemplate></telerik:GridTemplateColumn>