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
167
Issue with copying number 0(zero) from grid to excel
posted

Hi

I am not able to copy the value 0(zero) from number type cell of ultrawebgrid to an excel. If the cell type is of text (string) then 0(zero) will get copied. This issue can also been seen in the samples provided by Ingragistics. Please browse to the Infragistics asp.net samples(http://localhost:1024/igSamples/webfeaturebrowser/default.htm). Go to the grid -> Navigating & Selecting -> Row - Column Selection. Set the cell click action as CellSelect and cell selection as Extended. Edit the Contact ID with values as 0(zero) and copy a set of cells in Contact ID with non-zero values and zero values and paste it in an excel sheet. Please notice that only non-zero values will get copied.

 Thanks,

Vijay

  • 4960
    posted

    You should submit this to http://devcenter.infragistics.com/Protected/SubmitSupportIssue.aspx so our Development Team can have a look at it and notify you of any fix that can be made available.

    At first I thought it might just be an issue of setting the DefaultValue on the UltraGridColumn to a string "0" instead of the integer 0 because a lot of times the integer 0 can appear false in an if-conditional of a loosely-typed scripting language like JavaScript, but that did not do the trick. 

    The thing that worked is (as you say), setting the DataType property on the UltraGridColumn to "System.String".  When I insert the following assignment into the Page_Load method of GridSelections.aspx.cs (the code-behind file for the sample you mention) the copy & paste procedure does copy the zero into Excel:

    UltraWebGrid1.Columns[1].DataType = "System.String"// CallID
    UltraWebGrid1.Columns[3].DataType = "System.String"// ContactID

    Thanks for having spotted this.